Running branch merge builds throws Merge Command Error: Runtime Exception
プラットフォームについて: Server および Data Center のみ。この記事は、Server および Data Center プラットフォームのアトラシアン製品にのみ適用されます。
サーバー*製品のサポートは 2024 年 2 月 15 日に終了しました。サーバー製品を利用している場合は、アトラシアンのサーバー製品のサポート終了のお知らせページにて移行オプションをご確認ください。
*Fisheye および Crucible は除く
問題
When running a build that performs a branch merge, the following error appears in the UI:
atlassian-bamboo.log に次のメッセージが出力される。
2016-06-22 10:11:02,891 WARN [6-DelayedChangeDetectionThread:pool-12-thread-48] [ChainExecutionManagerImpl] Merge command error: Runtime exception.
診断
To confirm this issue you can enable more detailed logging in Bamboo's com.atlassian.bamboo.chains.ChainExecutionManagerImpl class:
- Go to Bamboo Admin >> Settings >> Log Settings
Add the following class and set the type to DEBUG:
ClassPath タイプ com.atlassian.bamboo.chains.ChainExecutionManagerImpl DEBUG Reproduce the issue and check
$BAMBOO_HOME/logs/atlassian-bamboo.logfor a line similar to the following:error: unable to resolve reference refs/heads/this-is-a-really-really-really-really-really-really-really-really-really-really-really-really-really-really-really-really-really-really-long-branch-name: Filename too long ! [new branch] this-is-a-really-really-really-really-really-really-really-really-really-really-really-really-really-really-really-really-really-really-long-branch-name -> this-is-a-really-really-really-really-really-really-really-really-really-really-really-really-really-really-really-really-really-really-long-branch-name (unable to update local ref)
原因
When performing a merge, Bamboo will do a full checkout of the repository and will gather all the current branch names whilst updating the head. If one of the branch names is too long, it will cause the update head task to fail, and the merge of any branch will not be able to complete.
The maximum possible length of a branch name depends on a number of factors:
- オペレーティング システム
- On Windows systems, file path limits are much lower, and the unpacking of the branch head may exceed the file system path limit of 260 characters, so the length of the full path to the build working directory may be related
- Different versions of git may exhibit different limitations
- Bamboo's internal DB schema stores branch names in a 255 character field
ソリューション
Check the repository in question for extremely long branch names and remove them if found, and subsequent builds of any branch should not run into this issue
