git-lfs / git-lfs

Git extension for versioning large files
https://git-lfs.com
Other
12.94k stars 2.04k forks source link

`git push` always tries to lock lfs resources #1881

Closed milianw closed 7 years ago

milianw commented 7 years ago

Hey all,

with today's update of git lfs, I cannot push in my - arguably specific - git setup:

I have two remotes:

Until last week, this worked fine. Today, I get this instead when trying to push a code review from my host system to the gerrit server:

git version 2.11.0
git-lfs/1.5.0 (GitHub; linux amd64; go 1.7.4)

git push gerrit HEAD:refs/for/KDAB_feature
17:24:58.376529 git.c:600               trace: exec: 'git-push-gerrit' '-v'
17:24:58.376563 run-command.c:350       trace: run_command: 'git-push-gerrit' '-v'
17:24:58.377326 git.c:299               trace: alias expansion: push-gerrit => 'push' 'gerrit' 'HEAD:refs/for/KDAB_feature'
17:24:58.377412 git.c:600               trace: exec: 'git-push' 'gerrit' 'HEAD:refs/for/KDAB_feature' '-v'
17:24:58.377419 run-command.c:350       trace: run_command: 'git-push' 'gerrit' 'HEAD:refs/for/KDAB_feature' '-v'
17:24:58.378939 git.c:371               trace: built-in: git 'push' 'gerrit' 'HEAD:refs/for/KDAB_feature' '-v'
Pushing to ssh://milian@codereview.kdab.com:29418/repo.git
17:24:58.379906 run-command.c:350       trace: run_command: 'ssh' '-p' '29418' 'milian@codereview.kdab.com' 'git receive-pack --reviewer=foo.bar@kdab.com '\''/repo.git'\'''
17:24:58.703244 run-command.c:350       trace: run_command: '.git/hooks/pre-push' 'gerrit' 'ssh://milian@codereview.kdab.com:29418/repo.git'
17:24:58.706725 git.c:600               trace: exec: 'git-lfs' 'pre-push' 'gerrit' 'ssh://milian@codereview.kdab.com:29418/repo.git'
17:24:58.706744 run-command.c:350       trace: run_command: 'git-lfs' 'pre-push' 'gerrit' 'ssh://milian@codereview.kdab.com:29418/repo.git'
trace git-lfs: run_command: 'git' version
trace git-lfs: run_command: 'git' config -l -f /ssd/milian/projects/kdab/repo.git/.lfsconfig
trace git-lfs: run_command: 'git' config -l
trace git-lfs: tq: running as batched queue, batch size of 100
trace git-lfs: HTTP: GET https://git:secret@git-uk:9999/locks
locking: http: Get https://git:secret@git-uk:9999/locks: dial tcp <some-ip>:9999: i/o timeout
error: failed to push some refs to 'ssh://milian@codereview.kdab.com:29418/repo.git'

I removed/changed some stuff above to keep potentially sensitive data private. I hope this does not make it unclear.

As you can see, it tries to get the git lfs locks, which is not accessible on my host - it is only accessible from within the docker container, which knows what git-uk actually is (custom /etc/hosts entry + VPN setup).

This essentially means I cannot push any changes to code review now. Is there any way I can workaround this? I don't see why pushing to this second remote should touch anything in git lfs? My changes do not touch any of the large files either.

technoweenie commented 7 years ago

That's an issue on the master branch of Git LFS. Try the latest release.

Also, if you're on Arch Linux, by chance, then there's a known issue with the PKGBUILD for Git LFS that always builds on master.

milianw commented 7 years ago

Ah yes, this is from arch, thanks a lot - I'll use the latest release then.

Thanks a lot for the quick reply. I guess we keep this open until it gets fixed in master?

Cheers

technoweenie commented 7 years ago

This is being tracked in https://github.com/git-lfs/git-lfs/issues/1878. It includes a hacked PKGBUILD too if you need one: https://gist.github.com/delcypher/120b6222f39d00539fee4c0229582a11

milianw commented 7 years ago

Uhm, no - I just double-checked - building git-lfs from AUR gets me v1.5.5 from the page you linked me to, i.e.

$ sha256sum v1.5.5.tar.gz 
9f79bb8d5e29155ceabb4c5044df30a6759a97dba23f4121637f4c357a4abb23  v1.5.5.tar.gz
$ sha1sum v1.5.5.tar.gz 
a03bbb287a53c7ad01928d3b1c76e26286e88ff6  v1.5.5.tar.gz

The problem persists.

milianw commented 7 years ago

Ah ok, I just saw your latest reply - thanks.

ttaylorr commented 7 years ago

@milianw after downgrading LFS you'll need to run git lfs install --force to overwrite the changed hooks.