2

I am trying to connect to my repository on gitlab.com.

It used to work on my laptop both when I was at home and when I was at work. I was using ssh and had added the ssh keys to gitlab.

Suddenly some days ago it stopped working from home: I get:

$ git pull
Connection closed by 54.93.71.23
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

From within my work network, on the same laptop it works fine using ssh.

So now I switched to https and it works most of the time, but ocassionally it hangs and I get:

fatal: The remote end hung up unexpectedly
error: RPC failed; result=56, HTTP code = 0

From my work, this never happens, even if I try to commit the same changes just half an hour later.

What could be the problem with ssh? Am I behind a router firewall or did my provider change something?

EDIT 1: Output of git pull, adding LogLevel DEBUG3 to my .ssh/config:

debug2: kex_parse_kexinit: none,zlib@openssh.com
debug2: kex_parse_kexinit: none,zlib@openssh.com
debug2: kex_parse_kexinit: 
debug2: kex_parse_kexinit: 
debug2: kex_parse_kexinit: first_kex_follows 0 
debug2: kex_parse_kexinit: reserved 0 
debug2: mac_setup: setup umac-64-etm@openssh.com
debug1: kex: server->client aes128-ctr umac-64-etm@openssh.com none
debug2: mac_setup: setup umac-64-etm@openssh.com
debug1: kex: client->server aes128-ctr umac-64-etm@openssh.com none
debug1: sending SSH2_MSG_KEX_ECDH_INIT
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
Connection closed by 54.93.71.23
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

EDIT 2: The connection over https hangs ocassionally, but after many tests there were no MTU problems on my side. Probably the provider had some failures. Github and Bitbucket work perfectly fine over ssh.

Thanks!

  • 2
    Add LogLevel DEBUG3 to your .ssh/config to get more detailed logs to see when the connection is breaking. This could me an MTU problem — the symptom “some long data transfers fail behind a home internet connection” is typical of MTU problems — though if that's the reason I'd expect more than the occasional hang with HTTPS as well. – Gilles Feb 25 '15 at 23:55
  • Ok thanks, I did what you suggest, I will just put the last lines of the output for now. – Santi Feb 26 '15 at 0:21
  • Apparently it has to do something with gitlab.com rather than with some ssh thing. For github.com it does work if I use ssh://git@github.com:username/repo.git. However, the same thing for gitlab, doesn't work. – Santi Feb 26 '15 at 0:34
3

Edit your /etc/ssh/ssh_config to:

GSSAPIAuthentication yes
GSSAPIDelegateCredentials no
Ciphers aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc
MACs hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-ripemd160
  • Hi, thanks for the suggestion. Why do you think this would help? – Santi Mar 8 '15 at 8:57
  • 1
    I had the same issue as you. After doing some research I found out that adding these lines to my ssh_config fixed it for me. * GSSAPIAuthentication - a strong encryption method. In OpenSSH it provides an alternative method of authentication than ssh_keys * GSSAPIDelegateCredentials - Forwards your credentials to the server * Ciphers - Defines the algorithms for symmetric encryption * MACs - Defines the Message Authentication Code algorithms. Sources: slac.stanford.edu/comp/unix/sshGSSAPI.html support.ssh.com/manuals/server-admin/44/Ciphers_and_MACs.html – soner Mar 9 '15 at 19:05
  • Fantastic, this really solved my problem, thanks! Now behind my home router I can push and pull over ssh to gitlab. I am still wondering why this works and where the real problem was, since the hanging of the connection was only related to the gitlab ssh. Bitbucket and Github were working all the time fine. – Santi Mar 9 '15 at 23:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.