It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Bamboo Git authentication fails

I'm completely new to both Bamboo and Git, so bear with me. I'm running Bamboo 4.4.5 and Git 1.7 on Ubuntu 12.04. I can't seem to get Bamboo to access my remote Git repository no matter how I format the repo URL. I've tried, with authentication set to username/password. I've tred, with username/password. Among other combinations, I even tried https://GretaChang:*****, with the password where the asterisks are. All of them give me the same error log, with the slightest differences in the fatal error message:

Caused by: com.atlassian.bamboo.plugins.git.GitCommandException: command /usr/bin/git ls-remote failed with code 128. Working directory was [.]., stderr:
[fatal: Authentication failed]
	at com.atlassian.bamboo.plugins.git.NativeGitOperationHelper.getRemoteRefs(
	at com.atlassian.bamboo.plugins.git.NativeGitOperationHelper.resolveBranch(
	at com.atlassian.bamboo.plugins.git.NativeGitOperationHelper.obtainLatestRevision(
	at com.atlassian.bamboo.plugins.git.GitRepository.collectChangesSinceLastBuild(
	... 43 more
Caused by: com.atlassian.bamboo.plugins.git.GitCommandException: command /usr/bin/git ls-remote failed with code 128. Working directory was [.]., stderr:
[fatal: Authentication failed]
	at com.atlassian.bamboo.plugins.git.GitCommandProcessor.runCommand(
	at com.atlassian.bamboo.plugins.git.GitCommandProcessor.getRemoteRefs(
	at com.atlassian.bamboo.plugins.git.NativeGitOperationHelper$
	at com.atlassian.bamboo.plugins.git.NativeGitOperationHelper$
	at com.atlassian.bamboo.plugins.git.CallableResultCache$1.load(
	at com.atlassian.bamboo.plugins.git.CallableResultCache$1.load(
	... 48 more

Running the command "/usr/bin/git ls-remote" in a terminal winow works perfectly fine. I'm pretty sure the cause is something silly that I'm not aware of, but I've been searching for hours and have yet to find and answer. Can anyone help?

9 answers

1 accepted

0 votes
Answer accepted

I managed to get things working on a different machine with the same setup. Not sure what exactly caused the problem, but I can at least just use that for now and get on with learning to use Bamboo. If anyone does know what the problem was, I'd still love to know.

I had the same problem I had been trying to connect to Bitbucket repository.

It was caused by default server capabilities.

I had to add a Git Executable for SSH.


image2015-2-10 17:3:35.png

and then add it to build plan.

image2015-2-10 17:5:24.png


Hope you find it useful.

2 votes
rsperafico Atlassian Team Apr 14, 2014

Hi Guys,

If you are planning on using SSH keys, please make sure they have been added to your ssh keys.

Use the following command to list your ssh keys in the terminal:

ssh-add -l

Use the following command to add an ssh key in the terminal:

ssh-add <path to your ssh private key>

Once you have done that, please add your credentials to "Shared credentials" under "Bamboo Administration" >> "Shared repositories" >> "Shared credentials" and add the credentials. Please remember you have to add a SSH private key and its password in there.

As well as that, you can add a "Shared repository" under "Bamboo Administration" >> "Shared repositories" and select "Authentication Type" as "Shared credentials".

Kind regards,


Please try this in the remote-agent and the server

git config --global http.sslVerify false


Having exactly the same issue!!

Using ssh-keys based authentication solved the issue for me.

Same problem, I first tried authenticating with userID/password to the repository, and it worked fine. Then tried to use the SSH key authentication and got this error:

Caused by: com.atlassian.bamboo.plugins.git.GitCommandException: command /usr/bin/git ls-remote git:// failed with code 128. Working directory was [.]., stderr:
[[0:]: errno=Connection timed out,[0:]: errno=Connection timed out, fatal: unable to connect a socket (Connection timed out)]

Then later on I again ensured I had my SSH key setup in my BitBucket repository, and same problem.

Later on in the day, I tried one more time, and all worked. Maybe BitBucket was having some problems, OR I needed to wait for some period of time for the SSH public key to be recognized to the system?

I hit an authentication issue with Git attempting to run my first bamboo project-plan. Among other text, the authentication error included:

ssh://<proj>/<repo>.git failed with code 128.

For me, the problem was "Shared credentials" were not yet configured in bamboo so, apparently, the connection to stash was attempted with bamboo's current user/admin credentials (sysadmin) and that was failing.

The lack of shared credentials was not immediately apparent to me as the shared credentials page 'helps' by partially filling the form for you. Revisiting that page led me to believe 'yes. bamboo has autogenerated a credential to talk to stash for me.'

Eventually I realized shared credentials had not been configured and I filled in the display name/ssh key fields. The display name was an actual user name. The ssh key came from the user's ~/.ssh/id_rsa file contents.

You might want to try Bamboo 5.5. We automatically figure out authentication for Stash when you have an app link.

Like Sergey_Gorbunov likes this

Yes! Thank You. Updated this morning.

I am having the same issue. I even changes the global configurations of git for the bamboo server machine to match to that of the repository's credentials


Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Bamboo

Cannot save a repository using Chrome v83 and other Chromium based browsers such as Edge

Hello Bamboo Community, I'm Jey from Bamboo Support team. If you have upgraded your Chrome browser to version 83 recently, it is observed that the save operation just spins and never completes w...

728 views 2 6
Read article

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you