SSH port on GIT Repository Polling

We have a build plan configured against an internal git repository where it uses periodic repository polling for changes. When the build executes the first time after the Bamboo daemon starts, it hangs on checkout. We have determined that this is because the git ssh connection does not trust the host fingerprint. In order to fix it we have to open a terminal and run the git command using the information in the builds log (see below). It looks like it is abstracting the actual repository away from the build execution.

Is there a way to force bamboo to use a single port for ssh instead of it randomly picking one each and every time the bamboo daemon is started? Or is it possible to somehow configure bamboo to not use ssh for its internal polling? Or is it possible to configure the ssh task to auto accept the fingerprint?

Here is what shows in the log when we Stop the build and forcefully kill the build process. We then execute "ssh 2213afe7-34d0-48f2-b0b2-a001f813d8bb@" to allow us to accept the host fingerprint.

Executing Task 'Checkout Default Repository(3)' of type com.atlassian.bamboo.plugins.vcs:task.vcs.checkout.

(java.lang.RuntimeException : com.atlassian.bamboo.plugins.git.GitCommandException: command [E:\dev\git\git-1.7.9.preview20120201\bin\git.exe, fetch, ssh://2213afe7-34d0-48f2-b0b2-a001f813d8bb@, +refs/heads/2.7.0-SNAPSHOT:refs/heads/2.7.0-SNAPSHOT, --update-head-ok] failed. Working directory was `E:\BH\xml-data\build-dir\_git-repositories-cache\331d3864477b6b63a40bcb4eaf5c0c8452254a8f'. stderr: stdout: )

2 answers

1 accepted

I think you're hitting a bug in Bamboo.

The desired Bamboo behavior is that it manages to 'invisibly' replace the known fingerprints in-fly so no user will have to accept the fingerprints manually. Seems to me it doesn't work on Windows machines. At least not on every.

Which ssh client do your git.exe use? I assume you are using as a git implementation on windows... how had you configured ssh for it?

That looks to be the issue. We use msysgit and all of the goodies that come with it. If you look at the task manager you can see that git.exe kicked off ssh.exe to grab the updated code. I noticed that it only seems ot happen when Polling Repository for Changes. If we only do manual build strategy the issue doesn't happen, probably because it connects directly to the ssh server instead of through a custom ssh connection. It would be nice if when setting up the build plan's git ssh connectivity that it attempted to access the server immediately and then let you accept the host fingerprint from there.

The msysgit git install folder contains a .ssh\known_hosts file that shows the fingerprint. It would be pretty easy for bamboo to automatically add it to that file.

[]:4657 ssh-rsa AAAAB3NzaC1

[]:1124 ssh-rsa AAAAB3NzaC1

bq. "If we only do manual build strategy the issue doesn't happen"

That's weird, because (regarding to this issue) there are no differences in "Polling Repository" and "Manual Build" strategies - git commands run by Bamboo would be the same in both scenarios. Can you confirm that it is the same plan failing when run with "polling repository" strategy and succesful when its strategy is set to "Manual" and you run the build manually?


I confirm there exist a bug in Bamboo (BAM-11096) and we are trying to fix it before Bamboo 4.0. However, if you need to workaround the problem sooner you should manually edit your .ssh\known_hosts file (in msysgit git install directory I presume) and add: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQC699HzXHwr1H6OJeVlRo7h4r+3PYd0wNkqzl6EUAeU2iZjqFqQL2ZiNVqs2JrpTNduipXBNk9rhQIWajQZG9ZJG/OPxe+NOkbWQVevrcELsw5N2wxcJOWz+ey1tFv3VCtNCLUGgF7yIg0kWWVQ+HvAzLoMbiHs0haVmEjnLherSw==

That way you won't have to open terminal and run the git commands manually each time Bamboo starts its ssh deamon.

For those not specifically running into ssh errors, msysgit needed some help after being installed.

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 ...

101 views 3 4
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