Nginx反向代理中的错误 502

#1

Gogs 版本:0.11.29.0727
系统类型及版本:Debian 3.16.43-2+deb8u5 (2017-09-19) x86_64 GNU/Linux
数据库:MySQL
问题描述:

nginx 错误日志:[error] 88358#0: 509505 sendfile() failed (32: Broken pipe) while sending request to upstream, client: 117.12.., server: git..com, request: "POST //.git/git-receive-pack HTTP/1.1", upstream: "http://127.0.0.1:3000//.git/git-receive-pack", host: "git..com"

nginx配置:
server {
listen 80;
listen [::]:80;
listen 443 ssl;

ssl on;
ssl_certificate /etc/nginx/ssl/**.crt;
ssl_certificate_key /etc/nginx/ssl/**.key;

server_name git.**.com;

add_header "Strict-Transport-Security" "max-age=63072000";

location / {
        proxy_read_timeout 2000;
		proxy_pass http://127.0.0.1:3000/;
}

}

git提交错误信息:
git.exe push -v --progress “origin” develop:develop

Counting objects: 9, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (9/9), done.
Writing objects: 100% (9/9), 1.45 MiB | 0 bytes/s, done.
Total 9 (delta 5), reused 0 (delta 0)
POST git-receive-pack (1515718 bytes)
fatal: The remote end hung up unexpectedly
fatal: The remote end hung up unexpectedly
error: RPC failed; HTTP 502 curl 22 The requested URL returned error: 502 Bad Gateway
Pushing to https://git..com//**.git
Everything up-to-date

git 未能顺利结束 (退出码 1) (2422 ms @ 2019/3/29 17:38:35)

0 Likes

#2

这个值代表多大?

0 Likes

#3

2000s

0 Likes

#4

我估计 gogs 那边有错误日志

0 Likes

#5

2019/04/01 11:08:23 [TRACE] AddTestPullRequestTask [head_repo_id: 209, head_branch: develop]: finding pull requests
2019/04/01 11:08:23 [TRACE] DeliverHooks [repo_id: 209]
2019/04/01 11:08:23 [TRACE] AddTestPullRequestTask [base_repo_id: 209, base_branch: develop]: finding pull requests
2019/04/01 11:08:23 [TRACE] Hook delivered: 09dc5443-163f-46d4-b97b-23558cf5a98f

和这个会有关系吗?
只有gogs.log里有内容,serv.log中并没有日志。

0 Likes

#6

[…/routes/repo/http.go:284 serviceRPC()] HTTP.serviceRPC: fail to serve RPC ‘upload-pack’: exit status 128 - {fatal: The remote end hung up unexpectedly
%!s(int=0)
%!s(bytes.readOp=0)}
发现了一个error的日志,是不是这个引起的呢?

0 Likes

#7

应该是这个引起的,gogs 这边调用系统 git 命令的时候出错了。

0 Likes

#8

我该怎么排查处理呢?

0 Likes

#9

先升级个最新版gogs看看。。。

0 Likes