Details
-
Bug
-
Resolution: Unresolved
-
Low
-
None
-
8.2.4, 9.4.1
-
None
-
4
-
Severity 3 - Minor
-
1
-
Description
Problem
Rebuild with a custom revision that does not exist on the current branch fails with fatal: bad object error when it is performed on an agent that does not have the commit already in the Git cache.
Steps to Reproduce
- Create a build plan linked to a git repository
- Run the plan as customized and specify a revision that does not exist on the current branch
- The build will succeed as Bamboo will detect the revision doesn't exist on the branch and perform a full fetch
- Perform a rebuild of that same build on the same agent, it will succeed
- Clear the Git cache for that repository on the agent or dedicate the plan to an agent that has never fetched that revision to populate its cache.
- Rebuild it on that new agent or the agent that had its Git cache cleared
Expected Results
Bamboo performs a full fetch on the rebuild and can successfully perform the build
Actual Results
Bamboo does not perform a full fetch on rebuild and the build fails
The below error is present in the build log:
Caused by: com.atlassian.bamboo.plugins.git.GitCommandException: command [/usr/local/bin/git log -1 --encoding=UTF-8 --format=%H 7c2cf3faa342ee28674a9ab91795b7c3a504b24d] failed with code 128. Working directory was [/Users/user/bamboo-agent-home/xml-data/build-dir/_git-repositories-cache/1de3badc407e6ee60f0392d61c0934e3924af8b4]., stderr: fatal: bad object 7c2cf3faa342ee28674a9ab91795b7c3a504b24d at com.atlassian.bamboo.plugins.git.GitCommandProcessor.runCommand(GitCommandProcessor.java:773) at com.atlassian.bamboo.plugins.git.GitCommandProcessor.runCommand(GitCommandProcessor.java:702) at com.atlassian.bamboo.plugins.git.GitCommandProcessor.getShaOf(GitCommandProcessor.java:459) at com.atlassian.bamboo.plugins.git.GitCommandProcessor.getShaOf(GitCommandProcessor.java:431) at com.atlassian.bamboo.plugins.git.NativeGitOperationHelper.checkRevisionExistsInCacheRepository(NativeGitOperationHelper.java:720)
Workaround
Enable Plan Configuration >> Repositories >> (select a repository) >> Advanced Options >> Fetch whole repository to ensure full fetches are always performed and do the rebuild.
However this will mean that the entire repository (all branches) needs to be fetched which will increase your build times – so you may want to disable it again after performing the rebuild.
Attachments
Issue Links
- mentioned in
-
Page Loading...