Bamboo Source code checkout task fails with "no submodule mapping found in .gitmodules for path 'script'"

お困りですか?

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

コミュニティに質問


プラットフォームについて: 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 は除く

要約

When the build tries to run the Source code checkout task it fails with an error similar to this:

error Caused by: com.atlassian.bamboo.repository.RepositoryException: Checkout to revision 7c3c7b5a26c35ba3752c043b25c7d7e27f3c16b82 has failed.command [/usr/bin/git submodule update --init --recursive] failed with code 128. Working directory was [/root/bamboo-agent-home/xml-data/build-dir/PROJECT-PLAN-JOB1]., stderr: 
error fatal: no submodule mapping found in .gitmodules for path 'script' 

環境

The issue is seen on Bamboo 7.1.2 but is applicable to any supported version.

診断

The problem is seen while trying to run a build that has a Source code checkout task. The build is going to fail and in the logs you will see the following error:

error Caused by: com.atlassian.bamboo.repository.RepositoryException: Checkout to revision 7c3c7b5a26c35ba3752c043b25c7d7e27f3c16b82 has failed.command [/usr/bin/git submodule update --init --recursive] failed with code 128. Working directory was [/root/bamboo-agent-home/xml-data/build-dir/PROJECT-PLAN-JOB1]., stderr: 
error fatal: no submodule mapping found in .gitmodules for path 'script' 

原因

This error message suggests that the Git submodule update command failed while trying to checkout a specific revision ('7c3c7b5a26c35ba3752c043b25c7d7e27f3c16b82') in the repository. The specific error is related to the submodule 'script'.

The subsequent error message "fatal: no submodule mapping found in .gitmodules for path 'script'" reiterates that the submodule 'script' is not properly mapped in the .gitmodules file.

(info) This file should contain the necessary information about the submodule, such as its repository URL and the relative path where it should be located within the parent repository.

ソリューション

To resolve this issue, you should check the .gitmodules file in the parent repository and ensure that there is an entry for the 'script' submodule. Verify that the mapping is correct, including the relative path to the submodule's location. If the entry is missing or incorrect, you'll need to update it accordingly.

After making the necessary changes to the .gitmodules file, commit the changes and try the checkout process again. This should allow Git to properly initialize and update the submodule during the checkout process.

最終更新日: 2023 年 12 月 21 日

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

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