git - 来自 Nginx 的 502 Bad Gateway for large GitLab fork

标签 git nginx gitlab git-fork

我正在通过 Nginx 运行 GitLab 6.0.0,并且可以 fork 小型存储库,但是当我尝试 fork 大型存储库 (2GB) 时,大约 502 Bad Gateway 页面出现了 < strong>一分钟。

/var/log/nginx/gitlab_error.log 显示:

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"

最佳答案

Issue 1527提示存在内存问题(以及 memory requirement in mentioned in the doc )。

也可能是因为初始超时:

I found this error would also occur because the unicorn workers would sometimes take 33 seconds to start and they're configured to timeout after 30 seconds.

你可以修改 unicorn 配置文件 /home/git/gitlab/config/unicorn.rb :

timeout 300

在您的 NGiNX 配置中,您还可以添加:

proxy_connect_timeout 300;
proxy_read_timeout 300;

如果你的 NGiNX 有一个 /etc/nginx/fastcgi_params 文件,你可以添加:

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;

请注意,在出现 502 并进行上述修复后,最好在再次尝试访问 gitlab 之前清除浏览器缓存。

关于git - 来自 Nginx 的 502 Bad Gateway for large GitLab fork,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18501406/

相关文章:

git - git如何检测文件已被修改?

node.js - 在 nginx 后面使用expressjs设置响应头

html - 使用 NGINX,css 文件不工作

Gitlab CI 在作业之间传递依赖关系

Git 推送失败,错误为 : “GitLab: Author not member of team”

Git:将存储库移动到另一个存储库的子文件夹

Git 无法锁定 ref 'HEAD' : unable to resolve reference HEAD

php - Nginx 在下载时损坏文件

kubernetes - 我在集群内使用 GItLab CI/CD kubernetes 执行器运行作业时出现错误

docker - 如何将.gitlab-ci.yml中创建的自定义变量传递给Docker?