Bitbucket Cloud Repository Import Error "Git Clone Command failed. Return value: 128"


 

Platform Notice: Cloud - This article applies to Atlassian products on the cloud platform.

   

Summary

A repository import can fail with the following error:

18:31:48 git import for: https://dev.azure.com/xya/xya/_git/test
18:31:48 Cloning https://dev.azure.com/xya/xya/_git/test...
18:31:49 Remote Git clone failed: <class 'bitbucket.apps.asyncx.tasks.RepoImportTask.ImportException'>: Command failed. Return value: 128

Cause

There could be multiple reasons causing the Git clone failed error "Command failed. Return value: 128". Some possible reasons include:

  • Using the wrong Git credentials to import the repository. Either the username or password inputted will be incorrect.
  • Leaving the password field blank.

When creating a new repository with a name that already exists, an error message will be displayed saying, "You already have a repository with this name." As a result, the password entered and the project selected will be reset, as shown in the image below.




When we re-enter an available repository name, we need to ensure that we also re-enter the password along with the project selection from the dropdown. If we forget to enter the password and leave the "password" field blank, the import form will still allow us to click on the 'import repository' button, which will result in the error above.


When re-entering a repository name, it's necessary to also enter the password and select a project from the dropdown. Please note that when the "password" field is left empty, it is still possible to click the "import repository" button, but it will result in the error, as referenced above.

Solution

Ensure the correct Git credentials are entered. Test the credentials locally by cloning the repository on the command line using the same credentials. This will ensure the credentials can be used to authenticate.

Github and Gitlab authentication

Github and Gitlab require a personal access token for authentication. Be sure you are using the proper credentials you'd use to clone the repository on Github/Gitlab.


Last modified on May 7, 2024

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.