Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"http2 error: protocol error: unexpected internal error encountered" on some websites #1222

Open
Shnatsel opened this issue Mar 22, 2021 · 4 comments

Comments

@Shnatsel
Copy link

On some websites, e.g. http://contdict.com, reqwest fails with the following error:

http2 error: protocol error: unexpected internal error encountered

Firefox and curl work fine.

23 websites out of the top million from Feb 3 Tranco list are affected.

Tested using this code. Test tool output for all occurrences: reqwest-http2-unexpected-internal-error.gz

@seanmonstar
Copy link
Owner

Returning an INTERNAL_ERROR indicates to me that the server hit some internal bug. That it doesn't happen in Firefox could be that the order of frames, or settings, or headers, or who knows what else doesn't trigger it there, but it's hard to know what we could do to fix it.

@coding-yogi
Copy link

I am building a load testing tool and using reqwest as the http client library. After switching to rust-tls from native-tls I started seeing this error quite often , there is no http2 involved here, so not sure why it says http2 error
error sending request for url (https://postman-echo.com/get): http2 error: protocol error: not a result of an error

client is being shared around 100 async tasks

@JekRock
Copy link

JekRock commented Dec 28, 2021

I'm getting the same error for any site when using rustls-tls.
No error for the same code when using either native-tls or default-tls

@JekRock
Copy link

JekRock commented Dec 28, 2021

Just figured out that all the sites that I tested force HTTP/2.
Using http1_only() results in request has unsupported HTTP version.

I'm using the latest version available with blocking requests.
reqwest = { version = "0.11.8", default-features = false, features = ["json", "rustls-tls", "blocking"] }

Any ideas why HTTP/2 requests don't work on rustls-tls?

UPD: the issue was in my code. If I set a body (json) for a GET request, the http2 error: protocol error: unexpected internal error encountered error occurs.
Basically, curl does the same

curl: (92) HTTP/2 stream 0 was not closed cleanly: INTERNAL_ERROR (err 2)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants