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@127.0.0.1:1124" 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@127.0.0.1:1124/dsw-com-env, +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. https://jira.atlassian.com/browse/BAM-11096

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 http://code.google.com/p/msysgit/ 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.

[127.0.0.1]:4657 ssh-rsa AAAAB3NzaC1

[127.0.0.1]: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?

Keith,

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:

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

 

http://stackoverflow.com/questions/3431361/git-for-windows-the-program-cant-start-because-libiconv2-dll-is-missing

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
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,814 views 0 6
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