简体   繁体   中英

How I can resolve 502 error on Gitlab?

So, I try to install Gitlab and I have some problems. At the end of Installation from source , when I try to start all services, I have a 502 error. I have this message when I try sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production :

Check GitLab API access: FAILED. code: 502
gitlab-shell self-check failed
  Try fixing it:
  Make sure GitLab is running;
  Check the gitlab-shell configuration file:
  sudo -u git -H editor /home/git/gitlab-shell/config.yml
  Please fix the error above and rerun the checks.

After some search, I think it's a unicorn error. That's what I find in the file log tail -n 15 /home/git/gitlab/log/unicorn.stderr.log :

F, [2015-08-17T14:08:25.266483 #15125] FATAL -- : error adding listener addr="188.213.26.27":80
/home/git/gitlab/vendor/bundle/ruby/2.1.0/gems/unicorn-4.6.3/lib/unicorn/socket_helper.rb:147:in `initialize': Permission denied - bind(2) for "188.213.26.27" port 80 (Errno::EACCES)

I don't know how I can change this and if it's the real problem. If it can help, this is the Nginx log tail -f /var/log/nginx/gitlab_error.log :

    2015/08/16 16:46:24 [error] 14932#0: *33 limiting connections by zone "limit_per_ip", client: 188.213.26.27, server: gitlab.nova.ovh, request: "GET / HTTP/1.0", host: "gitlab.nova.ovh"
2015/08/16 17:00:41 [error] 14932#0: *71 limiting connections by zone "limit_per_ip", client: 188.213.26.27, server: gitlab.nova.ovh, request: "GET / HTTP/1.0", host: "gitlab.nova.ovh"
2015/08/16 17:01:04 [error] 19194#0: *33 limiting connections by zone "limit_per_ip", client: 188.213.26.27, server: gitlab.nova.ovh, request: "GET / HTTP/1.0", host: "gitlab.nova.ovh"
2015/08/16 17:03:01 [error] 19713#0: *33 limiting connections by zone "limit_per_ip", client: 188.213.26.27, server: gitlab.nova.ovh, request: "GET / HTTP/1.0", host: "gitlab.nova.ovh"
2015/08/17 12:18:09 [error] 18616#0: *3 connect() to unix:/home/git/gitlab/tmp/sockets/gitlab.socket failed (111: Connection refused) while connecting to upstream, client: 82.127.11.127, server: gitlab.nova.ovh, request: "GET / HTTP/1.1", upstream: "http://unix:/home/git/gitlab/tmp/sockets/gitlab.socket:/", host: "gitlab.nova.ovh"
2015/08/17 12:18:26 [error] 18616#0: *6 connect() to unix:/home/git/gitlab/tmp/sockets/gitlab.socket failed (111: Connection refused) while connecting to upstream, client: 188.213.26.27, server: gitlab.nova.ovh, request: "GET //api/v3/internal/check HTTP/1.1", upstream: "http://unix:/home/git/gitlab/tmp/sockets/gitlab.socket://api/v3/internal/check", host: "gitlab.nova.ovh"
2015/08/17 13:47:09 [error] 18616#0: *38 connect() to unix:/home/git/gitlab/tmp/sockets/gitlab.socket failed (111: Connection refused) while connecting to upstream, client: 188.213.26.27, server: gitlab.nova.ovh, request: "GET //api/v3/internal/check HTTP/1.1", upstream: "http://unix:/home/git/gitlab/tmp/sockets/gitlab.socket://api/v3/internal/check", host: "gitlab.nova.ovh"
2015/08/17 13:48:05 [error] 18616#0: *42 connect() to unix:/home/git/gitlab/tmp/sockets/gitlab.socket failed (111: Connection refused) while connecting to upstream, client: 188.213.26.27, server: gitlab.nova.ovh, request: "GET //api/v3/internal/check HTTP/1.1", upstream: "http://unix:/home/git/gitlab/tmp/sockets/gitlab.socket://api/v3/internal/check", host: "gitlab.nova.ovh"

Unicorn must not bind port 80 which it is denied anyways (hence the error message). Binding ports below 1024 requires root privileges. Also port 80 is used by nginx. Configure unicorn to not listen to TCP ports at all if you're using unix socket or any high port (eg 8080 or 8081) for use with TCP socket.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM