Bamboo intermittently shows "Invalid Credentials" when connecting to repositories
Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.
Note that this KB was created for the Data Center version of the product. Data Center KBs 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
Your Bamboo Data Center instance experiences intermittent "Invalid credentials" errors when attempting to detect changes in Bitbucket or Git repositories. The credentials are correct and valid, and work most of the time.
Environment
Validated in Bamboo 10.2 but may be applicable to other versions
Only affects Bamboo running on Windows
Diagnosis
"Invalid credentials" errors appear in the Bamboo Administration > Overview > System errors and in the <bamboo-home>/logs/atlassian-bamboo.log
The error occurs randomly, even though the configured credentials for authentication are correct and work for manual operations
Build plans may be automatically disabled due to repeated authentication failures
<bamboo-home>/logs/atlassian-bamboo.log might show the following:
remote: Invalid credentials
fatal: Authentication failed for 'https://bitbucket.org/your_org/your_repo/'
Windows Event Viewer logs may show WerFault.exe entries related to the Git process at the same timestamp as the "invalid credentials" errors.
Cause
The root cause is identified as an interaction between Windows, Git for Windows, and potentially antivirus software. Specifically, the Address Space Layout Randomization (ASLR) feature in Windows can interfere with the Unix-like executables included with Git for Windows, leading to authentication failures. Moreover, other antivirus software may also lock some of Git's DLL files, further disrupting the Git process.
Solution
1. Disable Windows ASLR
Open Windows Defender/Windows Security.
Click App & browser control.
Scroll down and click Exploit protection settings.
Find the Force randomization for images section and select Off by default.
Reboot the system.
Antivirus Exclusions (if applicable)
Add the following files and directories to all the exclusion lists in your antivirus software (for example, ESET antivirus):
Bamboo Home Directory
Bamboo Install Directory
Git installation directory
For more information: Bamboo antivirus exclusions
Was this helpful?