error: RPC failed; curl 92 HTTP/2 stream 0 was not closed cleanly: PROTOCOL_ERROR (err 1)
Asked Answered
B

50

250

error: RPC failed; curl 92 HTTP/2 stream 0 was not closed cleanly: PROTOCOL_ERROR (err 1)

I tried 'push' while writing 'git'. However, the following message does not solve the problem.

enter image description here

Bagatelle answered 11/12, 2019 at 9:25 Comment(5)
I got this error because I was trying git push origin branch_name and there was no remote branch corresponding to the local branch I'm trying to push.Protoxide
Just try a better internet network.Testudinal
Note: you can also get the almost same error message in completely different context. In my case, it was not related to git. The api response status code was 204, but there was data in response body which made content-length check fail.Aldose
I got this error on mac bcoz while cloning my laptop went to sleep?Radiophotograph
I experienced this on an Inmarsat in-flight wifi connection. http.postBuffer solution worked for me.Unsearchable
P
240

You can force git using http version 1.1

git config --global http.version HTTP/1.1

https://gist.github.com/daofresh/0a95772d582cafb202142ff7871da2fc

Picturesque answered 25/12, 2019 at 3:8 Comment(11)
Why should one downgrade the HTTP version? eventually, we will be moving on to HTTP2.Mucin
This fixed the issue on MacOSX, git config http.postBuffer 524288000 can not fix this issue. But @AbhishekSharma's question is good, why should we downgrade the HTTP version.Ding
This version command fixed my issue. I tried the post buffer approach and also other options like adding user name in the git URL which didn't help me either.Loggins
In reply to questions about downgrading to HTTP/1.1, the error message posted by OP points to an issue with HTTP/2; it is likely that something beyond OP's control (a proxy, the GIT server, etc.) does not work well with HTTP/2. Until that's fixed, downgrading to HTTP/1.1 is a valid workaround.Mumbletypeg
Something else to mention: you may not want to include the --global flag, unless you always work with the same central server. If you work with multiple servers (e.g. GitHub, BitBucket, GitLab, etc.), then you may want to set this config in a repo-by-repo basis.Mumbletypeg
I understand the resistance to downgrading HTTP as a solution, just like I understand why rolling back a software version seems like an awkward solution. However, after trying all kinds of other solutions, this one worked.Varuna
Worked for me on macOS even without the --global flag. Just typed: git config http.version HTTP/1.1 (This seemed to be a problem only with one specific remote I have.)Dealing
I cannot downvote this answer since it is obviously appropriate for many MacOS users. But is seems that the problem (and its answer) is OS-specific. For me for instance, this didn't work but git config http.postBuffer 524288000 did the trick in Ubuntu LTS 20, as other users have suggested. Perhaps it would be wise to edit this top-answer to mention its OS-specific aspect ?Unstable
can i do this with tortoise as well?Aikens
I'm trying to upload a 20GB+ repo to gitlab cloud, and it's resulting with a fatal pretty consistently after a large amount of time waiting. I've attempted this with http.postBuffer at 1GB. I'm going to give this a try and see what happens. I'll post back with whatever the results are.Fala
I am using the Version Control tool in IntelliJ IDEA, but even if I use this command the push operation doesn't seem to work there. Any inputs on this?Bilge
M
135

You might be pushing data larger than the postBuffer size.

You can try increasing post buffer size using

git config --global http.postBuffer 157286400

For reference: https://confluence.atlassian.com/bitbucketserverkb/git-push-fails-fatal-the-remote-end-hung-up-unexpectedly-779171796.html

Mucin answered 27/1, 2020 at 7:9 Comment(9)
Thank you for the valuable reference but not working for me getting same error frequently.Sighted
If you have not set it globally, you will experience this in every git repo and config locally for every repo. Also check if you are uploading a really big file to the repo then the value of buffer size should be set accordinglyMucin
I tried with global as well as local but not working for me and actually I'm not uploading that much of big files also. I read reference provided by you.Sighted
It was nice reference and after reading and trying that I asked separate questionSighted
This solution was not worked for me and Also I have another doubt about switching HTTP version. You can refer my question there is one important answer too.Sighted
For future references, if the solution is not working you can find a possible explanation hereMucin
Also tried this workaround and even got it suggested by github private support but it didn't work. Also 300MB weren't enough. What worked was to use a 1.7GB http.postBuffer instead of the 150MB which seem to be mentioned everywhere. Not a solution but at least a working workaround for my case. For the reference, i got the "RPC failed; curl" error in the middle of the upload at about 56%.Hephzipa
Whats so big that you need to upload on github :o Should use some cloud storage for that purpose I suppose.Mucin
Git is fine for huge amounts of data depending on how you use it. Also there's lfs. I like having submodules and everything in one place :) In my case it's actually github enterprise but the underlying problem is the same.Hephzipa
C
112

Simple solution (reverts to http 2 after) :

git config --global http.version HTTP/1.1
git push 
git config --global http.version HTTP/2
Cookgeneral answered 2/2, 2021 at 17:22 Comment(5)
Why is recomended to return http/2?Kiefer
@AntoCode, it's because it was originally in version http/2. Other pipelines that might be dependant on v2 might fail if the http version remains at 1.1Sulfa
Why not just run git config http.version HTTP/1.1 for that repository? That way you don't need to set it back to HTTP/2 afterwards. Since that change will only apply to the current git repository.Firebrick
Nice idea @Xys. However, it's possible that HTTP/2 is a default, not a set configuration name. This is the case when git config --global http.version returns nothing. In that case, the commands should be git config --global http.version HTTP/1.1; git push; git config --global --unset http.version A bash script that does the right thing in either case is left as an exercise for the reader!Wren
I prefer config this on the working repo and not with the --global param.Krys
J
62

XCode 11.4.1

Increasing the git buffer size worked for me

git config --global http.postBuffer 524288000
Jacksmelt answered 20/5, 2020 at 18:41 Comment(4)
whats the difference between using the --global tag and not?Strawn
--global tag makes it so that all git repositories you have will have a postBuffer of that amount. Omitting global means only that git repo will have a postBuffer of 524288000Firebrick
this did it for me on raspberry pi over WLANNeuro
this works when your internet is fasterLaomedon
G
50

Working Solution:

First change HTTP version to 1.1 and then push and once done change back to HTTP2

$ git config --global http.version HTTP/1.1
After it push was ok and I have changed HTTP version to 2 again:
$ git config --global http.version HTTP/2
Georgeanngeorgeanna answered 9/7, 2020 at 7:40 Comment(1)
This worked for me, but why? It's been fine with HTTP/2 for a number of years. Possible remote service down?Onions
A
30
git config http.postBuffer 524288000

This is the latest, should solve your issue

Affusion answered 12/3, 2021 at 20:13 Comment(1)
This is really a live saver, anytime anydayKaminski
L
26

I followed most of the answers but not solved my problem.

In my case, the answer is very simple

I encountered this error when pushing GIT through an ADSL Broadband Wi-Fi network with low signal strength, low stability, and low speed.

Then, I was able to push it very successfully when I pushed it into the GIT through a Fibre Broadband Wi-Fi network with greater signal strength, greater stability, and higher speed.

Error:

Push failed Enumerating objects: 44, done. Delta compression using up to 12 threads RPC failed; curl 92 HTTP/2 stream 0 was not closed cleanly: CANCEL (err 8) the remote end hung up unexpectedly Total 30 (delta 18), reused 0 (delta 0) the remote hung up unexpectedly

enter image description here

Laudation answered 16/7, 2021 at 11:21 Comment(7)
It would be a lot more helpful to people using search engines if you could post that error as text in your question instead of an image. Considering that this error is different than the one in the question, people getting this error might still arrive and find your answer helpful, but they can't do it if it's an imageIinde
Yeah same for me. I just changed the network connectivity to a faster one and the problem is solved!!Gilson
I also encountered this error: "error: RPC failed; curl 18 transfer closed with outstanding read data remaining send-pack: unexpected disconnect while reading sideband packet"Cygnet
That doesn't make any sense, if that was the problem you could just retry it and it would have worked eventually.Staffman
This is what worked for me, which is annoying because it's not like the connection isn't there. git would reach the same point in the cloning each time and then fail out, despite the presence of a 300KB/S connection being available.Definiens
@SteveMoretz yes, you would think so, but it was the exact same situation for me. See my comment above.Definiens
Same here: While downloading something else, I could not clone git (twice), but it worked afterwards. This smells like a race condition, since TCP is reliable in other aspects than timing.Silkstocking
F
22

It's was not working for me. But worked after downgrading version of HTTP from 2 to 1.1:

$ git config --global http.version HTTP/1.1

After this change, pushing was successful and I have changed HTTP version to 2 again:

$ git config --global http.version HTTP/2
Fictional answered 15/2, 2021 at 6:54 Comment(1)
it is also possible to make it not global but in project specific git config http.version HTTP/1.1Benia
C
6

In most cases git config http.postBuffer 524288000 should work.

In my case, I was pushing a large number of changes (I changed a lot of packages thus there were many lines updated) in my yarn.lock/package-lock.json file. Since it is usually not required, removing it made the error go away. So you can try this too if you are working with Javascript

Carlcarla answered 8/3, 2021 at 10:3 Comment(0)
Y
5

It sounds like either the remote server you're using or some middlebox (e.g., a proxy) is not speaking the HTTP/2 protocol correctly. You can either fix that by asking the owner of that remote server or middlebox to fix their server, or you can force the use of HTTP/1.1.

If you want to force the use of HTTP/1.1, you can set the http.version configuration option to HTTP/1.1. That can also be set on a per-URL basis as described in the http.<url>.* section in the git-config manual page.

Yurikoyursa answered 11/12, 2019 at 23:30 Comment(4)
If a normal file has no 'push' error, if I 'push' the image file, an error occurs.Bagatelle
It may be that whatever network issue, remote server, or middlebox is there is causing problems with certain content, but this is definitely a network-related problem.Yurikoyursa
In my case the remote server is github.com. You would think they had their stuff together. I never had to change my http on my other repository. This one kept giving me 'fatal: the remote end hung up unexpectedly', but after doing the change to http/2, my push succeeded.Varuna
GitHub supports both and both should work without problems (and do for millions of people a day). It is likely that there is something else, such as a non-default antivirus or firewall, a proxy server, or TLS MITM device, all of which are known to cause problems with Git in general.Yurikoyursa
C
5

In most cases, increasing the buffer size will work.

git config http.postBuffer 524288000

It worked for me.

Use of

git config --global http.version HTTP/1.1

should be kept as a last option.

Using a gitbash terminal on a windows machine (if this info helps you in any way).

Clever answered 24/2, 2021 at 14:32 Comment(2)
I'm using WSL2 and this didn't help me...Nummulite
Can you explain why? Both options should be temporary and reverted after resolution.Gadwall
I
5

you can use this if you have problems with your internet connection :

git config --global http.postBuffer 524288000  # Set buffer size to 500 MB
git config --global http.lowSpeedLimit 0      # Disable low speed limit
git config --global http.lowSpeedTime 999999  # Set low speed time limit to a large value
Imperator answered 15/2 at 9:53 Comment(0)
A
4

For my case with the bitbucket behind nginx, disabling proxy request buffering was the answer:

server {
    listen 443 ssl http2 default_server;
    ...
    proxy_request_buffering off;

    # These are also relevant:
    proxy_read_timeout      600;
    client_max_body_size    0;
Adolfo answered 8/5, 2020 at 9:58 Comment(0)
F
4

My issue was slightly different, with a "packages already packed" info with the RPC::HTTP/2 stream not closed cleanly message.

For me this worked:

git checkout --orphan newBranch
git add -A  # Add all files and commit them
git commit -am "Clean Repo"
git branch -D master  # Deletes the master branch
git branch -m master  # Rename the current branch to master
git push -f origin master  # Force push master branch to github

Thanks to: https://panjeh.medium.com/cleaning-up-git-github-repository-without-deleting-git-directory-c86b7415b51b

Flyweight answered 17/3, 2021 at 2:12 Comment(0)
O
4

I went through a similar situation. I tried;

git config --global http.version HTTP/1.1  
git config --global http.postBuffer 157286400
git config --global http.postBuffer 524288000

even,

git config --global core.compression 0  

failed example

but, nothing changed. I had two folders with this error. one with 10MB size and one with 65MB.

finally. I tried with a Fibre connection.

worked proof

So yeah. try with a different, higher speed connection. probably it will work.

Good Luck!

Oto answered 27/7, 2021 at 21:22 Comment(0)
G
4

Using different internet access solved the problem for me, I switched from my main wifi and connect to my phone and it worked.

Glorious answered 27/1, 2022 at 21:40 Comment(2)
Maybe the problem is caused by some block from the internet providerRichierichlad
Yeah, I confirmed.Glorious
K
4

One of the most popular answers is:

git config --global http.postBuffer 157286400

Don't do this blindly as raising this is not, in general, an effective solution for most push problems, but can increase memory consumption significantly since the entire buffer is allocated even for small pushes(from the git documentation).

Check if you've files with size >100 MB first. If yes, then there is a better-suited solution for your problem.

Solution: Git-LFS as it is intended for versioning large files.

Git Large File Storage (LFS) replaces large files such as audio samples, videos, datasets, and graphics with text pointers inside Git, while storing the file contents on a remote server like GitHub.com or GitHub Enterprise.

You can look at this good tutorial on git-lfs which will answer most of your follow-up questions.

Kareenkarel answered 12/7, 2022 at 11:5 Comment(0)
U
3

In my case I had to reset the origin to ssh instead of http/https:

git remote set-url origin [email protected]

To check your origins you can use:

git remote -v
Upcountry answered 30/7, 2020 at 11:55 Comment(0)
I
3

git config --global http.postBuffer 524288000 you can just increase your buffer size it worked for me

Impurity answered 21/9, 2022 at 19:7 Comment(0)
W
3

With me there was issue with my internet and also the large amount of files in my code. I fixed this, Please check your internet speed and also use this.

   git config http.postBuffer 524288000
    git push
Whim answered 17/6, 2023 at 18:13 Comment(0)
J
2

for me helped just this

server {
    listen 443 ssl http2 default_server;
    ...
    location / {
         ...
         proxy_request_buffering off;
         ...
    }
}
Juliannejuliano answered 24/8, 2020 at 17:23 Comment(0)
N
2

Ironically, for me it turned out to be bad internet connection - I tried everything above, nothing worked, then I did a speed test and found I had 100+Mb download but only 0.x Mb upload at the time, due to some wifi issues. After I fixed it the problem disappeared.

Nolitta answered 11/11, 2021 at 13:40 Comment(1)
Same here. I used a wi-fi repeater internet, checked the speed. Upload 0.07. Switched to ethernet and that fixed the problem. Never thought git could fail with such errors because of the upload speed.Longlived
S
2

If none of this helps, maybe you could try using ssh to connect to your git repository. That helped me.

If you are using Bitbucket you can add your ssh key to the repository settings and that way you will gain ssh access. On Github I think you should have ssh access by default. Try connecting to the repository using ssh instead of https, you can do that by changing the remote url for your git.

Schiedam answered 3/5, 2022 at 7:27 Comment(2)
Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.Andino
This does not provide an answer to the question. Once you have sufficient reputation you will be able to comment on any post; instead, provide answers that don't require clarification from the asker. - From ReviewProgenitive
S
2

The easy solution is just Change your internet network temporary for example use your mobile hotspot, and after you did push, you can be back to your current network.

This problem would be happened in pull, push or even clone commands. And the reasons could be your network setting related packet size setting, buffer size and ...

Shoestring answered 25/8, 2022 at 11:7 Comment(0)
Y
2

You really might be pushing data having large size. I was having the same error then I preferred using git LFS and it worked.

Just untrack that specific file (file with huge size) before commit. Use following command.

git rm --cached "<file_name>

Then push remaining files and then use git LFS to upload the file with large size. To know how to upload using git LFS refer this.

Yolandoyolane answered 20/9, 2022 at 10:3 Comment(0)
A
2

I have also faced this. I just switched to another mobile hotspot and it worked for me .

Astronavigation answered 25/10, 2022 at 7:8 Comment(1)
not worked for meCompanionate
G
2

I solved this annoyng problem by changing my wi-fi DNS on my work laptop.

Grandma answered 3/12, 2022 at 7:18 Comment(2)
Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.Andino
This may not be the most information-packed answer in the world, but temporarily switching from my 5 GHz wi-fi network to my 2.4 network solved the problem and allowed me to move on with my life. Knowing /why/ is always better, but sometimes just knowing /how/ is good enough.Metrology
E
1

Don't forget to add an SSH key to your Github account. That was causing the error for me.

Effendi answered 26/10, 2021 at 13:38 Comment(0)
H
1

For me I thought that was my internet so I tried with a better internet but the error persists. Until I have found this solution:

Basicaly I had to copy into another branch the files and delete the other and rename the current one. To clean the repo.

git checkout --orphan newBranch
git add -A  # Add all files and commit them
git commit -am "Clean Repo"
git branch -D master  # Deletes the master branch
git branch -m master  # Rename the current branch to master
git push -f origin master  # Force push master branch to github
Hazlip answered 29/12, 2021 at 12:15 Comment(1)
The point is with this you will lose all previous commits from the branch masterJerricajerrie
M
1

If you are pushing large files you might get this error just use Git Large File Storage

Monoplegia answered 1/2, 2022 at 11:14 Comment(0)
A
1

It could be due to low signal strength. I have pushed heavy files in the open source repositories too and haven't encountered this error. More than the buffer size, it depends largely on the signal strength. You could try pushing it 2 or 3 times more or restart your router, and if it still doesn't work, try the following command:

git config http.postBuffer 524288000
git push
Annexation answered 11/3, 2022 at 21:16 Comment(1)
I'm using WSL2 and this didn't help me...Nummulite
P
1

Could be caused by a folder/file having the same name with the branch.

Try:

git push <branch_name> --

If worked, then better rename one of them.

Peristyle answered 7/3, 2023 at 10:49 Comment(0)
A
0

For me this was caused by a forgotten return 444; in my nginx config. The connection termination caused this misleading error message under HTTP 2.0

Antimonous answered 24/12, 2020 at 18:33 Comment(0)
P
0

Following the advice of some people here:

git config http.postBuffer 524288000
git push

Results to an error:

remote: error: See http://git.io/iEPt8g for more information.
remote: error: File public/img/layout/group-photo.psd is 184.91 MB; this exceeds GitHub's file size limit of 100.00 MB
remote: error: GH001: Large files detected. You may want to try Git Large File Storage - https://git-lfs.github.com.

So this is more of a file issue rather than a network connectivity issue in my case. Move the large file out of the project and proceed to commit and push the whole thing.

Papagena answered 6/8, 2021 at 5:16 Comment(0)
C
0

Also check if you maybe using a VPN, I got the error while using VPN, I decided to turn my VPN off and try again, then it Worked

Christiechristin answered 13/12, 2021 at 6:49 Comment(0)
B
0

I live rurally and have mobile broadband, that is based on a very low 4g signal, I get two bars of signal on a good day. I was pushing several files amounting to only 39mb, which is well below github's max file size, I have also pushed much bigger commits on the same repo from this location, so it did not make sense that the file size caused the problems for me. I tried everything mentioned here, changing to HTTP1, and changing postbuffer did not help.

After several hours of head scratching, I restarted my router and was able to push the commit to github.

Hopefully this can help someone out there that also has terrible a internet connection.

Believe answered 20/1, 2022 at 22:24 Comment(0)
D
0

Switch to Mobile Internet or Change the Internet Connection. This is happened some time because of network issue.

Dishonorable answered 20/7, 2022 at 17:23 Comment(2)
This does not provide an answer to the question. Once you have sufficient reputation you will be able to comment on any post; instead, provide answers that don't require clarification from the asker. - From ReviewHanhana
Maybe the problem is caused by some block from the internet providerRichierichlad
C
0

I've tried all the approach but didn't work.

Turns out it was my network problem, just disconnect and then connect your wifi and it will work.

This is the error I was getting.

enter image description here

Christopher answered 17/8, 2022 at 14:45 Comment(0)
L
0

Surprisingly, I didn't find any answers on this thread that mention simply retrying. I ran into the same error, then simply retried my push and it worked fine. No changing settings or other actions needed.

Lu answered 28/2, 2023 at 17:53 Comment(0)
N
0

You can consider clearing/deleting the first git file from your file and the reinitalized it using the git init for th e second time, Then consider using a low speed enter image description here

Narcho answered 15/1 at 8:53 Comment(0)
A
0

The problem with me was that upload speed on the landline internet was low (less than 1mbps) . So I used mobile hotspot and it worked immediately.

Asinine answered 13/2 at 5:38 Comment(0)
C
0

I was also facing this error.

error: 62928 bytes of body are still expected 663.00 KiB/s
fetch-pack: unexpected disconnect while reading sideband packet
fatal: early EOF
fatal: fetch-pack: invalid index-pack output

On my case I solved it by using this command

git clone --depth 100000 git_repo

Increase it to 100000 and run it 5 to 6 times (it will decrease the bytes size each time)

Caveman answered 3/3 at 21:59 Comment(0)
D
0

I received similar error while cloning one of the big project from gitlab environment. Happens due to unstable internet. Here is what the error I got

...
...    
error: RPC failed; curl 92 HTTP/2 stream 7 was not closed cleanly before end of the underlying stream 
error: 7739 bytes of body are still expected 
fetch-pack: unexpected disconnect while reading sideband packet 
fatal: error EOF 
fatal: fetch-pack: invalid index-pack output

Here is the solution that worked for me.

$ git clone http://github.com/big-repo.git --depth 1
$ cd big-repo
$ git fetch --unshallow
Dump answered 5/3 at 14:25 Comment(0)
S
0

I was facing this error while integrating stripe in ios using pods. I fixed by this command.

git config http.postBuffer 1024M

Don't use --global

Snath answered 6/3 at 12:26 Comment(0)
C
0

So this problem is basically a timeout thing. Your connection is simply too bad to get a response within 5 seconds or 10 seconds. Try this command (setting timeout to 1000sec):

git config --global http.lowSpeedLimit 1000
Carbone answered 15/3 at 4:3 Comment(0)
C
-1

If your error is related to trying to push large file (I had that error message in my case), run:

git filter-branch -f --index-filter 'git rm --cached --ignore-unmatch {your full path file name}'

https://medium.com/@marcosantonocito/fixing-the-gh001-large-files-detected-you-may-want-to-try-git-large-file-storage-43336b983272

Conveyancing answered 30/3, 2021 at 16:47 Comment(0)
F
-1

For me this query works : git push --set-upstream origin main

Footstalk answered 17/12, 2021 at 15:1 Comment(1)
This does not answer the questionPolity
T
-3

The only issue in this case is Bad Internet Connection and nothing else. I fixed it by switching to better internet connection. enter image description here

Tidy answered 25/12, 2021 at 15:49 Comment(0)
T
-4

Disconnect from your VPN and try again. That's what solved it for me.

Trusting answered 1/11, 2022 at 13:22 Comment(0)
V
-6

In my case, I changed my password on the server (Gitlab) but not in my local git credentials.

Vitale answered 6/12, 2020 at 21:20 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.