Git credential-store error when saving a Bitbucket Cloud repository

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

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:

Environment

Diagnosis

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.

Windows
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]
Linux
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]

Cause

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.

Solution

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:

  1. Open the command line and navigate to the drive where Bamboo is located.
  2. Execute the following command to detect any existing short names.

    dir /x
  3. If 'Program Files' doesn't have a short name, use the next command to create one.

    fsutil file setshortname "D:\Program Files" PROGRA~1
  4. 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:

  1. Open CMD and move to the <BAMBOO-INSTALL>/bin directory.
  2. Type Bamboow.exe //ES//Bamboo and hit enter.
  3. Go to the Java tab and adjust the bamboo install folder Path to PROGRA~1
  4. 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.

Last modified on Apr 1, 2024

Was this helpful?

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