Push Proxy fails with Bitbucket Mirror

Platform Notice: Cloud and Data Center - This article applies equally to both cloud 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 attempting to push to the mirror URL, it fails with "fatal: Authentication failed"

Environment

Git client 1.8.3.1

Diagnosis

No further information other than the following is in the atlassian-bitbucket.log from the mirror:

1 DEBUG [https-jsse-nio-8443-exec-5] @2VQ601x1405x85x0 <IP Address> "GET <REPO URL> HTTP/1.1" c.a.b.i.m.m.s.h.WriteRequestInterceptorFilter Redirecting SCM write request to upstream URL <BITBUCKET REPO URL>

From Git client debug logging you'll see something similar to

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 < HTTP/1.1 302 < Cache-Control: private < Expires: Thu, 01 Jan 1970 00:00:00 GMT < X-AREQUESTID: @2VQ601x1405x85x0 < Location: <BITBUCKET FULL REPO URL> < Content-Length: 0 < Date: Tue, 11 May 2021 20:25:47 GMT ... HTTP/1.1 401 < Cache-Control: private < Expires: Thu, 01 Jan 1970 00:00:00 GMT < X-AREQUESTID: *1RP649Hx925x3639x0 < x-xss-protection: 1; mode=block < x-frame-options: SAMEORIGIN < x-content-type-options: nosniff < WWW-Authenticate: Basic realm="Atlassian Bitbucket" < Transfer-Encoding: chunked < Date: <DATE> GMT < * Ignoring the response-body * Connection #3 to host <BITBUCKET URL> left intact * Issue another request to this URL: <BITBUCKET REPO URL> * Couldn't find host <BITBUCKET BASE URL> in the .netrc file; using defaults * Found bundle for host : <BITBUCKET BASE URL> * Re-using existing connection! (#3) with host <BITBUCKET BASE URL> * Connected to <BITBUCKET BASE URL> (IP address) port <PORT> (#3) > GET <repo name>/info/refs?service=git-receive-pack HTTP/1.1 User-Agent: git/1.8.3.1 Host: <BITBUCKET URL> Accept: */* Accept-Encoding: gzip Pragma: no-cache < HTTP/1.1 401 < Cache-Control: private < Expires: Thu, 01 Jan 1970 00:00:00 GMT < X-AREQUESTID: *1BTPOE1x925x1781x0 < x-xss-protection: 1; mode=block < x-frame-options: SAMEORIGIN < x-content-type-options: nosniff * Authentication problem. Ignoring this. < WWW-Authenticate: Basic realm="Atlassian Bitbucket" < Transfer-Encoding: chunked < Date: <DATE> GMT < * Connection #3 to host <BITBUCKET URL> left intact fatal: Authentication failed for <BITBUCKET URL>

Note:

The X-AREQUESTID under the HTTP/1.1 302 (Found response) should show up in the mirror log with the initial line of "SCM Write request"

Cause

There is an issue with older versions of Git not properly handling a URL redirect like this.

Solution

Upgrade Git on the client to a later version. Currently, 2.9.3 is the earliest tested resolution to resolve the issue

Updated on March 21, 2025

Still need help?

The Atlassian Community is here for you.