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?
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:
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
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.