Failed to load data from Bitbucket. 401 Unauthorized using app password from Bitbucket cloud

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

Problem

An attempt to add Bitbucket Cloud Linked repository with username and password authentication to Bamboo, fails with an error message of "Can't find a repository named {name}" in Bamboo UI, and the following appears in the log file atlassian-bamboo.log

1 WARN [http-nio-8085-exec-5] [RESTCall] Response from GET https://api.bitbucket.org/2.0/workspaces/USERNAME/ (404)

Cause

Bitbucket cloud API to fetch repository includes the workspace name as a URL parameter.

1 GET /2.0/repositories/{workspace}/{repo_slug}

The workspace name should match the username used to access to access the repository. causing only a search of repository with the username to be successful, but attempts to save the repository returned 404.

Resolution

Ensure the workspace name is same as the username, e.g. if a username is johncchanged the workspace name to be johnc .

Updated on April 8, 2025

Still need help?

The Atlassian Community is here for you.