-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
LFS files in forks fail to download via separate remote or PR ref #17715
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Looks like, I was wrong. I tested 1.12 and it works with that version (but is not correct I think). After creating the PR blob list does only show a single pointer (that's wrong because of the new PR branch?). Seems like the download request associated the pointer, so my changes in #16865 or #15523 may be the reason of the problem. |
The old code created the database references when downloading files. I changed that in #15523 so that only upload requests are able to do that. Reasons:
So the question is how we would like to handle this problem. Personally I don't like to bring back file association in the download request. Auto-sync when creating a PR? |
I vote later. |
And just FYI, I remember this issue: #17207 , are they related? That issue also said about the behavior differs between Gitea release. |
Yes, I think they are related. Just putting the files in the directory does not associate the repo to them. |
I agree they are probably related and I've run into this issue as well. As a workaround you can do a |
Temporary measure to work around go-gitea#17715
We are hosting a private Gitea server behind a VPN, so I've temporarily reintroduced the associate-LFS-pointers-on-download code for a hacked-up local build, in case anyone else needs the temporary workaround: https://github.com/go-gitea/gitea/compare/v1.15.6...parnic-sks:associate-lfs-obj-on-download?expand=1 |
I built 1.15.6 cherry-picked the changes from parnic-sks@768aaab and it did not fix issue #17207. Detail below. We got a new bundle with LFS updates. I extracted the new LFS files, fetched the branch, and tried to push to origin. It would not push due |
That one commit is not enough, you need the entire branch diff. parnic-sks@3872374 was actually the correct fix, but it needs the commit after that to fix the nil user deref. |
Sorry I mean I cherry-picked the whole branch. |
Any update here? We are continuing to maintain the aforementioned patch on top of each Gitea release, but I'd love if we could find a more permanent solution that didn't require hand-building each version. (sorry for the double comment, I keep using the wrong account...) |
Temporary measure to work around go-gitea#17715
Temporary measure to work around go-gitea#17715
Temporary measure to work around go-gitea#17715
Temporary measure to work around go-gitea#17715
OK the PR is a bit of a false flag here.
This will fail. Clearly this breaks any use of forks with LFS and needs to be fixed. Ah actually looking at the git lfs documentation this appears to be a standard issue
to get the lfs objects on the remote branch prior to checking out the branch or...
|
I have the exactly the same problem here. Repo B is forked from repo A, if I clone B to local, and add an upstream for repo A, then fetch A, merge A, and a 404 error occurs. Cannot download LFS files from A. |
Temporary measure to work around go-gitea#17715
Temporary measure to work around go-gitea#17715
Temporary measure to work around go-gitea#17715
Temporary measure to work around go-gitea#17715
Temporary measure to work around go-gitea#17715
Temporary measure to work around go-gitea#17715
Temporary measure to work around go-gitea#17715
Temporary measure to work around go-gitea#17715
Temporary measure to work around go-gitea#17715
Temporary measure to work around go-gitea#17715
Temporary measure to work around go-gitea#17715
Patch taken from upstream Gitea issue go-gitea#17715, associating the LFS pointer when the file is downloaded.
Temporary measure to work around go-gitea#17715
Temporary measure to work around go-gitea#17715
Temporary measure to work around go-gitea#17715
Temporary measure to work around go-gitea#17715
Temporary measure to work around go-gitea#17715
Temporary measure to work around go-gitea#17715
Temporary measure to work around go-gitea#17715
Temporary measure to work around go-gitea#17715
Temporary measure to work around go-gitea#17715
Just want to mention that it seems to break LFS mirror and migration from external sources. They have nothing to do with forks and PRs and at least should download and add file association. |
Temporary measure to work around go-gitea#17715
Temporary measure to work around go-gitea#17715
Temporary measure to work around go-gitea#17715
Patch taken from upstream Gitea issue go-gitea#17715, associating the LFS pointer when the file is downloaded.
Patch taken from upstream Gitea issue go-gitea#17715, associating the LFS pointer when the file is downloaded.
Temporary measure to work around go-gitea#17715
Temporary measure to work around go-gitea#17715
Temporary measure to work around go-gitea#17715
While I agree that associate on download is not ideal, there should be an auto-sync that associates all the files in PR. This would allow the commits and its LFS objects can be checked out in target repository. |
Hoping this gets some attention at some point. This is a brutally frustrating issue. |
I believe 0 A.D. has the same, or a similar issue when syncing forks via the web UI. |
Gitea Version
1.15.6
Git Version
Seen on different servers running 2.25.1 and 2.34.0
Operating System
Ubuntu 20.04.3
How are you running Gitea?
One server is manually deployed from a GitHub release and started with a systemd script. The other uses the
apt
-installed version of Gitea.Database
PostgreSQL
Can you reproduce the bug on the Gitea demo site?
No
Log Gist
I can gather a log if that would be helpful. I've included clear repro steps in the description.
Description
LFS files are failing to download from forks. The only reason I can't repro on try.gitea.io is because LFS doesn't seem to be enabled. This is my minimal repro (visible at https://git.pernicious.games/try-gitea-lfs/lfs-fork-test and the fork at https://git.pernicious.games/cpickett/lfs-fork-test/src/branch/fork-1).
Note that we are pretty sure this used to work on our Gitea installation months ago, so it may be caused by a relatively recent Gitea version (maybe 1.15+).
The repro steps are:
Now clone the base repo somewhere else and try to either pull from the remote or the PR ref:
git clone https://git.pernicious.games/try-gitea-lfs/lfs-fork-test.git
)git remote add parnic https://git.pernicious.games/cpickett/lfs-fork-test.git
,git fetch parnic
)git switch fork-1
)git restore .
,git fetch origin pull/1/head:test
,git switch test
)Note that the LFS file at the specified revision/hash exists in the fork, e.g.: https://git.pernicious.games/cpickett/lfs-fork-test.git/info/lfs/objects/7ffc8bb3b0c443a3d170b1f6aa402a66c6de86c49dd2d74e452d6d82b855939f/direct
but it does not exist in the base repo: https://git.pernicious.games/try-gitea-lfs/lfs-fork-test.git/info/lfs/objects/7ffc8bb3b0c443a3d170b1f6aa402a66c6de86c49dd2d74e452d6d82b855939f/direct
This is important because when running
git lfs fetch --all
we see that it is trying to pull from the base org, not the fork:Finally, note that the LFS file does exist on the disk under the generic LFS directory. For this example, that's
/var/lib/gitea/data/lfs/7f/fc/8bb3b0c443a3d170b1f6aa402a66c6de86c49dd2d74e452d6d82b855939f
Screenshots
No response
The text was updated successfully, but these errors were encountered: