Bamboo build fails with error "git: 'lfs' is not a git command"

お困りですか?

アトラシアン コミュニティをご利用ください。

コミュニティに質問

プラットフォームについて: Server および Data Center のみ。この記事は、Server および Data Center プラットフォームのアトラシアン製品にのみ適用されます。

Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Fisheye および Crucible は除く

要約

Bamboo will try to build a build plan that requires git lfs, in a remote agent where git lfs is installed, and fails with the error "git: 'lfs' is not a git command".

環境

Bamboo running with at least one remote agent.

診断

When the build is sent to the remote agent, the build will fail and in the server logs we will see:

atlassian-bamboo.log
com.atlassian.bamboo.repository.RepositoryException: : Cannot fetch branch 'feature/branch1' from 'ssh://git@gitserver:7999/project/repository.git' to source directory '/app/bamboo/bamboo-home/xml-data/build-dir/_git-repositories-cache/328a912ef82c8415aa64f494d23dbae966f741dc'. command [/app/bamboo/bamboo-home/git/bin/git lfs logs last] failed with code 1. Working directory was [/app/bamboo/bamboo-home/xml-data/build-dir/_git-repositories-cache/328a912ef82c8415aa64f494d23dbae966f741dc]., stderr:
git: 'lfs' is not a git command. See 'git --help'.


原因

Even if the build is trying to be built in a remote agent, the problem relies on the server itself. The Bamboo server requires git lfs installed, even though there are no local agents configured. The reason for this is that Bamboo will perform a fetch before dispatching the build, and this is the actual operation that fails.

There can be cases where there is a plan that requires git lfs and still works fine, even though git lfs is not installed in the server. If you see this case, it is working because git lfs was not configured from the start, and Bamboo was able to create a local cache of the repository, making the fetch unnecessary.


ソリューション

Install git lfs in Bamboo server.

 In case after installing git lfs on Bamboo server, the builds fail with the error "can’t execute git-lfs binary file", make sure to check if the newly installed git lfs executable is installed on the correct architecture, for example - if you try to run x86 executables on an ARM CPU, you can see this message. You can run the command "file git-lfs" to understand what sort of binary the file is.

最終更新日: 2024 年 2 月 19 日

この内容はお役に立ちましたか?

はい
いいえ
この記事についてのフィードバックを送信する
Powered by Confluence and Scroll Viewport.