Fresh Install Ubuntu - Results in (502 Gitlab is not responding) - [CALLING ALL AVENGERS!]

Hello Everyone

I have a ubuntu 14.04.3 LTS (Trusty) vps up and running.The VPS is running flawlessly. So far, I have been using stash but decided you know what? It doesn’t hurt to try Git-lab (Little did I know that I was wrong 100%). So I connected to my working VPS and installed started installing Git-lab. I installed Git-lab and then I edited the /etc/gitlab/gitlab.rb file and entered my URL: gitlab.mywebsite.com:8888. I reconfigure git-lab and I restart Git-lab. I go to browser and I type gitlab.mywebsite.com:8888 and I see the gitlab favicon and right after all I see is a nightmare beyond my imagination. I get a Gitlab 502 is not responding message. I have been trying all day reading articles and towards the end I only found one article related to my issue and you know what the answer was: “Nvm, I figured it out myself”. Not very helpful now is it?

So I call upon the Avengers Team of Gitlab to please help me fix this issue. Below are the logs:

==============================

/var/log/gitlab/nginx/current:

2016-01-08_21:31:35.02399 2016/01/08 16:31:35 [emerg] 27319#0: bind() to 0.0.0.0:80 failed (98: Address already in use)
2016-01-08_21:31:35.52422 2016/01/08 16:31:35 [emerg] 27319#0: bind() to 0.0.0.0:80 failed (98: Address already in use)
2016-01-08_21:31:36.02438 2016/01/08 16:31:35 [emerg] 27319#0: bind() to 0.0.0.0:80 failed (98: Address already in use)
2016-01-08_21:31:36.52449 2016/01/08 16:31:35 [emerg] 27319#0: bind() to 0.0.0.0:80 failed (98: Address already in use)
2016-01-08_21:31:37.02544 2016/01/08 16:31:35 [emerg] 27319#0: bind() to 0.0.0.0:80 failed (98: Address already in use)
2016-01-08_21:31:37.52598 2016/01/08 16:31:35 [emerg] 27319#0: still could not bind()

==============================

var/log/gitlab/nginx/gitlab_error.log

2016/01/08 17:42:45 [error] 7483#0: *28 connect() to unix:/var/opt/gitlab/gitlab-rails/sockets/gitlab.socket failed (111: Connection refused) while connecting to upstream, client: 23.91.152.243, request: “GET / HTTP/1.1”, upstream: “http://unix:/var/opt/gitlab/gitlab-rails/sockets/gitlab.socket:/”, host: “gitlab.example.com:8888

2016/01/08 17:48:07 [crit] 8510#0: *1 connect() to unix:/var/opt/gitlab/gitlab-rails/sockets/gitlab.socket failed (2: No such file or directory) while connecting to upstream, client: 23.91.152.243, request: “GET / HTTP/1.1”, upstream: “http://unix:/var/opt/gitlab/gitlab-rails/sockets/gitlab.socket:/”, host: “gitlab.example.com:8888

2016/01/08 17:48:40 [crit] 9004#0: *1 connect() to unix:/var/opt/gitlab/gitlab-rails/sockets/gitlab.socket failed (2: No such file or directory) while connecting to upstream, client: 23.91.152.243, request: “GET / HTTP/1.1”, upstream: “http://unix:/var/opt/gitlab/gitlab-rails/sockets/gitlab.socket:/”, host: “gitlab.example.com:8888

2016/01/08 17:50:11 [crit] 9004#0: *5 connect() to unix:/var/opt/gitlab/gitlab-rails/sockets/gitlab.socket failed (2: No such file or directory) while connecting to upstream, client: 23.91.152.243, request: “GET / HTTP/1.1”, upstream: “http://unix:/var/opt/gitlab/gitlab-rails/sockets/gitlab.socket:/”, host: “gitlab.example.com:8888

2016/01/08 17:55:15 [crit] 9586#0: *1 connect() to unix:/var/opt/gitlab/gitlab-rails/sockets/gitlab.socket failed (2: No such file or directory) while connecting to upstream, client: 23.91.152.243, request: “GET / HTTP/1.1”, upstream: “http://unix:/var/opt/gitlab/gitlab-rails/sockets/gitlab.socket:/”, host: “gitlab.example.com:8888

2016/01/08 17:55:20 [crit] 9586#0: *1 connect() to unix:/var/opt/gitlab/gitlab-rails/sockets/gitlab.socket failed (2: No such file or directory) while connecting to upstream, client: 23.91.152.243, request: “GET / HTTP/1.1”, upstream: “http://unix:/var/opt/gitlab/gitlab-rails/sockets/gitlab.socket:/”, host: “gitlab.example.com:8888

2016/01/08 17:58:48 [crit] 9586#0: *6 connect() to unix:/var/opt/gitlab/gitlab-rails/sockets/gitlab.socket failed (2: No such file or directory) while connecting to upstream, client: 23.91.152.243, request: “GET / HTTP/1.1”, upstream: “http://unix:/var/opt/gitlab/gitlab-rails/sockets/gitlab.socket:/”, host: “gitlab.example.com:8888

==============================

==> /var/log/gitlab/unicorn/current <==

2016-01-08_23:21:16.80601 starting new unicorn master
2016-01-08_23:21:31.33344 master failed to start, check stderr log for details
2016-01-08_23:21:32.34640 failed to start a new unicorn master
2016-01-08_23:21:32.35248 starting new unicorn master
2016-01-08_23:21:46.55102 master failed to start, check stderr log for details
2016-01-08_23:21:47.55737 failed to start a new unicorn master
2016-01-08_23:21:47.56677 starting new unicorn master
2016-01-08_23:22:01.54537 master failed to start, check stderr log for details
2016-01-08_23:22:02.55199 failed to start a new unicorn master
2016-01-08_23:22:02.55835 starting new unicorn master

==============================

==> /var/log/gitlab/unicorn/unicorn_stderr.log <==

E, [2016-01-08T18:22:14.149575 #11727] ERROR – : adding listener failed addr=127.0.0.1:8080 (in use)
E, [2016-01-08T18:22:14.149778 #11727] ERROR – : retrying in 0.5 seconds (4 tries left)
E, [2016-01-08T18:22:14.650097 #11727] ERROR – : adding listener failed addr=127.0.0.1:8080 (in use)
E, [2016-01-08T18:22:14.650297 #11727] ERROR – : retrying in 0.5 seconds (3 tries left)
E, [2016-01-08T18:22:15.150588 #11727] ERROR – : adding listener failed addr=127.0.0.1:8080 (in use)
E, [2016-01-08T18:22:15.150777 #11727] ERROR – : retrying in 0.5 seconds (2 tries left)
E, [2016-01-08T18:22:15.651096 #11727] ERROR – : adding listener failed addr=127.0.0.1:8080 (in use)
E, [2016-01-08T18:22:15.651295 #11727] ERROR – : retrying in 0.5 seconds (1 tries left)
E, [2016-01-08T18:22:16.151613 #11727] ERROR – : adding listener failed addr=127.0.0.1:8080 (in use)
E, [2016-01-08T18:22:16.151785 #11727] ERROR – : retrying in 0.5 seconds (0 tries left)
E, [2016-01-08T18:22:16.652080 #11727] ERROR – : adding listener failed addr=127.0.0.1:8080 (in use)
/opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/unicorn-4.6.3/lib/unicorn/socket_helper.rb:147:in initialize': Address already in use - bind(2) for "127.0.0.1" port 8080 (Errno::EADDRINUSE) from /opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/unicorn-4.6.3/lib/unicorn/socket_helper.rb:147:in new’
from /opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/unicorn-4.6.3/lib/unicorn/socket_helper.rb:147:in bind_listen' from /opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/unicorn-4.6.3/lib/unicorn/http_server.rb:229:in listen’
from /opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/unicorn-4.6.3/lib/unicorn/http_server.rb:773:in block in bind_new_listeners!' from /opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/unicorn-4.6.3/lib/unicorn/http_server.rb:773:in each’
from /opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/unicorn-4.6.3/lib/unicorn/http_server.rb:773:in bind_new_listeners!' from /opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/unicorn-4.6.3/lib/unicorn/http_server.rb:141:in start’
from /opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/unicorn-4.6.3/bin/unicorn:126:in <top (required)>' from /opt/gitlab/embedded/service/gem/ruby/2.1.0/bin/unicorn:23:in load’
from /opt/gitlab/embedded/service/gem/ruby/2.1.0/bin/unicorn:23:in `’

==============================

So at the end of the day, Any help is appreciated it. I did my homework, someone said delete the gitlab.socket and reconfigure the gitlab and it will re generate it and I did just that but it didn’t generate it at all.

BTW, the example.com… I just replaced that due to privacy for this post.

Shut down the services,
sudo gitlab-ctl stop

Then check the status of the known services to make sure it managed to shut down
sudo gitlab-ctl status

And then even after that I’m betting there is still some dangling processes from your first startup, (which looks like was initially on port 80 perhaps) So you have going to have to find them and kill them. And then run sudo gitlab-ctl start

The easiest is actually if you can restart the os, but otherwise you will likely have to find the dangling processes. I’m guessing there is at least some unicorn ones hanging around.

1 Like

DUDE! YOU ARE THE AVENGER! WORKED LIKE A CHARM! (Restarted the OS).

Yay GITLAB!

No problem.

The stray processes happen when something fails during GitLab’s process startup. It usually only happens when
a) you have just installed it and the default configuration doesn’t mesh with your server (port 80 in use already on first startup)
or b) you are making changes to gitlab.rb that aren’t quite right, and it fails on start.

You shouldn’t normally run into it during regular upgrades, or server restarts. So what I’m trying to say is most people probably don’t run into it too often.