Repository import failed with the "Remote Git clone failed" error message
Platform Notice: Cloud - This article applies to Atlassian products on the cloud platform.
Summary
The repository import fails with the following error:
Importing repository
We're getting things warm and cozy for your code.
Your import has failed. For more information, check the log below. You can also try your import again.
15:10:07 git import for: https://bitbucket.org/workspace_id/repo_name/src/master/
15:10:07 Cloning https://bitbucket.org/workspace_id/repo_name/src/master/...
15:10:08 Remote Git clone failed: <class 'bitbucket.apps.asyncx.tasks.RepoImportTask.ImportException'>: Command failed. Return value: 128
Cause
Basic authorization is needed to run the repository import. For more information on the authentication for Github and Gitlab, please check our documentation: Import a repository from GitHub or GitLab.
Solution
- Go to the repository import tool here.
- Add the "Old Repository" URL.
- Check the "Requires authorization" button to add the username and password details.
- If an old repository is within the Bitbucket Cloud only, the username can be found by navigating to your profile avatar logo (on the top right corner) → Click Personal Settings → Under Bitbucket profile settings the Username will be there.
- You will need to use an app password for the authentication. You can generate one if you don't have, yet by following the steps mentioned in the App passwords documentation page.
The successful repository import logs will be like below
Successful import logs
We're getting things warm and cozy for your code. git import for: https://bitbucket.org/workspace/repo-slug/ Cloning https://bitbucket.org/workspace/repo-slug/... Done Fixing repository permissions... Computing repository size... Remote Git clone OK