Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bitbucket cannot execute git upload-pack

Tags:

git

bitbucket

I am trying to clone a repository, but I get an error message, stating the following whenever I try that:

Bitbucket cannot not execute "git upload-pack ...". The command is not supported as entered.

Ensure you are using a supported SCM, check the syntax and try again.
fatal: Could not read from remote repository.

I have read up a bit, and a lot of people link this to SSH authentication. However, I have my keys all set up and I'm being asked to authenticate for every try.

The keys were generated with ssh-keygen, and the passphrase I enter is correct.

I can't really figure out the problem. I tried cloning various repos, but I end up with this every time.

So far I tried to clone the repository with the git bash, as well as with the help of the TortoiseGit GUI.

It might be worth mentioning I am using an SSH path.

EDIT: I tried several other repositories now. I always end up with this error. I guess it must be something local or something about my keys.

like image 242
Sossenbinder Avatar asked Aug 08 '17 08:08

Sossenbinder


2 Answers

This seems to be a problem introduced with Git for Windows 2.14.0. There is an incompatibility on Bitbucket SSH with the git upload-pack command over SSH.

This explains also, why HTTPS is not affected.

In the following commit, git_connect was changed to use git upload-pack instead of git-upload-pack and Bitbucket is not happy with that (The command is not supported as entered). https://github.com/git/git/commit/40023e58cda656326287d77358514acb262b7484

Also see the commit's message:

git_connect: prefer Git's builtins over dashed form

This helps with minimal installations such as MinGit that refuse to waste .zip real estate by shipping identical copies of builtins (.zip files do not support hard links).

GitLab was running into the same problem: https://gitlab.com/gitlab-org/gitlab-ce/issues/36028

I could only verify this on Bitbucket v4.8.1, maybe this is fixed in a later version.

Workaround:

Roll back to Git 2.13.x or switch to HTTPS.

Solution:

The issue has been addressed in https://jira.atlassian.com/browse/BSERV-10013. The commit has been reverted in Git for Windows. The Version v2.14.0.windows.2 should fix the issue (https://github.com/git-for-windows/git/releases/tag/v2.14.0.windows.2).

like image 111
boskoop Avatar answered Nov 14 '22 17:11

boskoop


Thanks to boksoop's comment, I tried to go back to Git 2.13.2.

It's working perfectly fine with that version. I would avoid upgrading to 2.14 for now as it seems.

like image 44
Sossenbinder Avatar answered Nov 14 '22 18:11

Sossenbinder