Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
Community Members
Community Events
Community Groups

Checkout Source Code uses wrong SSH on Remote Agent

Hi all,

I am attempting to run a Checkout Source Code task on a remote windows agent. The repository is linked to a Bitbucket server repository. I am able to connect to the repository from the machine which the remote agent is installed through the terminal outside of Bamboo with for example:

git clone ssh://git@

 When using the Bamboo Checkout Source Code I get the following error:

Cannot fetch branch '(unresolved) HashAndSource{refName=[null], branch=[master], hash=[5f518cf54dfe9fd19c87714aef2896ae9a485094]}' from 'ssh://git@localhost:7999/rppol/devops.git' to source directory 'C:\remote_agent_home\xml-data\build-dir\DAT-OCD3-JOB1\DevOps'. com.atlassian.bamboo.plugins.git.GitCommandException: command ['C:\Program Files\Git\bin\git.exe' ls-remote ssh://8ae100db-074f-4837-a767-8b687e754a6c@] failed with code 128. Working directory was [C:\Users\nc-jfs\AppData\Local\Temp\9]., stderr:Remote connection failedstdout:Warning: Permanently added '[]:53081' (RSA) to the list of known hosts.BAMBOO-SSH-PROXY: [SSH proxy tried to connect to [git@localhost/]: and failed due to the following error: [Remote connection failed]: Failed to get the session.]fatal: Could not read from remote repository.Please make sure you have the correct access rightsand the repository exists.

To solve the issue, I have attempted the following:

- Setting up ssh keys on the remote machine and Bitbucket and from Bamboo to Bitbucket. This seems not to be the issue as I am able to connect locally.

- Adjusting the ssh base url in Bitbucket server settings. Have tried both ssh:// and ssh://localhost:7999.

- Opening 7999 ports on both servers


Since ssh works through the terminal on the remote machine, I do not think it has to do with permissions. It seems to me, that the localhost which Bamboo attempts to use should actually be Any advice on how to solve this issue?

2 answers

We resolved this problem.


Deleting and readding the repository worked. This is something to be aware of when cloning repositories.

Hi @Jeppe Finne Sørensen 

Can you provide the Git executable path added to the agent matrix (Bamboo capabilities). Also, where you have installed the Git on remote agent machine? What is remote agent installation path?

Suggest an answer

Log in or Sign up to answer

Atlassian Community Events