Unable to checkout Git Code from AWS Codecommit when Bamboo installed on Linux Distribution

Still need help?

The Atlassian Community is here for you.

Ask the community

Problem

Unable to checkout Git Code when using CentOS.

The following appears in the atlassian-bamboo.log

com.atlassian.bamboo.plugins.git.GitCommandException: command [/usr/bin/git -c credential.helper= -c 'credential.helper=store --file=/var/cache/bamboo/temp/gitCredentials1144011424118739094.tmp' ls-remote ssh://git.amazonaws.com/v1/repos/UMO] failed with code 128. Working directory was [/var/cache/bamboo/temp]., stderr:
Could not create directory '/usr/share/bamboo/.ssh'.
Warning: Permanently added 'git.amazonaws.com,52.12.123.12' (RSA) to the list of known hosts.
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
	at com.atlassian.bamboo.plugins.git.GitCommandProcessor.runCommand(GitCommandProcessor.java:703)
	at com.atlassian.bamboo.plugins.git.GitCommandProcessor.getRemoteRefs(GitCommandProcessor.java:481)
	at com.atlassian.bamboo.plugins.git.NativeGitOperationHelper.lambda$getRemoteRefs$1(NativeGitOperationHelper.java:585)
	at com.atlassian.bamboo.util.CallableResultCache$1.load(CallableResultCache.java:38)
	at com.atlassian.bamboo.util.CallableResultCache$1.load(CallableResultCache.java:34)
	at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3527)

Diagnosis

Environment

  • Bamboo is on Linux (It will impact all Linux Distributions) and connecting Git on AWS using SSH.
  • You need to have ssh private and a public key configured for the bamboo user and ssh config file as per AWS documentation is needed too.

Cause

Home directory for the bamboo user was missing due to which it was failing. 

Resolution


Make sure that you have the home directory of the user (used to start the Bamboo) configured and have the ownership and the privileges as well.

Last modified on May 14, 2018

Was this helpful?

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