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

GitPush

Git Problem Overview


> 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

Git Solutions


Solution 1 - Git

You can force git using http version 1.1

git config --global http.version HTTP/1.1

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

Solution 2 - Git

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

Solution 3 - Git

Simple solution (reverts to http 2 after) :

git config --global http.version HTTP/1.1
git push 
git config --global http.version HTTP/2

Solution 4 - Git

XCode 11.4.1

Increasing the git buffer size worked for me

git config --global http.postBuffer 524288000

Solution 5 - Git

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

Solution 6 - Git

git config http.postBuffer 524288000

This is the latest, should solve your issue

Solution 7 - Git

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

Solution 8 - Git

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

Solution 9 - Git

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

Solution 10 - Git

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.

Solution 11 - Git

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;

Solution 12 - Git

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).

Solution 13 - Git

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

git remote set-url origin git@your-git.com

To check your origins you can use:

git remote -v

Solution 14 - Git

for me helped just this

server {
    listen 443 ssl http2 default_server;
    ...
    location / {
         ...
         proxy_request_buffering off;
         ...
    }
}

Solution 15 - Git

To me this is 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

However my issue was slighty different, with a "packages already packed" info with the RPC::HTTP/2 stream not closed cleanly message

Solution 16 - Git

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.

Solution 17 - Git

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

Solution 18 - Git

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!

Solution 19 - Git

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.

Solution 20 - Git

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

Solution 21 - Git

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

Solution 22 - Git

I have tried most of the answers but it still not work for me. It turns out that I have some file that > 100 MB. So I removed those file and it works.

Solution 23 - Git

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.

Solution 24 - Git

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

Solution 25 - Git

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

Solution 26 - Git

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

Solution 27 - Git

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

Solution 28 - Git

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

Solution 29 - Git

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

Solution 30 - Git

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

Solution 31 - Git

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

Solution 32 - Git

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

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionSungsoo KwonView Question on Stackoverflow
Solution 1 - GitcatalinaView Answer on Stackoverflow
Solution 2 - GitAbhishek SharmaView Answer on Stackoverflow
Solution 3 - GitXysView Answer on Stackoverflow
Solution 4 - GitPrashant GaikwadView Answer on Stackoverflow
Solution 5 - GitAnil GodawatView Answer on Stackoverflow
Solution 6 - GitKamau MbûguaView Answer on Stackoverflow
Solution 7 - GitShehan JayalathView Answer on Stackoverflow
Solution 8 - GitAbhijeet SrivastavaView Answer on Stackoverflow
Solution 9 - GitDeepakView Answer on Stackoverflow
Solution 10 - Gitbk2204View Answer on Stackoverflow
Solution 11 - GitmadpoetView Answer on Stackoverflow
Solution 12 - GitRatul RamchandaniView Answer on Stackoverflow
Solution 13 - GitTillmann DavidView Answer on Stackoverflow
Solution 14 - GitMax Kaps 4bis.nlView Answer on Stackoverflow
Solution 15 - GitRicardo LourençoView Answer on Stackoverflow
Solution 16 - GitZYinMDView Answer on Stackoverflow
Solution 17 - GitDarkView Answer on Stackoverflow
Solution 18 - GitMadhawa MonarawilaView Answer on Stackoverflow
Solution 19 - GitDale RyanView Answer on Stackoverflow
Solution 20 - GitTom WrankmoreView Answer on Stackoverflow
Solution 21 - GitDálcio Macuete GarciaView Answer on Stackoverflow
Solution 22 - GitMinh Quang NguyenView Answer on Stackoverflow
Solution 23 - GitMrThunderView Answer on Stackoverflow
Solution 24 - GitDingaan LetjaneView Answer on Stackoverflow
Solution 25 - GitEdylson FredericoView Answer on Stackoverflow
Solution 26 - GitjuhikushwahView Answer on Stackoverflow
Solution 27 - GitbljubisicView Answer on Stackoverflow
Solution 28 - GitJeppePeppView Answer on Stackoverflow
Solution 29 - GitDidier.vueView Answer on Stackoverflow
Solution 30 - GitRitik KambojView Answer on Stackoverflow
Solution 31 - GitYour DadView Answer on Stackoverflow
Solution 32 - GitDor IndivoView Answer on Stackoverflow