Hosting LFS files on other sites makes it impossible to push
Summary
Our project needs to host LFS objects on a site other than where the repository lies, because the connection to the repository site is slow and not ideal for transferring large files. It was done by setting the LFS url in .lfsconfig
file to a empty repository , which is for LFS service only, on a different host.
After upgrading to 10.2, such practice seems no longer work. When pushing commits with LFS records, the repository returns following error:
remote: GitLab: LFS objects are missing. Ensure LFS is properly set up or try a manual "git lfs push --all".
To http://A.com/lfs/lfs-test.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'http://A.com/lfs/lfs-test.git'
As we set the LFS url to:
Endpoint=https://username:password@B.com/lfs/lfs-test.git/info/lfs (auth=none)
I think the error means that there's no corresponding LFS object on the repository server, which is true - we uploaded them onto the B.com. It seems that the repository don't take the overridden LFS url for LFS object checking.
We tried to use the default LFS url. Everything was ok.
We tried to use a lower version of GitLab (9.x). It worked fine.
Steps to reproduce
- Create a repo on A.com
- Create a repo on B.com (which should not be on the same host as A.com, for isolating the LFS object storage)
- Clone the A.com/repo.git and cd to it
- Run
git config -f .lfsconfig lfs.url "http://B.com/repo.git/info/lfs"
- Run
git lfs track *.png
- Add some png files and commit
- Push the repo and the error will show up
What is the current bug behavior?
The repository server declines the push as it cannot find corresponding LFS objects
What is the expected correct behavior?
Successful pushes
Relevant logs and/or screenshots
Error message:
1 file changed, 1 insertion(+), 1 deletion(-)
Git LFS: (2 of 2 files) 3.64 MB / 3.64 MB
Counting objects: 14, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (14/14), done.
Writing objects: 100% (14/14), 1.43 KiB | 1.43 MiB/s, done.
Total 14 (delta 5), reused 0 (delta 0)
remote: GitLab: LFS objects are missing. Ensure LFS is properly set up or try a manual "git lfs push --all".
To http://gitlab.80166.com:8001/lfs/lfs-test-flybot.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'http://A.com/lfs/lfs-test.git'
LFS env:
git version 2.13.6 (Apple Git-96)
Endpoint=https://username:password@B.com/lfs/lfs-test.git/info/lfs (auth=none)
LocalWorkingDir=/Users/xxx/utilProjects/lfs-test
LocalGitDir=/Users/xxx/utilProjects/lfs-test/.git
LocalGitStorageDir=/Users/xxx/utilProjects/lfs-test/.git
LocalMediaDir=/Users/xxx/utilProjects/lfs-test/.git/lfs/objects
LocalReferenceDir=
TempDir=/Users/xxx/utilProjects/lfs-test/.git/lfs/tmp
ConcurrentTransfers=3
TusTransfers=false
BasicTransfersOnly=false
SkipDownloadErrors=false
FetchRecentAlways=false
FetchRecentRefsDays=7
FetchRecentCommitsDays=0
FetchRecentRefsIncludeRemotes=true
PruneOffsetDays=3
PruneVerifyRemoteAlways=false
PruneRemoteName=origin
AccessDownload=none
AccessUpload=none
DownloadTransfers=basic
UploadTransfers=basic
git config filter.lfs.process = "git-lfs filter-process"
git config filter.lfs.smudge = "git-lfs smudge -- %f"
git config filter.lfs.clean = "git-lfs clean -- %f"