Bamboo on Windows throws an authentication error when adding a linked repository

Still need help?

The Atlassian Community is here for you.

Ask the community

Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server and Data Center platforms.

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 running Bamboo on a Windows server, adding a Git repository as a linked repository can result in an authentication error. The error will show up both on the UI and in the atlassian-bamboo.log file.

The example error below was triggered when connecting to a Github repository, but the same has been observed when connecting to other types such as Bitbucket Cloud.

Failed to connect to repository (type: GitHub repository, location: https://github.com/exampleaccount/example-repository.git, time: 10.10 s, errors: [usage: git credential-store [<options>] <action>
--file <path> fetch and store credentials in <path>
usage: git credential-store [<options>] <action>
--file <path> fetch and store credentials in <path>
remote: Invalid username or password.
fatal: Authentication failed for 'https://github.com/exampleaccount/example-repository.git'])


Environment

  • Windows

Cause


Bamboo uses the <bamboo-installation-directory>/temp to store temporary files including git credentials. In Windows, the path to this folder can contain spaces such as C:/Program Files/Bamboo/temp/. It has been observed that on some occasions these spaces on the Path can interfere with Git, and can cause the mentioned authentication error to occur.

Solution

The below steps describe how to configure a JVM property when Bamboo is running as a console application. When running Bamboo as a service you will need to configure the property in a different location. Please see the below documentation for steps for a Windows Service:

  1. Stop Bamboo
  2. From <bamboo-install>/bin, open setenv.bat.
  3. Find the section set JVM_SUPPORT_RECOMMENDED_ARGS=
  4. Add this JVM property, following Configuring your system properties
    • -Djava.io.tmpdir=<a path for the temporary directory without spaces>
  5. Start Bamboo


Last modified on Jun 6, 2022

Was this helpful?

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