Bamboo failed to run git

Some log, i use bamboo-java-build image.

 

11-Mar-2015 21:05:24Build gaea - gaea-nightly - Nightly Deploy #8 (GAEA-GAEAN-JOB1-8) started building on agent Elastic Agent on i-fa79bdf7
11-Mar-2015 21:05:24Build working directory is /home/bamboo/bamboo-agent-home/xml-data/build-dir/GAEA-GAEAN-JOB1
11-Mar-2015 21:05:24Executing build gaea - gaea-nightly - Nightly Deploy #8 (GAEA-GAEAN-JOB1-8)
11-Mar-2015 21:05:24Starting task 'Checkout Default Repository' of type 'com.atlassian.bamboo.plugins.vcs:task.vcs.checkout'
11-Mar-2015 21:05:24Build always requires a clean checkout
11-Mar-2015 21:05:24Cleaning build directory '/home/bamboo/bamboo-agent-home/xml-data/build-dir/GAEA-GAEAN-JOB1'
11-Mar-2015 21:05:24Updating source code to revision: 808c2eb0fa4815d8b1057edcf88fbbf447380750
11-Mar-2015 21:05:24Updating source code to revision: 808c2eb0fa4815d8b1057edcf88fbbf447380750
11-Mar-2015 21:05:25Updating source code to revision: 808c2eb0fa4815d8b1057edcf88fbbf447380750
11-Mar-2015 21:05:25Error occurred while running Task 'Checkout Default Repository(1)' of type com.atlassian.bamboo.plugins.vcs:task.vcs.checkout.
11-Mar-2015 21:05:25java.lang.RuntimeException: com.atlassian.bamboo.plugins.git.GitCommandException: command /usr/bin/git version failed with code -1. Working directory was [/]., stderr:
11-Mar-2015 21:05:25        at com.atlassian.bamboo.executor.RetryingTaskExecutor.rerun(RetryingTaskExecutor.java:132)
11-Mar-2015 21:05:25        at com.atlassian.bamboo.executor.RetryingTaskExecutor.runTask(RetryingTaskExecutor.java:88)
11-Mar-2015 21:05:25        at com.atlassian.bamboo.executor.RetryingTaskExecutor.retry(RetryingTaskExecutor.java:191)
11-Mar-2015 21:05:25        at com.atlassian.bamboo.executor.RetryingTaskExecutor.retry(RetryingTaskExecutor.java:176)
11-Mar-2015 21:05:25        at com.atlassian.bamboo.plugins.vcs.task.VcsCheckoutTask.execute(VcsCheckoutTask.java:172)
11-Mar-2015 21:05:25        at com.atlassian.bamboo.task.TaskExecutorImpl.executeTasks(TaskExecutorImpl.java:220)
11-Mar-2015 21:05:25        at com.atlassian.bamboo.task.TaskExecutorImpl.executePreparationTasks(TaskExecutorImpl.java:73)
11-Mar-2015 21:05:25        at com.atlassian.bamboo.build.pipeline.tasks.PrepareBuildTask.call(PrepareBuildTask.java:74)
11-Mar-2015 21:05:25        at com.atlassian.bamboo.v2.build.agent.DefaultBuildAgent.build(DefaultBuildAgent.java:188)
11-Mar-2015 21:05:25        at com.atlassian.bamboo.v2.build.agent.BuildAgentControllerImpl.waitAndPerformBuild(BuildAgentControllerImpl.java:112)
11-Mar-2015 21:05:25        at com.atlassian.bamboo.v2.build.agent.DefaultBuildAgent$1.run(DefaultBuildAgent.java:110)
11-Mar-2015 21:05:25        at com.atlassian.bamboo.utils.BambooRunnables$1.run(BambooRunnables.java:49)
11-Mar-2015 21:05:25        at com.atlassian.bamboo.security.ImpersonationHelper.runWith(ImpersonationHelper.java:31)
11-Mar-2015 21:05:25        at com.atlassian.bamboo.security.ImpersonationHelper.runWithSystemAuthority(ImpersonationHelper.java:20)
11-Mar-2015 21:05:25        at com.atlassian.bamboo.security.ImpersonationHelper$1.run(ImpersonationHelper.java:52)
11-Mar-2015 21:05:25        at java.lang.Thread.run(Thread.java:701)
11-Mar-2015 21:05:25Caused by: com.atlassian.bamboo.plugins.git.GitCommandException: command /usr/bin/git version failed with code -1. Working directory was [/]., stderr:
11-Mar-2015 21:05:25        at com.atlassian.bamboo.plugins.git.GitCommandProcessor.runCommand(GitCommandProcessor.java:551)
11-Mar-2015 21:05:25        at com.atlassian.bamboo.plugins.git.GitCommandProcessor$1.load(GitCommandProcessor.java:177)
11-Mar-2015 21:05:25        at com.atlassian.bamboo.plugins.git.GitCommandProcessor$1.load(GitCommandProcessor.java:168)
11-Mar-2015 21:05:25        at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3568)
11-Mar-2015 21:05:25        at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2350)
11-Mar-2015 21:05:25        at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2313)
11-Mar-2015 21:05:25        at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2228)
11-Mar-2015 21:05:25        at com.google.common.cache.LocalCache.get(LocalCache.java:3965)
11-Mar-2015 21:05:25        at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:3969)
11-Mar-2015 21:05:25        at com.google.common.cache.LocalCache$LocalManualCache.get(LocalCache.java:4829)
11-Mar-2015 21:05:25        at com.atlassian.bamboo.plugins.git.GitCommandProcessor.checkGitExistenceInSystem(GitCommandProcessor.java:203)
11-Mar-2015 21:05:25        at com.atlassian.bamboo.plugins.git.NativeGitOperationHelper.<init>(NativeGitOperationHelper.java:87)
11-Mar-2015 21:05:25        at com.atlassian.bamboo.plugins.git.GitOperationHelperFactory.createGitOperationHelper(GitOperationHelperFactory.java:25)
11-Mar-2015 21:05:25        at com.atlassian.bamboo.plugins.git.GitRepository.retrieveSourceCode(GitRepository.java:385)
11-Mar-2015 21:05:25        at com.atlassian.bamboo.plugins.git.GitRepository.retrieveSourceCode(GitRepository.java:358)
11-Mar-2015 21:05:25        at com.atlassian.bamboo.plugins.git.GitRepository.retrieveSourceCode(GitRepository.java:350)
11-Mar-2015 21:05:25        at com.atlassian.bamboo.plugins.hg.BitbucketRepository.retrieveSourceCode(BitbucketRepository.java:309)
11-Mar-2015 21:05:25        at com.atlassian.bamboo.plugins.vcs.task.VcsCheckoutTask.fillWorkingDirFromVcs(VcsCheckoutTask.java:259)
11-Mar-2015 21:05:25        at com.atlassian.bamboo.plugins.vcs.task.VcsCheckoutTask.access$100(VcsCheckoutTask.java:56)
11-Mar-2015 21:05:25        at com.atlassian.bamboo.plugins.vcs.task.VcsCheckoutTask$2.call(VcsCheckoutTask.java:177)
11-Mar-2015 21:05:25        at com.atlassian.bamboo.plugins.vcs.task.VcsCheckoutTask$2.call(VcsCheckoutTask.java:173)
11-Mar-2015 21:05:25        at com.atlassian.bamboo.executor.RetryingTaskExecutor.rerun(RetryingTaskExecutor.java:108)
11-Mar-2015 21:05:25        ... 15 more
11-Mar-2015 21:05:25Caused by: com.atlassian.utils.process.ProcessNotStartedException: /usr/bin/git could not be started
11-Mar-2015 21:05:25        at com.atlassian.utils.process.ExternalProcessImpl.start(ExternalProcessImpl.java:332)
11-Mar-2015 21:05:25        at com.atlassian.utils.process.ExternalProcessImpl.execute(ExternalProcessImpl.java:113)
11-Mar-2015 21:05:25        at com.atlassian.bamboo.plugins.git.GitCommandProcessor.runCommand(GitCommandProcessor.java:542)
11-Mar-2015 21:05:25        ... 36 more
11-Mar-2015 21:05:25Caused by: java.io.IOException: Cannot run program "/usr/bin/git" (in directory "/"): java.io.IOException: error=2, No such file or directory
11-Mar-2015 21:05:25        at java.lang.ProcessBuilder.start(ProcessBuilder.java:488)
11-Mar-2015 21:05:25        at com.atlassian.utils.process.ExternalProcessImpl.createDefaultProcess(ExternalProcessImpl.java:367)
11-Mar-2015 21:05:25        at com.atlassian.utils.process.ExternalProcessImpl.createProcess(ExternalProcessImpl.java:375)
11-Mar-2015 21:05:25        at com.atlassian.utils.process.ExternalProcessImpl.start(ExternalProcessImpl.java:329)
11-Mar-2015 21:05:25        ... 38 more
11-Mar-2015 21:05:25Caused by: java.io.IOException: java.io.IOException: error=2, No such file or directory
11-Mar-2015 21:05:25        at java.lang.UNIXProcess.<init>(UNIXProcess.java:164)
11-Mar-2015 21:05:25        at java.lang.ProcessImpl.start(ProcessImpl.java:81)
11-Mar-2015 21:05:25        at java.lang.ProcessBuilder.start(ProcessBuilder.java:470)
11-Mar-2015 21:05:25        ... 41 more
11-Mar-2015 21:05:25Failed to prepare the build 'gaea - gaea-nightly - Nightly Deploy #8 (GAEA-GAEAN-JOB1-8)'
11-Mar-2015 21:05:25Running on server: post build plugin 'Clover Delta Calculator'
11-Mar-2015 21:05:25Running on server: post build plugin 'Build Hanging Detection Configuration'
11-Mar-2015 21:05:25Running on server: post build plugin 'NCover Results Collector'
11-Mar-2015 21:05:25Running on server: post build plugin 'Maven Dependencies Postprocessor'
11-Mar-2015 21:05:25All post build plugins have finished
11-Mar-2015 21:05:25Generating build results summary...
11-Mar-2015 21:05:25Saving build results to disk...
11-Mar-2015 21:05:25Indexing build results...
11-Mar-2015 21:05:25Finished building GAEA-GAEAN-JOB1-8.

1 answer

0 vote

Hello Albert,

Thank you for your question.

Could you please run the following from terminal, please:

# displays git location
which git
 
# displays git version
git --version
 
echo $PATH

In Bamboo, please do not forget to Define a new version control capability.

Please, add a Script task to your build with the following command:

# it will display all environment variables available to Bamboo, including Git capability
set
 
# displays git location
which git

# displays git version
git --version

If you find this answer useful, I would kindly ask you to accept it so the same will be visible to others who might be facing the same issue you have inquired.

Thank you for your understanding.

Kind regards,
Rafael P. Sperafico
Atlassian Support

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published May 18, 2017 in Bamboo

FAQ: How to Upgrade Bamboo Server

Bamboo 5.9 will no longer be supported after June 12, 2017. What does this mean? As part of our End of Life policy, Atlassian supports major versions for two years after the first major iteratio...

1,561 views 0 6
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you