Failed to load data from Bitbucket. 401 Unauthorized using app password from Bitbucket cloud
プラットフォームについて: Server および Data Center のみ。この記事は、Server および Data Center プラットフォームのアトラシアン製品にのみ適用されます。
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.
*Fisheye および Crucible は除く
問題
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
WARN [http-nio-8085-exec-5] [RESTCall] Response from GET https://api.bitbucket.org/2.0/workspaces/USERNAME/ (404)
原因
Bitbucket cloud API to fetch repository includes the workspace name as a URL parameter.
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.
ソリューション
Ensure the workspace name is same as the username, e.g. if a username is johnc
changed the workspace name to be johnc
.