Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How git pull/clone hangs after rev-list on one network, works on others: how debug and fix?

Tags:

git

ubuntu

router

On my ubuntu laptop, a git pull freezes when it gets to the rev-list command, see output below:

GIT_TRACE=1 GIT_CURL_VERBOSE=1 git pull --verbose
trace: exec: 'git-pull' '--verbose'
trace: run_command: 'git-pull' '--verbose'
trace: built-in: git 'rev-parse' '--git-dir'
trace: built-in: git 'rev-parse' '--is-bare-repository'
trace: built-in: git 'rev-parse' '--show-toplevel'
trace: built-in: git 'ls-files' '-u'
trace: built-in: git 'symbolic-ref' '-q' 'HEAD'
trace: built-in: git 'config' '--bool' 'branch.upgrade-to-rails3.rebase'
trace: built-in: git 'config' '--bool' 'pull.rebase'
trace: built-in: git 'rev-parse' '-q' '--verify' 'HEAD'
trace: built-in: git 'fetch' '-v' '--update-head-ok'
trace: run_command: 'ssh' '[email protected]' 'git-upload-pack '\''/home/mana/git/chc.git'\'''
trace: run_command: 'rev-list' '--objects' '--stdin' '--not' '--all' '--quiet'

Other computers (windows and mac) on the very same network can pull from the same repo (which lives on a private server). I then took my laptop to a different network, and works fine!

Things I've tried:

  • Setting the MTU on eth0 to 1492 (as I saw that for some folks the default of 1500 caused problems).
  • Confirming that I can ssh to server successfully.
  • Clearing the hung sshd process from previous hung attempts.
  • git gc on the remote server

So, what, in the router of the one network, in combination with my particular version of ubuntu could possibly be causing this, and how can I debug it?

like image 716
zippy Avatar asked Oct 24 '25 03:10

zippy


2 Answers

If you're suspecting something with ssh, why not to create a script my-ssh:

#!/bin/sh

ssh -v $@

then

env GIT_SSH='./my-ssh' git pull

That way, you can say where in ssh the process is hanging

(this should be a comment, but then I couldn't format the code !)

like image 170
Victor von Cacahuete Avatar answered Oct 26 '25 18:10

Victor von Cacahuete


I had a similar issue on my Mac, certain git commands of ssh would work, others would seemingly hang in the terminal without any response.

git remote -v show origin  -- would hang
git push origin            -- would work

Swithing router, by using my phone as wireless access point, both commands worked...

Solution:

  1. If not exists create the file in your user directory (mine did not exist)

    /Users/[your_user]/.ssh/config
    
  2. Enter into it:

    Host *
      IPQoS 0x00
    
  3. Not sure if restart of ssh process was needed, I think not.

Why?

Default settings of Quality of Service in the router. I found the solution and explanation in http://forthescience.org/blog/tag/ssh/

like image 30
tomg Avatar answered Oct 26 '25 16:10

tomg



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!