502 Bad Gateway by Nginx for GitLab Big Fork

I run GitLab 6.0.0 through Nginx and can develop small repositories, but when I try to deploy a large repository (2 GB), I see the 502 Bad Gateway page after <strong> one minute.

/var/log/nginx/gitlab_error.log shows:

 2013/08/29 12:21:33 [error] 25098#0: *221 upstream prematurely closed connection while reading response header from upstream, client: 12.34.56.78, server: myserver, request: "POST /mygroup/myproject/fork HTTP/1.1", upstream: "http://unix:/home/git/gitlab/tmp/sockets/gitlab.socket:/mygroup/myproject/fork", host: "myserver", referrer: "http://myserver/mygroup/myproject/fork" 
+4
source share
2 answers

Problem 1527 suggests a memory problem (and that the memory requirement is mentioned in the document ).

This may also be due to the initial timeout:

I found that this error also occurs due to the fact that unicorn workers sometimes take 33 seconds, and they are set to timeout after 30 seconds.

You can change the unicorn /home/git/gitlab/config/unicorn.rb configuration file:

 timeout 300 

In your NGiNX configuration, you can also add:

 proxy_connect_timeout 300; proxy_read_timeout 300; 

If you have a /etc/nginx/fastcgi_params with your NGiNX, you can add:

 fastcgi_connect_timeout 60; fastcgi_send_timeout 180; fastcgi_read_timeout 180; fastcgi_buffer_size 156 16k; fastcgi_buffers 256 16k; fastcgi_busy_buffers_size 256k; fastcgi_temp_file_write_size 256k; fastcgi_intercept_errors on; fastcgi_max_temp_file_size 0 fastcgi_pass unix:/tmp/fpm.sock; 

Please note that after 502 and after the fix mentioned above, it is recommended that you clear your browser cache before trying to access gitlab again.

+7
source

I did the same as your guide. But change the fastcgi configuration a bit.

 fastcgi_pass unix:/home/git/gitlab/tmp/sockets/gitlab.socket; 

Thanks so much for your guide!

TWINQ78

0
source

Source: https://habr.com/ru/post/1499521/


All Articles