Git fails to extract changesets and returning a stub changeset

Still need help?

The Atlassian Community is here for you.

Ask the community

Symptoms

Bamboo 5.5 is being used and the following appears in the atlassian-bamboo.log:

2014-05-04 22:13:58,581 ERROR [4-BAM::PlanExec:pool-8-thread-3] [GitRepository] : Failed to extract changesets, will return a stub changeset.
com.atlassian.bamboo.plugins.git.GitCommandException: command /usr/bin/git log --format=%H --ancestry-path 96a0f365073698bf84f34bf61cd232a577bc65e6..8f4dd668df1178275c41c8a3475fe13404b9a759 failed with code 128. Working directory was [/path/to/bamboo-home/xml-data/build-dir/_git-repositories-cache/cd0495e1395daf57169a324f945f7be59821e732]., stderr:

	at com.atlassian.bamboo.plugins.git.GitCommandProcessor.runCommand(GitCommandProcessor.java:551)
	at com.atlassian.bamboo.plugins.git.GitCommandProcessor.runLogCommand(GitCommandProcessor.java:608)
	at com.atlassian.bamboo.plugins.git.NativeGitOperationHelper.extractCommits(NativeGitOperationHelper.java:566)
	at com.atlassian.bamboo.plugins.git.GitRepository$2.get(GitRepository.java:301)
	at com.atlassian.bamboo.plugins.git.GitRepository$2.get(GitRepository.java:285)
	at com.atlassian.util.concurrent.ManagedLocks$ManagedLockImpl.withLock(ManagedLocks.java:303)
	at com.atlassian.bamboo.plugins.git.GitRepository.collectChangesSinceLastBuild(GitRepository.java:284)
	at com.atlassian.bamboo.plugins.git.GitRepository.collectChangesSinceLastBuild(GitRepository.java:211)
	at com.atlassian.bamboo.v2.trigger.DefaultChangeDetectionManager.collectionChangesWithRetry(DefaultChangeDetectionManager.java:472)
	at com.atlassian.bamboo.v2.trigger.DefaultChangeDetectionManager.collectChangesSinceLastBuildInternal(DefaultChangeDetectionManager.java:333)
	at com.atlassian.bamboo.v2.trigger.DefaultChangeDetectionManager.collectChangesSinceRevisions(DefaultChangeDetectionManager.java:261)
	at com.atlassian.bamboo.v2.trigger.DefaultChangeDetectionManager.collectChangesSinceRevisions(DefaultChangeDetectionManager.java:153)
	at com.atlassian.bamboo.v2.trigger.DefaultChangeDetectionManager.collectChangesSinceLastBuildIfTriggered(DefaultChangeDetectionManager.java:115)
	at com.atlassian.bamboo.v2.trigger.ChangeDetectionListenerAction.testIfBuildShouldStart(ChangeDetectionListenerAction.java:113)
	at com.atlassian.bamboo.plan.PlanExecutionManagerImpl$3.call(PlanExecutionManagerImpl.java:481)
	at com.atlassian.bamboo.plan.PlanExecutionManagerImpl$3.call(PlanExecutionManagerImpl.java:465)
	at com.atlassian.util.concurrent.ManagedLocks$ManagedLockImpl.withLock(ManagedLocks.java:312)
	at com.atlassian.bamboo.plan.PlanExecutionLockServiceImpl.lock(PlanExecutionLockServiceImpl.java:81)
	at com.atlassian.bamboo.plan.PlanExecutionManagerImpl.doWithProcessLock(PlanExecutionManagerImpl.java:741)
	at com.atlassian.bamboo.plan.PlanExecutionManagerImpl.startConditionalBuild(PlanExecutionManagerImpl.java:464)
	at com.atlassian.bamboo.plan.PlanExecutionManagerImpl.start(PlanExecutionManagerImpl.java:535)
	at com.atlassian.bamboo.plan.PlanExecutionManagerImpl.start(PlanExecutionManagerImpl.java:552)
	at com.atlassian.bamboo.plan.NonBlockingPlanExecutionServiceImpl$3.startPlanExecution(NonBlockingPlanExecutionServiceImpl.java:166)
	at com.atlassian.bamboo.plan.NonBlockingPlanExecutionServiceImpl$3$1.run(NonBlockingPlanExecutionServiceImpl.java:145)
	at com.atlassian.bamboo.util.CacheAwareness.whileReadingThroughCaches(CacheAwareness.java:85)
	at com.atlassian.bamboo.util.CacheAwareness.whileReadingThroughCaches(CacheAwareness.java:102)
	at com.atlassian.bamboo.plan.NonBlockingPlanExecutionServiceImpl$3.call(NonBlockingPlanExecutionServiceImpl.java:148)
	at com.atlassian.bamboo.plan.NonBlockingPlanExecutionServiceImpl$3.call(NonBlockingPlanExecutionServiceImpl.java:133)
	at java.util.concurrent.FutureTask.run(FutureTask.java:262)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
	at com.atlassian.bamboo.utils.BambooRunnables$1.run(BambooRunnables.java:49)
	at com.atlassian.bamboo.security.ImpersonationHelper.runWith(ImpersonationHelper.java:31)
	at com.atlassian.bamboo.security.ImpersonationHelper.runWithSystemAuthority(ImpersonationHelper.java:20)
	at com.atlassian.bamboo.security.ImpersonationHelper$1.run(ImpersonationHelper.java:52)
	at java.lang.Thread.run(Thread.java:744)
Caused by: com.atlassian.utils.process.ProcessException: Non-zero exit code: 128
	at com.atlassian.utils.process.PluggableProcessHandler.complete(PluggableProcessHandler.java:69)
	at com.atlassian.utils.process.ExternalProcessImpl.wrapUpProcess(ExternalProcessImpl.java:659)
	at com.atlassian.utils.process.ExternalProcessImpl.finish(ExternalProcessImpl.java:161)
	at com.atlassian.utils.process.ExternalProcessImpl.execute(ExternalProcessImpl.java:114)
	at com.atlassian.bamboo.plugins.git.GitCommandProcessor.runCommand(GitCommandProcessor.java:543)
	... 35 more

Also, from a terminal window, going to 

/path/to/bamboo-home/xml-data/build-dir/_git-repositories-cache/cd0495e1395daf57169a324f945f7be59821e732

And running

/usr/bin/git log --format=%H --ancestry-path 96a0f365073698bf84f34bf61cd232a577bc65e6..8f4dd668df1178275c41c8a3475fe13404b9a759

Fails with the following message:

fatal: unrecognized argument: --ancestry-path

Cause

/usr/bin/git is pointing to an old Git installation, e.g., 1.7.1. Versions prior to 1.7.9 are not supported according to the Bamboo 5.5 Supported Platforms.

Resolution

Upgrade Git to at least 1.7.9, in which version the --ancestry-path parameter was added. Please note that this might not automatically update /usr/bin/git to make it point to this new installation, so please also check if, after the installation, /usr/bin/git is indeed pointing to 1.7.9, by running:

/usr/bin/git --version

Also, please check if your Git capability is pointing to /usr/bin/git.

Last modified on Nov 2, 2018

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.