Error while opening SSH session when using putty format keys

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

Symptoms

Bamboo and Stash are integrated correctly following the instructions: Integrating Bamboo with Stash. Operating system is Windows and Bamboo is running as a Windows service with a local admin account, so there are no issues accessing <bamboo-home> and <bamboo-installation> directories. "msysgit 1.9.x" is correctly installed and a path to the executable is added under Bamboo Administration - > Server Capabilities. Stash is added as a shared repository. Key pairs are generated and exist in both Stash and Bamboo. Despite having all settings correctly in place, following error keeps showing up when running builds:

1 2 3 4 error: [Warning: Permanently added '[127.0.0.1]:54364' (RSA) to the list of known hosts., BAMBOO-SSH-PROXY: [While connecting to [ssetayeshfar@/172.20.111112.23544:7990]: Error while opening SSH session: java.lang.NullPointerException: neither the key pair nor the password is set], fatal: Could not read from remote repository., , Please make sure you have the correct access rights, and the repository exists.] at com.atlassian.bamboo.v2.trigger.DefaultChangeDetectionManager.collectChangesSinceLastBuildInternal(DefaultChangeDetectionManager.java:371) at com.atlassian.bamboo.v2.trigger.DefaultChangeDetectionManager.collectChangesSinceRevisions(DefaultChangeDetectionManager.java:259)

Cause

Though there are different root causes for this issue, one of the main ones is using keys that are in putty format. Putty is the only application that can read these keys natively. So, in order for them to work correctly with Bamboo, they should be converted to OpenSSH format. The problem can also be caused by the keys not making it through the proxy.

Resolution

  1. Bamboo code will look for the keys on the file system only if the key is not found in the db. Make a back up of your Bamboo database, a copy of the <bamboo-home> directory, then run the following query to check if keys exist in Bamboo's database:

    1 select name, xml_definition_data from vcs_location where is_global=true;
  2. Double check your proxy settings and make sure your keys can travel with no issues.

  3. If using "PuttyGen" to generate the keys, convert them to OpenSSH following the instructions provided in this document: How to convert .ppk keys to openSSH.

Updated on April 15, 2025

Still need help?

The Atlassian Community is here for you.