Git with SSH authentication fails

Hi,

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@127.0.0.1:57994/path_to_repository 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 (git-scm.com), 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.

Thanks,

Vlad

2 answers

1 accepted

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 vote

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 https://support.atlassian.com/servicedesk/customer/bsp

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
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Renan Battaglin
Published May 18, 2017 in Bamboo

FAQ: How to Upgrade Bamboo Server

Bamboo 5.9 will no longer be supported after June 12, 2017. What does this mean? As part of our End of Life policy, Atlassian supports major versions for two years after the first major iteratio...

1,321 views 0 5
Read article

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