8

I cannot push to github. I was able to push little changes, but this time, it hangs after it writes this:

git push origin master
Counting objects: 22, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (12/12), done.
Writing objects: 100% (12/12), 1.51 KiB, done.
Total 12 (delta 8), reused 0 (delta 0)

On my Ubuntu Process Manager, I saw that ssh hangs when I try to push something and it is: ssh git@github.com git-receive-pack 'xxx/yyy.git'

When I try to directly run this command on my terminal, now it hangs after it writes this:

0078...7d4 refs/heads/master report-status delete-refs side-band-64k quiet ofs-delta
0000

All the other thins work well, but I can't push. What could be the reason?

Additional information: I re-created the git file and changed the remote to HTTP from SSH. Now I get this error when I try to push:

Counting objects: 17, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (9/9), done.
Writing objects: 100% (9/9), 1.19 KiB, done.
Total 9 (delta 6), reused 0 (delta 0)
error: RPC failed; result=52, HTTP code = 0
fatal: The remote end hung up unexpectedly
fatal: The remote end hung up unexpectedly
Everything up-to-date

Extra information 2: I've been tested it for hours and it looks like my network connection is the problem. I tried to push from another connection, and it worked very well. What could be the reason behind this? The modem's firewall is disabled, by the way.

gzg
  • 1,469
  • 6
  • 23
  • 39
  • I believe your problem is the same as this one: [GIT impossible to push after add](http://stackoverflow.com/questions/14123170/git-impossible-to-push-after-add). Give that recommended solution a try. – IQAndreas Mar 19 '13 at 00:15
  • I ran into the same issue so I `ctrl+c` and tried again - success – Jacksonkr Aug 10 '23 at 14:35

5 Answers5

13

I've spent the last 5 hours trying to fix a similar problem. First, are you running this over a tunnel or VPN connection?

Turns out that the MTU (Maximum Transmission Unit) of a tunnel can be misconfigured in that some router in the middle of the network path can only support a lower MTU but this isn't known to the VPN/tunnel software, resulting in dropped packets.

So the quick answer is to try to lower the MTU of your connection:

sudo ifconfig eth0 mtu 1300

Here I'm setting the MTU for the eth0 interface, replace with the interface you're actually using to access the git server. The default MTU is usually 1500.

For OpenVPN I had to update the tun0 interface. There is a better/more robust way to do this in the OpenVPN configuration: use the link-mtu <n> and mssfix options.

Ezequiel Muns
  • 7,492
  • 33
  • 57
  • 1
    +1 'cos you just saved me hours. What I can't quite work out is why the MTU somewhere between my endpoints changed. – DorianFM Aug 04 '15 at 00:25
6

In my case issue was related with access rights to repository. I had read only access, after adding rights to write, issue was solved.

user2399170
  • 622
  • 7
  • 11
  • 4
    Not sure why this got down voted. This resolved the issue for me, worth double checking your file system permissions on the remote side first people. (Not sure why no error is thrown to the process.) – Adambean Mar 02 '18 at 11:13
  • 1
    This solved my issues after a long search for the cause. Thank you! – user1653205 Apr 01 '18 at 20:54
  • This solved my issue too, on a personal git server. File owner was the wrong one, and file permissions too. – cocosushi Dec 15 '18 at 19:35
0

I had the same happen, cause was a 100% full disk on the receiving end.

hch
  • 1
-1

First run the following:

env | grep SSH_ASKPASS

if you get nothing, then you have to set that value. If you're using GNOME, find the location of gnome-ssh-askpass.sh which is usually found by doing the following:

find / | grep gnome-ssh-askpass

and it is typically found in the /etc/profile.d directory. Normally, this would have loaded automatically, but for some reason it didn't. so run the following:

source /etc/profile.d/gnome-ssh-askpass.sh

(alternatively, you can just chmod +x the file and run it directly, it's up to you)

Once done, verify that there is a value for env | grep SSH_ASKPASS and then git push will work again.

If you didn't find the gnome-ssh-askpass.sh file, then do a yum search ssh-askpass and install that package (usually yum install openssh-askpass)

For apt-get, do something similar assuming you're using gnome, but if kde, then maybe there's a kde-ssh-askpass??

Moe Singh
  • 809
  • 7
  • 12
-2

Check if your network connection is too slow in uploading. Maybe you just need time. Can you monitor your network connection to see if you are sending data upstream ?

Saverio Proto
  • 1,085
  • 9
  • 20
  • 2
    I'm uploading a 300 kb picture to Gmail in less than 5 seconds, I don't think my network connection is too slow. Is there a way to monitor git uploading? I may give it a try. – gzg Dec 12 '12 at 00:44
  • 1
    Check if you have a MTU problem on your network connection. If you lower the MTU of the interface of your computer to 1280 are you able to push ? – Saverio Proto Feb 15 '13 at 18:48