Git credential-store error when saving a Bitbucket Cloud repository
プラットフォームについて: Data Center のみ - この記事は、Data Center プラットフォームのアトラシアン製品にのみ適用されます。
この KB は Data Center バージョンの製品用に作成されています。Data Center 固有ではない機能の Data Center KB は、製品のサーバー バージョンでも動作する可能性はありますが、テストは行われていません。サーバー*製品のサポートは 2024 年 2 月 15 日に終了しました。サーバー製品を利用している場合は、アトラシアンのサーバー製品のサポート終了のお知らせページにて移行オプションをご確認ください。
*Fisheye および Crucible は除く
要約
When trying to link with a Bitbucket cloud repository in Bamboo and choosing the authentication type as Username and Password, a git credential-store error is displayed in the page:
環境
- Connecting Bamboo with a Bitbucket Cloud repository
- Observed on Windows and Linux
- All Bamboo supported versions
診断
To get more details of the error in the <BAMBOO-HOME>/logs/atlassian-bamboo.log, you can enable debug logging for the com.atlassian.bamboo.plugins.git
class with type ALL
.
When looking at the atlassian-bamboo.log
, you'll see that the command and path used by Bamboo to authenticate against the Bitbucket Cloud repository has a blank space in the temp folder
path.
DEBUG [https-openssl-nio-8443-exec-8 url: /rest/api/latest/repository/testConnection; user: admin] [GitCommandProcessor] Running in D:\Program Files\Bamboo\temp: ['D:\Program Files\Git\cmd\git.exe' -c credential.helper= -c 'credential.helper=store --file=D:/Program Files/Bamboo/temp/gitCredentials7503534358303087327.tmp' ls-remote https://admin@bitbucket.org/admin/REPO]
DEBUG [10-BAM::PlanExec:pool-13-thread-4] [GitCommandProcessor] Running in /opt/atlassian/bamboo versions/temp: [/usr/bin/git -c credential.helper= -c 'credential.helper=store --file=/opt/atlassian/bamboo versions/temp/gitCredentials8447275709693639222.tmp' ls-remote https://admin@bitbucket.org/admin/REPO]
原因
When saving a Bitbucket Cloud repository, Bamboo captures the user and password (app password) provided, storing them in the gitCredentials***.tmp
file for authentication purposes. If there's a space in the <BAMBOO_INSTALL>/temp
folder path, Bamboo fails to parse the user and password stored in the gitCredentials***.tmp
folder, resulting in a git credentials store error message.
ソリューション
Windows
Incorporating a short name for 'Program Files' on Windows
On Windows, it's possible to have a short name without spaces for the Program Files folder:
- Open the command line and navigate to the drive where Bamboo is located.
Execute the following command to detect any existing short names.
dir /x
If 'Program Files' doesn't have a short name, use the next command to create one.
fsutil file setshortname "D:\Program Files" PROGRA~1
- Re-run the dir /x command to verify that the short name was successfully created.
If needed, when running Bamboo as a Service, if the issue persists, make the following changes:
- Open CMD and move to the
<BAMBOO-INSTALL>/bin
directory. - Type Bamboow.exe //ES//Bamboo and hit enter.
- Go to the Java tab and adjust the bamboo install folder Path to PROGRA~1
- Restart Bamboo and monitor its performance.
Linux
Remove any blank space within the <BAMBOO_INSTALL>/temp folder path. For example, rename /opt/atlassian/bamboo versions/temp
to /opt/atlassian/bamboo_versions/temp
.