Cannot create linked repository in Bamboo with error: Failed to get the session

Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.

Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

Summary

This article covers a scenario where Bamboo cannot create a linked repository with the below error as it fails to connect to Bitbucket Server.

1 2 3 4 Warning: Permanently added '[127.0.0.1]:38507' (RSA) to the list of known hosts. BAMBOO-SSH-PROXY: [SSH proxy tried to connect to [git@bitbucket.example.com/192.168.1.1:7999]: 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 rights and the repository exists.

Environment

  • Bamboo 9.5.2 deployed on Kubernetes Cluster (Helm 1.19.0)

  • Bitbucket Datacenter 8.16.2 deployed on Kubernetes Cluster (Helm 1.17.2)

Diagnosis

Checking Bamboo logs the below error was noticed in <bamboo-home>logs>atlassian-bamboo.log file.

1 2 3 4 Warning: Permanently added '[127.0.0.1]:38507' (RSA) to the list of known hosts. BAMBOO-SSH-PROXY: [SSH proxy tried to connect to [git@bitbucket.example.com/192.168.1.1:7999]: 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 rights and the repository exists.

Checking the connection from Bamboo to Bitbucket using the below command, we can see it gives a operation timed out error.

1 2 3 $ telnet bitbucket.example.com 7999 telnet: connect to address 192.168.1.1: Operation timed out telnet: Unable to connect to remote host

Checking the ingress configuration of Bitbucket.

1 2 3 4 5 6 7 8 tcp: - match: - port: 22 route: - destination: host: bitbucket port: number: 7999

Cause

Bamboo is unable to connect to Bitbucket because of the wrong ingress configuration, as explained in: BAMBOO-SSH-PROXY: [While connecting to [git@stash-baseURL/127.0.0.1:22]: Authenticating remote session failed

Solution

In the ingress YAML configuration change the ingress gateway that receives the incoming SSH traffic on port 22 to be 7999.

1 2 3 4 5 6 7 8 tcp: - match: - port: 7999 # Changed this from 22 to 7999 route: - destination: host: bitbucket port: number: 7999

Updated on February 25, 2025

Still need help?

The Atlassian Community is here for you.