错误:git-upload-pack死于信号13

时间:2014-04-21 15:13:41

标签: git gitlab

我在Mac OS X 10.9.2中有一个GitLab服务器(6.7.2),带有git 1.9.2。有两个存储库。一个可以成功克隆,但另一个失败为

$ git clone http://*/gamil/gamil.git
Cloning into 'gamil'...
remote: Counting objects: 426, done.
remote: Compressing objects: 100% (375/375), done.
fatal: The remote end hung up unexpectedly
fatal: early EOF
fatal: index-pack failed

我在GitLab中检查了unicorn.stderr.log并找到了

I, [2014-04-21T23:03:58.761225 #4929]  INFO -- : master process ready
I, [2014-04-21T23:03:58.764556 #4940]  INFO -- : worker=0 ready
I, [2014-04-21T23:03:58.766098 #4941]  INFO -- : worker=1 ready
error: git-upload-pack died of signal 13

这个错误来自什么?怎么解决?提前谢谢!

编辑1

我检查了存储库:

$ git fsck
Checking object directories: 100% (256/256), done.
Checking objects: 100% (426/426), done.

所以似乎一切都很好,但无法克隆到本地计算机。

编辑2

我已经将GitLab更新为6.8而没有运气。

编辑3

我可以通过ssh protocol`克隆有问题的存储库

$ git clone dongli@<...>:gamil
Cloning into 'gamil'...
remote: Counting objects: 426, done.
remote: Compressing objects: 100% (317/317), done.
remote: Total 426 (delta 89), reused 426 (delta 89)
Receiving objects: 100% (426/426), 821.19 KiB | 0 bytes/s, done.
Resolving deltas: 100% (89/89), done.
Checking connectivity... done.

编辑4

我在unicorn.rb中检查了超时:

# nuke workers after 30 seconds instead of 60 seconds (the default)
timeout 300

以及nginx的配置:

# if a file, which is not found in the root folder is requested,
# then the proxy pass the request to the upsteam (gitlab unicorn)
location @gitlab {
  proxy_read_timeout 300; # Some requests take more than 30 seconds.
  proxy_connect_timeout 300; # Some requests take more than 30 seconds.
  proxy_redirect     off;

  proxy_set_header   X-Forwarded-Proto $scheme;
  proxy_set_header   Host              $http_host;
  proxy_set_header   X-Real-IP         $remote_addr;
  proxy_set_header   X-Forwarded-For   $proxy_add_x_forwarded_for;

  proxy_pass http://gitlab;
}

编辑5

我已将存储库上传到GitHub,克隆是正常的:

$ git clone https://github.com/dongli/GAMIL.git 1
Cloning into '1'...
remote: Counting objects: 355, done.
remote: Compressing objects: 100% (308/308), done.
remote: Total 355 (delta 35), reused 355 (delta 35)
Receiving objects: 100% (355/355), 809.75 KiB | 244.00 KiB/s, done.
Resolving deltas: 100% (35/35), done.
Checking connectivity... done.

所以存储库很好。

1 个答案:

答案 0 :(得分:2)

我终于通过查看抱怨中的/var/log/nginx/gitlab_error.log来找到问题的原因

2014/04/27 17:25:21 [crit] 14331#0: *19 open() 
"/usr/local/var/run/nginx/proxy_temp/3/00/0000000003" failed (13: Permission denied)
while reading upstream, client: 123.113.33.131, server: *, request:
"POST /gamil/gamil.git/git-upload-pack HTTP/1.1", 
upstream: "http://unix:/Users/git/gitlab/tmp/sockets/gitlab.socket:/gamil/gamil.git/git-upload-pack", host: "*"

访问权限为

的目录/usr/local/var
drwx------    8 dongli  admin    272  4  1 14:55 var

所以我把它改成了

drwxr-x---    8 dongli  admin    272  4  1 14:55 var

然后错误终于消失了。