ARTIFACTORY: Bitbucket Remote Repo Test Fails with "Maximum redirects (20) exceeded"

Products
Frog_Artifactory
Content Type
Administration_Platform
AuthorFullName__c
Jeremy Leopold
articleNumber
000007017
FirstPublishedDate
2026-06-23T13:37:01Z
lastModifiedDate
2026-06-23

ARTIFACTORY: Bitbucket Remote Repo Test Fails with "Maximum redirects (20) exceeded"

The Test button on a remote repository pointed at https://bitbucket.org/... returns:
Connection to remote repository failed: Maximum redirects (20) exceeded
This is the expected response when a Bitbucket remote has credentials attached — Test on its own isn't a reliable indicator for this upstream. Validate the remote by attempting a real resolution instead.


Why this happens

Bitbucket's response to the same URL depends on whether credentials are sent with the request. Without credentials, Bitbucket serves the URL normally — a 200, or a clean 301/404 depending on the path. Once credentials are attached, Bitbucket routes the request through its browser sign-in flow, and Artifactory's HTTP client ends up following a redirect chain toward /account/signin/?next=/ until it hits the 20-redirect cap.

You can see the conditional yourself with curl:
# No credentials — Bitbucket serves the URL normally
curl -sI https://bitbucket.org/<workspace>/<repo>

# Credentials attached — Bitbucket switches into its auth flow
curl -sI -u <user>:<token> https://bitbucket.org/<workspace>/<repo>
Test always sends the remote's configured credentials, so it always lands on the second case.

Captured on a lab instance with artifactory-http.log enabled:
2025-01-08T14:37:02.630Z [jfrt ] [DEBUG] [21b251439c95e3aa] [o.a.h.i.e.RedirectExec:161 ] [http-nio-8081-exec-1] - Redirecting to 'https://bitbucket.org/account/signin/?next=/' via {s}->https://bitbucket.org:443


Validate the remote properly

Resolve an actual artifact through the repository. The exact shape depends on what you're using the remote for — a branch or tag tarball, a raw file at a known path, a release download URL — but a successful real fetch confirms the configuration regardless of what Test reports.


If resolution also fails

Open a support ticket and include the following, so we can investigate the actual resolution path rather than the Test response:
  • What you're trying to do — download a branch/tag tarball, a specific file, etc.
  • The full client command and its output
  • Any relevant client config files
  • The exact steps to reproduce
Related