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://myusername@bitbucket.org/myusername/reel-visuals.git

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

error:  while accessing https://myusername@bitbucket.org/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?

Dan Bonachea
  • 2,408
  • 5
  • 16
  • 31
anniebabannie
  • 139
  • 2
  • 4
  • 9
  • 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? – Peter Jan 14 '14 at 03:10

1 Answers1

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://myusername@bitbucket.org/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://myusername@bitbucket.org/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.

Dan Bonachea
  • 2,408
  • 5
  • 16
  • 31