Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Gitlab: Cloning (via ssh) on a fresh install fails with “The remote end hung up unexpectedly”

Tags:

gitlab

Pushing to a new repo in a fresh gitlab installation (6.0.1) fails with

Access denied.
fatal: Could not read from remote repository.

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

But ssh -vT [email protected] works.

like image 528
pabo Avatar asked Sep 10 '13 19:09

pabo


1 Answers

When

sudo -u git -H /home/git/gitlab-shell/bin/check

I got:

Check GitLab API access: FAILED. code: 503

Check directories and files: 
    /home/git/repositories: OK
    /home/git/.ssh/authorized_keys: OK

In the gitlab-shell.log I found a html response which said:

ERROR

The requested URL could not be retrieved

The following error was encountered while trying to retrieve the URL: http://my.gitlab.eu//api/v3/internal/check

Unable to determine IP address from host name my.gitlab.eu

The DNS server returned:

Name Error: The domain name does not exist. This means that the cache was not able to resolve the hostname presented in the URL. Check if the address is correct.

Your cache administrator is [email protected].

I edited the config file of gitlab-shell

/home/git/gitlab-shell# sudo -u git -H editor config.yml

like this

# Url to gitlab instance. Used for api calls. Should end with a slash.
#gitlab_url: "http://my.gitlab.eu/"
gitlab_url: "http://123.xxx.xxx.xx"

The end slash leads obviosly to a double slash in the api call despite the hint in the comment. In my case the dns could not be solved. So now I use the ip address and it works.

like image 147
pabo Avatar answered Nov 08 '22 20:11

pabo