Bamboo Git authentication fails

Greta Chang
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
June 19, 2013

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 https://GretaChang@razer.git.cloudforge.com/systems.git, with authentication set to username/password. I've tred https://razer.git.cloudforge.com/systems.git, with username/password. Among other combinations, I even tried https://GretaChang:*****@razer.git.clouforge.com/systems.git, 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.google.common.util.concurrent.UncheckedExecutionException: com.atlassian.bamboo.plugins.git.GitCommandException: command /usr/bin/git ls-remote https://razer.git.cloudforge.com/sytems.git failed with code 128. Working directory was [.]., stderr:
[fatal: Authentication failed]
	at com.google.common.cache.AbstractCache.getUnchecked(AbstractCache.java:51)
	at com.atlassian.bamboo.plugins.git.CallableResultCache.call(CallableResultCache.java:82)
	at com.atlassian.bamboo.plugins.git.NativeGitOperationHelper.getRemoteRefs(NativeGitOperationHelper.java:512)
	at com.atlassian.bamboo.plugins.git.NativeGitOperationHelper.resolveBranch(NativeGitOperationHelper.java:447)
	at com.atlassian.bamboo.plugins.git.NativeGitOperationHelper.obtainLatestRevision(NativeGitOperationHelper.java:542)
	at com.atlassian.bamboo.plugins.git.GitRepository.collectChangesSinceLastBuild(GitRepository.java:192)
	... 43 more
Caused by: com.atlassian.bamboo.plugins.git.GitCommandException: command /usr/bin/git ls-remote https://razer.git.cloudforge.com/sytems.git failed with code 128. Working directory was [.]., stderr:
[fatal: Authentication failed]
	at com.atlassian.bamboo.plugins.git.GitCommandProcessor.runCommand(GitCommandProcessor.java:431)
	at com.atlassian.bamboo.plugins.git.GitCommandProcessor.getRemoteRefs(GitCommandProcessor.java:350)
	at com.atlassian.bamboo.plugins.git.NativeGitOperationHelper$1.call(NativeGitOperationHelper.java:500)
	at com.atlassian.bamboo.plugins.git.NativeGitOperationHelper$1.call(NativeGitOperationHelper.java:491)
	at com.atlassian.bamboo.plugins.git.CallableResultCache$1.load(CallableResultCache.java:29)
	at com.atlassian.bamboo.plugins.git.CallableResultCache$1.load(CallableResultCache.java:25)
	at com.google.common.cache.CustomConcurrentHashMap$ComputingValueReference.compute(CustomConcurrentHashMap.java:3426)
	at com.google.common.cache.CustomConcurrentHashMap$Segment.compute(CustomConcurrentHashMap.java:2322)
	at com.google.common.cache.CustomConcurrentHashMap$Segment.getOrCompute(CustomConcurrentHashMap.java:2291)
	at com.google.common.cache.CustomConcurrentHashMap.getOrCompute(CustomConcurrentHashMap.java:3802)
	at com.google.common.cache.ComputingCache.get(ComputingCache.java:46)
	at com.google.common.cache.AbstractCache.getUnchecked(AbstractCache.java:49)
	... 48 more

Running the command "/usr/bin/git ls-remote https://razer.git.cloudforge.com/systems.git" 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
Greta Chang
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
June 20, 2013

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.

3 votes
Przemyslaw Bureta
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 10, 2015

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
Atlassian Team members are employees working across the company in a wide variety of roles.
April 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,

Rafael

1 vote
pradhyumna shrestha November 3, 2014

Please try this in the remote-agent and the server

git config --global http.sslVerify false

 

0 votes
Vandan Phadke
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
May 3, 2016

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

 

0 votes
john livingston April 17, 2014

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

ssh://sysadmin@stash.com:7999/<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.

James Dumay
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 28, 2014

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

https://confluence.atlassian.com/display/BAMBOO/Bamboo+5.5+Release+Notes

Like Sergey Gorbunov likes this
john livingston April 28, 2014

Yes! Thank You. Updated this morning.

0 votes
Melinda Moran
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
July 15, 2013

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.google.common.util.concurrent.UncheckedExecutionException: com.atlassian.bamboo.plugins.git.GitCommandException: command /usr/bin/git ls-remote git://bitbucket.org/jmhebiz-ondemand/webrequest.git failed with code 128. Working directory was [.]., stderr:
[bitbucket.org[0: 131.103.20.167]: errno=Connection timed out, bitbucket.org[0: 131.103.20.168]: 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?

0 votes
Manykutty Joy
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
June 23, 2013

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

0 votes
Manykutty Joy
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
June 23, 2013

Having exactly the same issue!!

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events