4

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,[email protected]
debug2: kex_parse_kexinit: none,[email protected]
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 [email protected]
debug1: kex: server->client aes128-ctr [email protected] none
debug2: mac_setup: setup [email protected]
debug1: kex: client->server aes128-ctr [email protected] 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!

3
  • 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. Feb 25, 2015 at 23:55
  • Ok thanks, I did what you suggest, I will just put the last lines of the output for now.
    – Santiago
    Feb 26, 2015 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://[email protected]:username/repo.git. However, the same thing for gitlab, doesn't work.
    – Santiago
    Feb 26, 2015 at 0:34

1 Answer 1

6

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,[email protected],hmac-ripemd160
3
  • Hi, thanks for the suggestion. Why do you think this would help?
    – Santiago
    Mar 8, 2015 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, 2015 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.
    – Santiago
    Mar 9, 2015 at 23:50

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .