Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to clone repository with a Bambo Remote Agent

Tags:

git

ssh

bamboo

We are trying to checkout source from a git repository into Job on Bamboo 4.1 This Job have to be executed on a remote agent.

We are using SSH(+keys) to connect repository, after few configuration steps, SSH auth seems ok but when plan is sarted an unexpected error occured :

Error encountered while triggering manual build: com.atlassian.bamboo.repository.RepositoryException: Cannot fetch 'ci@continuous:project.git/', branch 'refs/heads/master' to source directory '/opt/appserv/bamboo/bamboo-home/xml-data/build-dir/_git-repositories-cache/086d7d404e013877bd2550c6f022929bbbf6afa3'. command [/usr/bin/git, fetch, ssh://[email protected]:48729/project.git/, +refs/heads/master:refs/heads/master, --update-head-ok, --progress, --verbose] failed with code 128. Working directory was [/opt/appserv/bamboo/bamboo-home/xml-data/build-dir/_git-repositories-cache/086d7d404e013877bd2550c6f022929bbbf6afa3]. stderr: SSH Proxy error: Authenticating remote session failed stdout: [ci@continuous:project.git/10.38.218.68:22] Authenticating remote session failedfatal: The remote end hung up unexpectedly

According to this link, ssh://[email protected]:48729/project.git/ point to an internal Bamboo proxy but due to some reasons it fails to fetch data

Any ideas

like image 866
Benoît Guérout Avatar asked Jun 06 '12 14:06

Benoît Guérout


1 Answers

THere is a known issue with SSH, Native Git, and Bamboo where the proxy address:port isn't added to the known hosts file. During the fetch, the process hangs on an ssh prompt:

https://jira.atlassian.com/browse/BAM-11096

I was able to get around this by adding the localhost address to the .ssh/known_hosts file without the port provided:

Example:

127.0.0.1 ssh-rsa XXXXB3NzaC1yc2EAAAADAQABBBBgQC699HzXHwr1H6OJeVlRo7h4r+3PY d0wNkqzl6EUAeU2iZjqFqQL2ZiNVqs2JrpTNadbgtXBNk9rhQIWajQZG9ZJG/OPxe+NOkbWQVev rcELsw5N2wxcJOWz+ey1tFv3VCtNCLUGgF7yIg0kZZVQ+HvAzLoMbiHs0haVmEjnLherSw==

The ticket referenced above provides another workaround you might be able to try.

like image 124
Jason Huntley Avatar answered Oct 24 '22 12:10

Jason Huntley