Error while opening SSH session when using putty format keys

お困りですか?

アトラシアン コミュニティをご利用ください。

コミュニティに質問

症状

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:

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)

原因

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. 

ソリューション

  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:

    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.

最終更新日 2018 年 11 月 1 日

この内容はお役に立ちましたか?

はい
いいえ
この記事についてのフィードバックを送信する
Powered by Confluence and Scroll Viewport.