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

Still need help?

The Atlassian Community is here for you.

Ask the community

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

Note that this knowledge base article was created for the Data Center version of the product. Data Center knowledge base articles 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.

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.

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.

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

tcp:
  - match:
      - port: 22
    route:
      - destination:
          host: bitbucket
          port:
            number: 7999

Cause

Bamboo is not able to connect to Bitbucket because of the wrong ingress configuration as explained in the following KB: 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.

tcp:
  - match:
      - port: 7999  # Changed this from 22 to 7999
    route:
      - destination:
          host: bitbucket
          port:
            number: 7999



Last modified on May 28, 2024

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.