error: RPC failed; curl 92 HTTP/2 stream 0 was not

2020-08-13 08:09发布

问题:

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.

回答1:

You can force git using http version 1.1

git config --global http.version HTTP/1.1

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



回答2:

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



回答3:

XCode 11.4.1

Increasing the git buffer size worked for me

git config --global http.postBuffer 524288000


回答4:

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.



回答5:

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;


回答6:

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



回答7:

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


标签: git push