When GitLab (or unicorn) is only listening on an UNIX socket, gitlab-git-http-server fails to send authentication requests to GitLab as it uses http://localhost:8080/ as authBackend. As a result, GitLab runners will not be able to clone the project and run tests etc. Also, cloning repositories over HTTPS is not possible.
I am not sure, if this is a bug or not. For me, it costed two hours of figuring out where in the installation/upgrade docs something with port 8080 is described. So maybe you should add this to the docs or whereever :-)
@MakerTim Have you taken a look at the log file? It is located at /home/git/gitlab/log/gitlab-git-http-server.log ;-) Also, did you restart gitlab after uncommenting line 39?
I'm having the same problem @MakerTim has. Line 39 was already uncommented in unicorn.rb and will uncomment itself even after comment it out myself. The log file only prints out this:
Same for me. Cloning any project end up with "empty repository" info. If I already had project with https://git... repo it ends with:
error: Cannot access URL https://git.../repo.git/, return code 22 fatal: git-http-push failed error: failed to push some refs to 'https://git.../repo.git'
I was using GitLab 7.11 (worked fine) and I updated to newest 8.0.1 (not working git over https anymore).
I'm running GitLab through Nginx + UWSGI (unix socket), so there is no Unicorn.
I had to create additional vhost in Nginx on another port to use it as an authBackend, it only proxy_passes requests to UWSGI. Original vhost proxy_passes git requests to gitlab-git-http-server.
If using omnibus gitlab installer, and having an external nginx+passenger, I had to add this lines to make auth work on uwsgi (sockets) only
LOCAL HTTP AUTH
server { listen 127.0.0.1:8080; server_tokens off; ## Don't show the nginx version number, a security best practice root /opt/gitlab/embedded/service/gitlab-rails/public; client_max_body_size 250m; access_log /var/log/gitlab/nginx/gitlab_w_access.log; error_log /var/log/gitlab/nginx/gitlab_w_error.log; # Ensure Passenger uses the bundled Ruby version passenger_ruby /opt/gitlab/embedded/bin/ruby; # Correct the $PATH variable to included packaged executables passenger_env_var PATH "/opt/gitlab/bin:/opt/gitlab/embedded/bin:/usr/local/bin:/usr/bin:/bin"; # Make sure Passenger runs as the correct user and group to # prevent permission issues passenger_user git; passenger_group git; # Enable Passenger & keep at least one instance running at all times passenger_enabled on; passenger_min_instances 1; error_page 502 /502.html;}
e.g. all requests to port 8080 go straight to passenger instance, while those who come to port 80 / 443 are filtered as usual.
This fix can have some side effects, as it represents to instances of gitlab running, and i'm not sure if this is correct. I think we can actually redirect all requests from HTTPS host, other than sent to gitlab-git-http-server to this "local" instance, removing this issue.
I have had a similar problem. - I just solved it. This instance for me was an upgrade from Gitlab 7 to 8. In Gitlab 8, gitlab-git-http-server has been depreciated. So, in my custom nginx config file, I replaced the socket connection to goto /var/opt/gitlab/gitlab-workhorse/socket instead of the gitlab-git-http-server location. Rebooted nginx, and then I was able to push and pull without error ;)