Bamboo can't authenticate with Bitbucket Server and shows "New access key is required but could not be added"

お困りですか?

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

コミュニティに質問

プラットフォームについて: Server および Data Center のみ。この記事は、Server および Data Center プラットフォームのアトラシアン製品にのみ適用されます。

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.

*Fisheye および Crucible は除く

要約

When adding a Bitbucket server repository in Bamboo, an error message appears:

"New access key is required but could not be added to Bitbucket Server.
ssh://project/repo.git:7999/git: invalid private key: [X@xxxxxxxx..."

環境

Bamboo 6.8, 7, 8, 9 running on Linux OS.

診断

Looking at the logs, the following errors can be seen:

2022-09-14 08:34:48,262 INFO [http-nio-8085-exec-3] [BitbucketServerServerConfigurator] Public key was added to Bitbucket Server (Bamboo user: <user_name>, application: Bitbucket [<bitbucket_URL>], location: repository /module): ssh-ed25519 <encrypted key> <bamboo_URL>

2022-09-14 08:34:48,269 INFO [http-nio-8085-exec-3] [BitbucketServerServerConfigurator] Can't authenticate with Bitbucket Server despite successful public key storage: ssh-ed25519 <encrypted key> <bamboo_URL>

原因

This issue can happen when a Git capability is not set on Bamboo Administration > Overview > Server Capabilities, causing Bamboo to use JGit. JGIt has been deprecated since the Bamboo 6.8 release and is not supported in production environments.

You can check if that's the case by generating a Support Zip, and then look for the Git capability inside application-properties/application.xml

Example - application.xml
  <git>
    <capability>org.eclipse.jgit</capability>
    <path>N/A</path>
    <version>N/A</version>
    <is-executable>false</is-executable>
  </git>

ソリューション

Install the Git package on the Bamboo machine and restart Bamboo. After that, please validate if the Git executable is detected on Bamboo Administration > Overview > Server Capabilities.

If Git is already installed and hasn't been detected, please access Bamboo Administration > Overview > Server Capabilities and press 'Detect Server Capabilities'. This will force Bamboo to load all capabilities available.

Git should also be installed on any Remote Agents and its location be listed on the OS $PATH so Bamboo can detect it.



最終更新日: 2022 年 10 月 5 日

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

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