Git Commands Return Fatal: Authentication Failed
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
Problem
When performing a Git operation to the Bitbucket Server instance over HTTP, the command fails with a fatal: Authentication failed
error.
1
2
3
4
$ git clone http://user@bitbucket.company.com/scm/project/repo.git
Cloning into 'repo'...
Password for 'http://user@bitbucket.company.com':
fatal: Authentication failed
Diagnosis
Diagnostic Steps
Verify that the user can login to the web interface of Bitbucket Server.
Cause
This error can have multiple causes which are outlined below.
Solution
Cause #1
There is an Apache proxy server in front of Bitbucket Server that is removing the authorization header information as the request is passed to Bitbucket Server. This is caused by the RequestHeader unset Authorization
configuration being set.
Cause #2
The user has been locked out of Bitbucket Server because of too many incorrect login attempts.
Cause #3
Newer versions of Git for Windows (2.x.x+) can pick up on the HTTP_PROXY
environment variable and cause this issue.
Cause #4
Windows Credential Manager sometimes messes with stored GIT passwords causing authentication failure.
Resolution
Resolution #1
Remove the RequestHeader unset Authorization
configuration from Apache and restart the proxy server.
Resolution #2
Check that the user can login to the web interface of Bitbucket Server and answer the CAPTCHA if prompted.
Resolution #3
Remove the HTTP_PROXY
environment variable.
Resolution #4
Remove all stored credentials for git (remove all "git" related passwords) in Windows Credentials Manager that is under Control Panel\User Accounts\Credential Manager.
Was this helpful?