Git pull over ssh hangs

Filat Nicolae
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
January 21, 2025

I have an ubuntu server that I need to git pull on to fetch the data from a bitbucket repo. Unfortunately, git pull origin master sometimes works and sometimes hangs forever.

GIT_SSH_COMMAND="ssh -vv" git pull --ipv4 origin master

The public key authenticates to bitbucket but the connection hangs.
Here are the relevant debug messages after authentication

debug2: channel 0: request exec confirm 1 debug1: pledge: fork debug2: channel_input_open_confirmation: channel 0: callback done debug2: channel 0: open confirm rwindow 2097152 rmax 32768 debug2: channel_input_status_confirm: type 99 id 0 debug2: exec request accepted on channel 0 debug2: channel 0: rcvd adjust 317


I tried hardcoding the ip address of bitbucket.org for dns, I tried changing the name server to google (8.8.8.8).
How can I further debug and understand what is going wrong?

1 answer

0 votes
Phil C
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 23, 2025

Hi Filat,

Welcome to the Bitbucket Cloud community!

When a git pull operation hangs after authentication, especially when you can see that the SSH connection is established, there are several potential causes. Here are some steps you can take to troubleshoot the problem:

1. Network Issues: Since you've hardcoded the IP and changed the DNS, network issues might not be the primary cause, but it's worth checking:

  • Ping and Traceroute: Try pinging bitbucket.org to see if there are any network delays. Use traceroute to check the path packets take to reach Bitbucket and identify any bottlenecks.
  • Firewall/Proxy: Ensure there's no firewall or proxy interfering with the connection. Check your network infrastructure

2. SSH Key Issues: Ensure your SSH key is correctly configured and not being blocked or restricted. Sometimes regenerating your SSH key and re-uploading it to your Bitbucket account can help address strange authentication issues.

3. Git Debugging: If the issue persists, enable Git debugging to get more insights:

GIT_TRACE=1 GIT_CURL_VERBOSE=1 git pull --ipv4 origin master
  • This will provide detailed logs of what Git is doing and might give clues as to where it hangs.

4. Repository Size: If it's a large repository, it might take a while to fetch updates, especially over a slow network connection. Check the size of the repository and the amount of data being transferred.

5. Update Git and SSH: Ensure that your Git and SSH clients are up to date. Sometimes, bugs in older versions can cause unexpected behavior.

6. Alternative Methods: If the problem continues and seems to be related to SSH, consider using HTTPS to pull changes as a temporary workaround to determine if the issue is specific to SSH:

$ git remote set-url origin https://<your_username>@bitbucket.org/<workspace_ID>/<repo_name>.git
$ git pull origin master

Hopefully, these steps can help give some insights into the issue causing your git pull command to hang.

Just a friendly reminder, don't post the output from the commands you run as a response since they may contain sensitive information.

- Phil C.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
TAGS
AUG Leaders

Atlassian Community Events