Gitlab服务器环境是CentOS7+Gitlab7.2.1,最近发现在开发机上使用git pull更新文件时,会报如下错误。
fatal: The remote end hung up unexpectedly
fatal: early EOF
fatal: unpack-objects failed
使用git clone重新checkout源也受到影响,长时间checkout不出来,
Google了半天也没找到个好办法,最后还是查错误日志定位到了问题
在/var/log/gitlab/unicorn/unicorn_stderr.log中,发现如下的错误信息
E, [2014-12-06T09:13:10.319216 #11074] ERROR -- : worker=0 PID:11091 timeout (31s > 30s), killing
E, [2014-12-06T09:13:10.336186 #11074] ERROR -- : reaped #<Process::Status: pid 11091 SIGKILL (signal 9)> worker=0
I, [2014-12-06T09:13:10.340379 #11183] INFO -- : worker=0 spawned pid=11183
I, [2014-12-06T09:13:10.340848 #11183] INFO -- : worker=0 read
看来是被Ruby误认为超时中断了。解决办法就是调大unicorn的timeout值。
修改/var/opt/gitlab/gitlab-rails/etc/unicorn.rb,将
# What the timeout for killing busy workers is, in seconds
timeout 30
改为
# What the timeout for killing busy workers is, in seconds
timeout 60
最后,运行
sudo systemctl restart gitlab-runsvdir.service
重启Gitlab。
之后客户端就可以正常Git pull或者clone了
在 Ubuntu 12.04 上安装 GitLab