18

I keep getting this error when I try to push anything to my own gitlab server:

Push failed
Failed with error:
fatal: The remote end hung up unexpectedly
fatal: The remote end hung up unexpectedly
error: RPC failed;
curl 56 Recv failure: Connection was reset

I have no idea why I keep getting this error. I kept trying to push and then out of nowhere it pushed it successfully. But everything I tried to push after that just gave me the same error.

Here is a more detailed log:

16:21:39.932: [gallery] git -c core.quotepath=false push --progress --porcelain origin refs/heads/master:master
Counting objects: 12, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (12/12), done.
Writing objects: 100% (12/12), 1.88 MiB | 25.00 KiB/s, done.
Total 12 (delta 3), reused 0 (delta 0)
fatal: The remote end hung up unexpectedly
fatal: The remote end hung up unexpectedly
Done
error: RPC failed; curl 56 Recv failure: Connection was reset
LuFFy
  • 8,799
  • 10
  • 41
  • 59
J. Ketting
  • 181
  • 1
  • 1
  • 4
  • Seems like https://github.com/gitlabhq/gitlabhq/issues/9148 or http://stackoverflow.com/questions/11500847/php-curl-error-curl-56-recv-failure-connection-reset-by-peer. No definitive answer though. – VonC Apr 29 '16 at 17:28
  • Take a look at this SO question: http://stackoverflow.com/questions/10285700/curl-error-recv-failure-connection-reset-by-peer-php-curl – Mladen B. Nov 04 '16 at 13:59
  • 1
    i have also the same problem. to solve this issue i am doing following things: `git reset --hard HEAD~1` after that. i am adding my project files into the same folder again because everything has reverted into previous stage. so then executing following commands. `git add * - git commit -m 'again' - git push`. then it pushes successfully. – light souls Mar 21 '17 at 11:04
  • This can in general happen because of network interference or because the connection was closed by the remote service or the remote OS. One cause may be the remote running out of memory. @jketting Can you provide logs from the server? @lightsouls Does trying `git push` a few times without the other commands also help? – Jan Zerebecki May 07 '17 at 16:42

2 Answers2

18

Please try one of these methods below:

Method 1:

git config --global http.postBuffer 157286400

Method 2:
Increase "client_max_body_size" of your Nginx configuration in your Gitlab server.

Checkout this link to get more information: https://confluence.atlassian.com/stashkb/git-push-fails-client-intended-to-send-too-large-chunked-body-590251250.html

Hope they will be useful! Good luck!!!

An Huy
  • 432
  • 3
  • 7
  • I had a slightly different error but this also solved it: `error: RPC failed; curl 55 TCP connection reset by peer` – Mike Jul 17 '18 at 19:57
0

I got this error, when the host changed from http://gitlab.company.com/group/myproject/' to http://gitlab.company.net/group/myproject/. To update the remote head we can follow this steps from the IDE (I am using the Intellij IDE)

IntelliJ -> VCS -> Git -> Remotes (Edit, delete or Add new Remote)

u_pendra
  • 908
  • 1
  • 10
  • 25