The solution to the Gitlab 502 problem I have encountered

Source: Internet
Author: User
Tags commit socket

Today, the Gitlab is configured on the Ali cloud, but there has been an error 502 error.

502
Gitlab is not responding.
Please contact the your Gitlab administrator if this problem persists.

After an afternoon of search finally found the error, the original is on the server also opened a Tomcat service, occupies 8080 ports, so that Gitlab unicorn service can not be opened.
Finally, make the following changes in the/ETC/GITLAB/GITLAB.RB

<code class= "Hljs bash has-numbering" style= "display:block; padding:0px; Color:inherit; Box-sizing:border-box; font-family: ' Source Code Pro ', monospace;font-size:undefined; White-space:pre; border-radius:0px; Word-wrap:normal; background:transparent; " >unicorn[<span class= "hljs-string" style= "Color:rgb (0, 136, 0); box-sizing:border-box;" > ' Port ' </span>] = <span class= "Hljs-number" style= "Color:rgb" (0, 102, 102); Box-sizing:border-box; " >9090</span></code><ul class= "pre-numbering" style= "Box-sizing:border-box; Position:absolute; width:50px; top:0px; left:0px; margin:0px; padding:6px 0px 40px; border-right-width:1px; Border-right-style:solid; Border-right-color:rgb (221, 221, 221); List-style:none; Text-align:right; Background-color:rgb (238, 238, 238); ><li style= "Box-sizing:border-box; padding:0px 5px; " >1</li></ul>

Again Gitlab-ctl reconfigure reboot configuration, so that the Gitlab server can run normally.

Here is a record of how to solve the problem, but also for their long experience.
Install the Gitlab, open the service, found that there are 502 errors. This is the beginning to find solutions to all kinds of Baidu.
1. Locate the error log file in/var/log/gitlab/nginx and find the following error/var/opt/gitlab/gitlab-rails/sockets/gitlab.socket failed (2:no such file or directory, and then created the socket file with the NC command, with the final permission set to SRWXRWXRWX, the user and group set to Git:git, but found that this method was not workable.

2. Then I ran to Gitlab's official website to find a solution, https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/README.md
Ctrl+f 502 Find out about 502 problems in the official tutorials

Note this on a single-core server it could take up to a minute to restart Unicorn and Sidekiq. Your Gitlab instance'll give a 502 error until unicorn is up again.

It is also possible to start, stop or restart individual components.

sudo gitlab-ctl restart Sidekiq
Unicorn supports zero-downtime reloads. These can be triggered as follows:

sudo gitlab-ctl hup Unicorn
Note This cannot use a unicorn reload to update the Ruby runtime.

Try to solve with the above two commands, find no use.
At this time I was angry, constant input gitlab-ctl status, found that the unicorn PID has been growing. The PID of several other services has not changed.

3. At this time almost found the problem, it should be the unicorn problem. Then look at the official tutorial, you can use Gitlab-ctl tail unicorn to track the status of Unicorn, this time sad to find the original lack of permission,chmod-r 777/var/log/gitlab

2015-05-09_14:17:29.67447/opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/unicorn-4.6.3/lib/unicorn/http_ Server.rb:732:in ' Initialize ': Permission denied @ rb_sysopen-/var/log/gitlab/unicorn/unicorn_stderr.log (Errno:: eacces)
2015-05-09_14:17:29.67466 FROM/OPT/GITLAB/EMBEDDED/SERVICE/GEM/RUBY/2.1.0/GEMS/UNICORN-4.6.3/LIB/UNICORN/HTTP_ Server.rb:732:in ' Open '
2015-05-09_14:17:29.67469 FROM/OPT/GITLAB/EMBEDDED/SERVICE/GEM/RUBY/2.1.0/GEMS/UNICORN-4.6.3/LIB/UNICORN/HTTP_ Server.rb:732:in ' Redirect_io '
2015-05-09_14:17:29.67473 FROM/OPT/GITLAB/EMBEDDED/SERVICE/GEM/RUBY/2.1.0/GEMS/UNICORN-4.6.3/LIB/UNICORN/HTTP_ Server.rb:177:in ' stderr_path= '
2015-05-09_14:17:29.67478 from/opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/unicorn-4.6.3/lib/unicorn/ Configurator.rb:111:in ' block in commit! '
2015-05-09_14:17:29.67482 from/opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/unicorn-4.6.3/lib/unicorn/ Configurator.rb:108:in ' Each '
2015-05-09_14:17:29.67486 from/opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/unicorn-4.6.3/lib/unicorn/ Configurator.rb:108:in ' commit! '
2015-05-09_14:17:29.67491 FROM/OPT/GITLAB/EMBEDDED/SERVICE/GEM/RUBY/2.1.0/GEMS/UNICORN-4.6.3/LIB/UNICORN/HTTP_ Server.rb:121:in ' Initialize '
2015-05-09_14:17:29.67496 From/opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/unicorn-4.6.3/bin/unicorn:126:in ' New '
2015-05-09_14:17:29.67500 From/opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/unicorn-4.6.3/bin/unicorn:126:in ' <top (required) > '
2015-05-09_14:17:29.67504 from/opt/gitlab/embedded/service/gem/ruby/2.1.0/bin/unicorn:23:in ' Load '
2015-05-09_14:17:29.67509 from/opt/gitlab/embedded/service/gem/ruby/2.1.0/bin/unicorn:23:in ' <main> '
2015-05-09_14:17:29.68708 Master failed to start, check stderr log for details


<ul class= "pre-numbering" style= "Box-sizing:border-box; Position:absolute; width:50px; top:0px; left:0px; margin:0px; padding:6px 0px 40px; border-right-width:1px; Border-right-style:solid; Border-right-color:rgb (221, 221, 221); List-style:none; Text-align:right; Background-color:rgb (238, 238, 238); ><li style= "Box-sizing:border-box; padding:0px 5px; " >1</li><li style= "Box-sizing:border-box; padding:0px 5px; " >2</li><li style= "Box-sizing:border-box; padding:0px 5px; " >3</li><li style= "Box-sizing:border-box; padding:0px 5px; " >4</li><li style= "Box-sizing:border-box; padding:0px 5px; " >5</li><li style= "Box-sizing:border-box; padding:0px 5px; " >6</li><li style= "Box-sizing:border-box; padding:0px 5px; " >7</li><li style= "Box-sizing:border-box; padding:0px 5px; " >8</li></ul>

4. Well, finally found the problem. This time the choice becomes the original 8080-port service to kill or the unicorn port for another one. This depends on the specific needs of their own. My side is the Unicorn port replaced by 9090, the method is the beginning of the method of the

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.