Bitbucket Cloud Migration Assistant (BCMA) - Git push Authorization Error
Platform Notice: Cloud, Server, and Data Center - This article applies equally to all 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 using the BCMA, a "Authorization Error" may occur when attempting to push repos from the On-Prem instance up to Bitbucket Cloud.
Environment
Bitbucket On-Prem, Migrating to Bitbucket Cloud via BCMA.
Diagnosis
You will see a WARN log entry for "bitbucket.git.remote.authorizationerror" for each repo attempting to migrate and the repos will show "Incomplete" from the BCMA UI.
2023-03-01 12:01:01,000 WARN [bcma-1] admin @T23SJWx501x480001x0 13hm2u2 104.192.141.1 "POST /rest/plugins/1.0/ HTTP/1.1" c.a.b.p.b.g.c.PushStdioHandler$ExitHandler Git error: remote: To access this repository, an admin must whitelist your IP.
fatal: unable to access 'https://bitbucket.org/migrationtesting/repo-slug.git/': The requested URL returned error: 403
2023-03-01 12:01:01,000 WARN [bcma-1] admin @T23SJWx501x480001x0 13hm2u2 104.192.141.1 "POST /rest/plugins/1.0/ HTTP/1.1" c.a.b.plugin.bcma.plan.PlanService Migration failed for plan 'Migration Plan 1' with error: Error occurred for PROJ-KEY/repo-slug during git push. com.atlassian.bitbucket.scm.NotAuthorizedScmException: bitbucket.git.remote.authorizationerror [12345abc-defg-1234-5678-1234567890ab::bitbucketRepositoryDataUpload]
Cause
The push of repositories is pointed directly to the target workspace while other actions (like migrating users) occurs via different services/platforms. This means that push operations from the on-prem instance, into your destination workspace, are subject to any Workspace IP Allowlistings that may be present.
Solution
Add your Bitbucket On-Prem's public IP address to your Cloud Workspace IP Allowlist.