Fab Fab - 1 year ago 253
Git Question

gitlab self-hosted big push fail fatal: the remote end hung up unexpectedly

I'm adding a new project to a gitlab self-hosted instance, but:

  • If I try to push a commit with only a Readme it works.

  • If I try to push a huge commit with plenty of files, it fails like that:

Sample command:

git push
Counting objects: 965, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (952/952), done.
Writing objects: 100% (965/965), 1.30 MiB | 1.51 MiB/s, done.
Total 965 (delta 479), reused 0 (delta 0)
Connection reset by x.x.x.x
fatal: The remote end hung up unexpectedly
fatal: The remote end hung up unexpectedly

By the way, on the server, there are some process running and waiting forever the push completion...

gitlab 27227 0.0 0.0 95476 5220 ? S 11:23 0:00 sshd: gitlab@notty
gitlab 27228 0.0 0.0 4508 708 ? Ss 11:23 0:00 sh -c /opt/gitlab/embedded/service/gitlab-shell/bin/gitlab-shell key-1
gitlab 27229 0.0 0.0 30372 3796 ? Sl 11:23 0:00 git-receive-pack /var/opt/gitlab/git-data/repositories/third-parties/MyThirdParty.git
gitlab 27241 0.0 0.0 23036 4208 ? S 11:24 0:00 git index-pack --stdin --pack_header=2,965 --keep=receive-pack 27229 on dev --strict --fix-thin

I've used gitlab for quite a while now and I've never seen such an issue.

Push is done through SSH, so obviously the increase of Http Post buffer had no impact.
I tried to find some git ssh buffer related configuration but it doesn't seem to exist.

Fab Fab
Answer Source

Edit Gitlab configuration file:

sudo nano /etc/gitlab/gitlab.rb

Under Gitlab shell Settings

## GitLab Shell settings for GitLab
gitlab_rails['git_max_size'] = 104857600

Just choose a sufficiently high number.

Update running configuration

sudo gitlab-ctl reconfigure

Additional note: I've read on SO and on some other sites that people tried to modify directly the configuration files in the root directory of Gitlab... Just DON'T. It would be overwritten by the next reconfigure.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download