Bitbucket: fatal: HTTP request failed when trying to clone Git repo
Asked Answered
H

1

6

I can't clone my Git repository from Bitbucket Cloud to my server. I SSHed into my website's server (not local), and then tried to do:

git clone https://[email protected]/myusername/reel-visuals.git

Right after entering my password, this is the exact error I get:

error:  while accessing https://[email protected]/myusername/reel-visuals.git/info/refs
fatal: HTTP request failed

I'm definitely entering in the correct username and password.

What am I doing wrong? Is this a permissions issue on my Bitbucket repo or something? If so, how do I fix it?

Heyde answered 13/1, 2014 at 18:22 Comment(1)
Are you able to make HTTP requests via any other means from your server? For example can you SSH in and ping www.google.com or wget stackoverflow.com successfully?Noise
S
1

Start by verifying you have the right cloning URL for your repository. Visit your repository in the BitBucket web UI, navigate to the "Source" panel, click the "Clone" button in the top right and then select HTTPS and copy the correct URL. The rest of this answer assumes you prefer HTTP cloning, although SSH might be preferable if you've correctly set up your SSH keys (outside the scope of this answer).

Next check connectivity from your server to BitBucket cloud, with a command like the following (replacing with your real URL):

wget -v -S https://[email protected]/myusername/reel-visuals.git

Pay attention to the printed HTTP response codes from the server (if any). Working output should include a HTTP/1.1 200 OK code, possibly preceded by some 30x redirection codes. You'll need to investigate and address any error codes you see at this stage, which could include things like DNS lookup failures, connections blocked by firewall rules, or SSL problems like cipher handshake failure or outdated root certificates.

Finally, re-do your clone command and add -v -v to request verbose output:

git clone -v -v https://[email protected]/myusername/reel-visuals.git

This should print additional status diagnostics which might give some more clues about what went wrong.

Finally, you might try upgrading your git client software if you're running a very old version, since BitBucket cloud servers generally run very recent git versions and there might be compatibility problems.

Serration answered 24/10, 2022 at 16:34 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.