michen00
michen00

Reputation: 853

Why does git push fail?; "error: RPC failed; curl 18 transfer closed with outstanding read data remaining"; "send-pack: unexpected disconnect whil

I have been trying to git push some files into a repo I just created, but it keeps failing.

I've already tried changing http.version from HTTP/2 to HTTP/1.1 (I've tried both) and I also increased the http.postBuffer and http.maxRequestBuffer size. Most fixes I found online recommend changing one or both of these.

The largest file in my local working directory is 24.6 MB (excluding a .pack file) so I don't have to use Git LFS.

Here is some of the output of git config --list:

diff.astextplain.textconv=astextplain
filter.lfs.clean=git-lfs clean -- %f
filter.lfs.smudge=git-lfs smudge -- %f
filter.lfs.process=git-lfs filter-process
filter.lfs.required=true
http.sslbackend=openssl
http.sslcainfo=C:/Program Files/Git/mingw64/ssl/certs/ca-bundle.crt
core.autocrlf=true
core.fscache=true
core.symlinks=false
pull.rebase=false
credential.helper=manager-core
credential.https://dev.azure.com.usehttppath=true
init.defaultbranch=master
core.editor="C:\Users\username\AppData\Local\Programs\Microsoft VS Code\Code.exe"
--wait
core.longpaths=true
core.compression=0
gui.recentrepo=C:/Users/username/path/to/myRepo
filter.lfs.clean=git-lfs clean -- %f
filter.lfs.smudge=git-lfs smudge -- %f
filter.lfs.process=git-lfs filter-process
filter.lfs.required=true
...
http.postbuffer=30000000
http.version=HTTP/1.1
http.maxrequestbuffer=300000000
credential.helper=wincred
core.bare=false
core.repositoryformatversion=0
core.filemode=false
core.symlinks=false
core.ignorecase=true
core.logallrefupdates=true
remote.origin.url=https://github.com/username/myRepo.git
remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
remote.origin.pushurl=https://github.com/username/myRepo.git
branch.main.remote=origin
branch.main.merge=refs/heads/main

And here is the output after git push:

Enumerating objects: 177, done.
Counting objects: 100% (177/177), done.
Delta compression using up to 8 threads
Compressing objects: 100% (168/168), done.
error: RPC failed; curl 18 transfer closed with outstanding read data remaining
send-pack: unexpected disconnect while reading sideband packet
Writing objects: 100% (177/177), 444.10 MiB | 612.00 KiB/s, done.
Total 177 (delta 5), reused 177 (delta 5), pack-reused 0
fatal: the remote end hung up unexpectedly
Everything up-to-date

I am using no antivirus/firewall other than Windows Defender.

Please help.

Upvotes: 1

Views: 1106

Answers (1)

michen00
michen00

Reputation: 853

In my situation, I was trying to push too large a payload. According to this article, "Because github does not allow a single push larger than 2GB you can push it in batches. Split the push into part1, part2…"

My solution was to break up the payload into several commits and push a couple at a time. Depending on your situation, you could try writing a shell script to push incrementally up to HEAD if you have commit history on your repo. I didn't end up doing that but instead, I made ample use of matching patterns with multiline git add commands to select the files I wanted for each push.

Upvotes: 1

Related Questions