EGit Connection Timed Out

Yesterday when I tried syncing some Oddjob changes to GitHub I kept getting a connection timed out exception:

git@github.com:robjg/oddjob.git: Session.connect: java.net.SocketTimeoutException: Read timed out

I tried upping the timeout in Preferences -> Team -> Git -> Remote Connection timeout but to no avail.

So I dropped support@github.com a mail and had an amazingly prompt and helpful reply. If you’ve found this page because you have a similar problem here’s some things to try.

From the command line (I’m using Cygwin), try a clone using the Git Read Only URL:

$ git clone git://github.com/robjg/oddjob.git
Cloning into oddjob...
remote: Counting objects: 3467, done.
remote: Compressing objects: 100% (1399/1399), done.
remote: Total 3467 (delta 1904), reused 3423 (delta 1860)
Receiving objects: 100% (3467/3467), 3.80 MiB | 685 KiB/s, done.
Resolving deltas: 100% (1904/1904), done.

This worked fine. Next try using the SSH URL:

$ git clone git@github.com:robjg/oddjob.git
Cloning into oddjob...
Enter passphrase for key '/home/rob/.ssh/id_rsa':
remote: Counting objects: 3467, done.
remote: Compressing objects: 100% (1399/1399), done.
remote: Total 3467 (delta 1904), reused 3423 (delta 1860)
Receiving objects: 100% (3467/3467), 3.80 MiB | 609 KiB/s, done.
Resolving deltas: 100% (1904/1904), done.

This took ages (60 seconds) before prompting for the passphrase. It then ran very fast – so here it looks like we have a problem.

(So that Cygwin uses the same key as Eclipse /home/rob/.ssh is actually a softlink to /c/Users/rob/.ssh (where c:/ is mounted on /c))

Next try HTTP URL – now here I had a problem:

$ git clone https://robjg@github.com/robjg/oddjob.git
Cloning into oddjob...
Password:
mysecret

At this point it just hung. I have no idea why, and neither did Google, but others also report this problem. If you know why it hangs then please mail me.

Trying with the password in the URL:

$ git clone https://robjg:mysecret@github.com/robjg/oddjob.git
Cloning into oddjob...
      0 [main] git-remote-https 5000 exception::handle: Exception: STATUS_ACCESS_VIOLATION
   1075 [main] git-remote-https 5000 open_stackdumpfile: Dumping stack trace to git-remote-https.exe.stackdump
      0 [main] git-remote-https 3388 exception::handle: Exception: STATUS_ACCESS_VIOLATION
    578 [main] git-remote-https 3388 open_stackdumpfile: Dumping stack trace to git-remote-https.exe.stackdump
      1 [main] git-remote-https 3444 child_copy: linked dll data write copy failed, 0x3D5000..0x3D5508, done 0, windows pid 4380, Win32 error 487
error: cannot fork() for fetch-pack: Resource temporarily unavailable

First, as you can see – it crashed, but then a second time it worked perfectly:

$ git clone https://robjg:mysecret@github.com/robjg/oddjob.git
Cloning into oddjob...
remote: Counting objects: 3467, done.
remote: Compressing objects: 100% (1399/1399), done.
remote: Total 3467 (delta 1904), reused 3423 (delta 1860)
Receiving objects: 100% (3467/3467), 3.80 MiB | 682 KiB/s, done.
Resolving deltas: 100% (1904/1904), done.

No idea why but it’s just time to move on…

I updated the GIT remote URL in Eclipse:

EGit SSH Config

And was able to sync away.

The very helpful Github support had informed me they could see no problems with SSH their side and so I was suspecting my ISP, Plusnet. A quick look at their forums and it looks like others have previously had problems with SSH while not having any problem with HTTP. I resolved to ring them first thing in the morning – but of course today Git over SSH works absolutely perfectly!

If you’ve had similar problems I hope you found this useful, and finally thank you again GitHub support – you were really helpful.

Comments are closed.