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

Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.

Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

Summary

Problem

Unable to checkout Git Code when using CentOS.

The following appears in the atlassian-bamboo.log

1 2 3 4 5 6 7 8 9 10 11 12 13 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.

Solution

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.

Updated on April 2, 2025

Still need help?

The Atlassian Community is here for you.