Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Connecting Bamboo to a stash git repo

Paul DeSousa
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 6, 2014

I am trying to connect point bamboo to a stash repo for some time now and I run the plan (which only does a source code checkout from default repo and that's it. The plan says successful and always errors with the following:

Server Configuration - Puppet Integration SC-PI-40 : Errors getting changes for SC-PI-40

(com.atlassian.bamboo.repository.RepositoryException : java.lang.RuntimeException: com.atlassian.bamboo.repository.RepositoryException: com.atlassian.bamboo.plugins.git.GitCommandException: command /usr/bin/git ls-remote ssh://f6f0d878-a9a4-4f3e-b5de-fe18d74849cc@127.0.0.1:32922/sc/puppet-server.git failed with code 128. Working directory was [.]., stderr: [Warning: Permanently added '[127.0.0.1]:32922' (RSA) to the list of known hosts., fatal: remote error: Repository does not exist, The requested repository does not exist, or you do not have permission to, access it., fatal: The remote end hung up unexpectedly])
(06 Jun 2014, 9:02:35 PM)
Both stash and bamboo list each other under the application links.
Bamboo version 5.4.2
Stash v3.0.1

4 answers

1 accepted

0 votes
Answer accepted
Paul DeSousa
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 30, 2014

Reinstalled the latest bamboo and made sure the SSH keys were correct and that seemed to work. Still not 100% sure which ID bamboo uses to access stash's repos but it is working so I won't touch that which isn't broken.

1 vote
Peter Van de Voorde
Community Champion
June 9, 2014

Hi Robert,

Could it be that the stash base url is localhost (127.0.0.1) ?
or that some hosts file is incorrect?

Why is it trying to add 127.0.0.1 to the list of know hosts?

Just wondering if it might indicate the problem.

Best regards,

Peter

Paul DeSousa
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 9, 2014

That a Bamboo quirk. On the command line

git ls-remote ssh://se-git1.example.com:7999/~robertn/puppet-server.git

I use the fqdn name. Bamboo is implementing an internal SSH proxy for git in order to authenticate properly with remote repository. Which does not appear to work well. Please see this post for why it is going to some unreproducible host connection: https://answers.atlassian.com/questions/288626/bamboo-can-t-get-code-from-linked-stash

1 vote
Pepe
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 7, 2014

And as the same user you can clone the same repository to the bamboo server? It looks like the bamboo server/connecting user doesn't have stash's ssh key stored in known_hosts. Manually running the ssh clone will ensure the various connectivity issues are not the problem.

Another possibility is that the repo is empty but less likely since you're trying to build something. I have seen a similar error when changing the repository used in a build or the clone method (http to ssh). Shutdown, clear the bamboo cache, restart, then run a new build (don't re-run a previously failed build).

Paul DeSousa
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 8, 2014

The same user? I can log in to the Bamboo server as the same user as I log into bamboo with and do this:

robertn@dev2:~/.ssh$ /usr/bin/git ls-remote ssh://se-git1.example.com:7999/~robertn/puppet-server.git

Enter passphrase for key '/home/robertn/.ssh/id_rsa':

d12710d7a01d4be46f9ebe7341b8232cc395ed33HEAD

d12710d7a01d4be46f9ebe7341b8232cc395ed33refs/heads/master

No it is not empty.

Pepe
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 8, 2014

Oh so you have to enter your passphrase? That's possibly the issue. Add your ssh key to key-agent (or whatever ssh key management tool your OS uses) so that you aren't prompted for a passphrase when you run ssh commands.

http://stackoverflow.com/questions/6106137/git-enter-long-passphrase-for-every-push

Paul DeSousa
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 9, 2014

Also I went in and changed it to where there is no pascode and got a success command line git and a failed bamboo get-remote with the exact same error.

1 vote
Mehmet Kazgan
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 6, 2014
I would delete and add app links.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events