Abdullah Razzaki
Abdullah Razzaki

Reputation: 992

Gitlab SSH giving connection timeout error after taking some time

I am facing issues in accessing Gitlab through SSH. It was working fine until a week ago when gitlab operations stopped working and after taking alot of time give an error for connection timeout. I read similar questions and they suggested to check by running the command ssh -Tv [email protected] , the output I get is

OpenSSH_7.6p1 Ubuntu-4ubuntu0.3, OpenSSL 1.0.2n  7 Dec 2017
debug1: Reading configuration data /etc/ssh/ssh_config 
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug1: Connecting to gitlab.com [172.65.251.78] port 22.
debug1: Connection established.
debug1: permanently_set_uid: 0/0
debug1: identity file /home/emumba/.ssh/id_gitlab type 3
debug1: key_load_public: No such file or directory
debug1: identity file /home/emumba/.ssh/id_gitlab-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_7.6p1 Ubuntu-4ubuntu0.3

It gets stuck at this point. I have tried adding a new key but it still doesn't work. HTTPS is working fine but I need to use SSH

Upvotes: 3

Views: 2321

Answers (3)

Muhammad Ahmed
Muhammad Ahmed

Reputation: 174

Gitlab.com is having issues with SSH (in a few regions.e.g. India/Pakistan). take these steps to access your repos , this is working for me (using https).

  1. setup personal access token in gitlab
  2. run this in terminal git remote set-url origin https://<USERNAME>:<PERSONALACCESSTOKEN>@gitlab.com/path/to/repo.git
  3. push / pull on that repo should work now p.s. related issue on gitlab: https://gitlab.com/gitlab-org/gitlab-foss/-/issues/52288#note_415644099

Upvotes: 2

Abdullah Razzaki
Abdullah Razzaki

Reputation: 992

Seems to be a problem with CloudFlare

Gitlab SSH is not working for many users across Pakistan. Users in cities such as Karachi, Lahore, Islamabad and Multan have reported that they can not pull, push, clone git repositories over SSH. The issue seems to be with CloudFlare as traffic from Pakistan is re-routed and does not reach the destination. Using HTTPS instead of SSH or accessing through a VPN works. The issue has been experienced at least since Friday (Sept 18). Interestingly, Fiberlink users in Karachi can access Gitlab through SSH. PTCL, Zong, StormFiber ain’t working.

https://forum.gitlab.com/t/gitlab-pull-push-issue/42889

Upvotes: 1

VonC
VonC

Reputation: 1323653

Check first if the issue persists from different workstation in your network (assuming an enterprise setting).

For a personal home setting, considering the connection is established, there should not be any firewall issue.
Then check your environment variables for anything related to SSH:

env|grep -i SSH
git config -l | grep -i ssh

Upvotes: 1

Related Questions