Git with SSH authentication fails


I have a problem accessing a Git repository with SSH authentication in Bamboo 5.5.1. I found some related issues from older versions of Bamboo that state they were already fixed in versions before 5.5. Still I get this error in Bamboo:

Unable to detect changes

(com.atlassian.bamboo.repository.RepositoryException : java.lang.RuntimeException: com.atlassian.bamboo.repository.RepositoryException: com.atlassian.bamboo.plugins.git.GitCommandException: command C:\cygwin\git\bin\git.exe ls-remote ssh://4a28d11b-560e-4775-a591-97b389d7ecd0@ failed with code 128. Working directory was [.]., stderr: Authenticating remote session failed stdout: [BAMBOO-SSH-PROXY: [While connecting to [user@/gitserver:22]: Authenticating remote session failed], fatal: Could not read from remote repository., , Please make sure you have the correct access rights, and the repository exists.])
(24 Jul 2014, 12:59:38 PM)

This is frustrating because the Bamboo built in git works fine with the same repository (I just set the private ssh key and it all works), but I need submodule support. I tried various versions of native git and they all fail the same way. I first tried msysgit 1.9.4 (, then cygwin git, then I compiled the latest 2.0.3 git in cygwin and used that. They all give the same error. I even tried the msysgit 1.9.4 with the cygwin ssh (seeing that the cygwin ssh is a newer version) by defining the ssh capability. Seems like the problem is related to the SSH part and the Bamboo ssh proxy thing, but I can't figure out what I can do about it.

I tested Bamboo in the past, version 5.0 I think, that didn't have submodule support at all, but native git (msysgit 1.8.4 I think) worked fine at that time.



2 answers

1 accepted

0 votes
Accepted answer

I figured out the problem. It was a firewall between the computer running Bamboo and the one running the Git repository. I moved Bamboo to a computer behind that firewall and git+ssh works fine, including getting the submodules, so all is good.

I'm curious now about what the Bamboo ssh proxy does differently compared to the native ssh connection so that it makes the firewall block it. I would guess the connection is the same: from my-computer:random-port to git-server:22, so it must be some other criteria than ip:port filtering.

The problem doesn't seem to be the firewall itself, the ssh connection goes through to the git server, but drops immediately after a succesful authentication. Maybe it's the fact that the connection is done through VPN.

0 votes

There are some most common problems with Windows-ssh-git trio. Things to check:

  • make sure it works from command line
  • if your Bamboo is run as a system service make sure there's HOME environment variable set for system account

If it still doesn't work contact our support

Thanks. I tried from the command line, everything works well, I can clone or run ls-remote (without the ssh proxy thing of course). I run bamboo in the console under my windows user.

I also tried on a clean virtual machine, command line works, Bamboo doesn't.

I am just testing Bamboo for now with an evaluation license so can I contact support if I'm not a customer yet?

Yes please do.

Ok, great. I've got this reference: BSP-14660

Thanks Krystian, I also encounter a problem on Win8 that can't sync submodule, but it works after set %HOME% env var

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Monday in Confluence

Organizing your space just got easier - Page Tree Drag & Drop is here

Hi Community! I’m Elaine, Confluence Product Manager. You may have read my earlier post about page tree in space navigation sidebar. I'm excited to share another improvement that helps you organize ...

77 views 3 3
Join discussion

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