Unable to push annotated tags to Bitbucket server where LFS (Large File System) File lock is enabled.
プラットフォームについて: サーバーと Data Center のみ。この記事は、サーバーおよび Data Center プラットフォームのアトラシアン製品にのみ適用されます。
要約
When there are multiple files locked by the users in an LFS-enabled repository and someone tries to push a tag into it, it times out. There are no other errors in the logs. But you will still be able to create the tag from the Bitbucket UI.
環境
Bitbucket server <6.10.11, 7.6.6, 7.12.1
診断
When the push command is being executed, it doesn't return any other error. It just times out like below after hours.
git push origin tagname
"/usr/bin/git -c core. hooksPath-hooks receive-pack <bitbucket_home>/shared/data/repositories/1" timed out on server.
If we run the same command with debug mode, like below, it runs in an infinite loop for more than 24 hours and fetches the locks.
GIT_TRACE=1 GIT_TRANSFER_TRACE=1 GIT_CURL_VERBOSE=1 git push --tags
git lfs locks
command lists more than 100+ locks on files of the repository.
原因
The git lfs locks --verify
command that runs as part of the git push
, runs infinitely when there are more than 100 LFS files with locks in the repository. There is already a bug raised for this.
So because of this, the push command never completes.
ソリューション
As a workaround, you can push the tags with the --no-verify parameter. This skips the lock verification.
git push --tags --no-verify
The permanent fix for this problem would be to upgrade to a fixed version listed in the bug report, which are 7.6.6, 6.10.11 and 7.12.1.