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

"error decoding response body" after upgrading to 0.12.10 #2507

Closed
NobodyXu opened this issue Dec 27, 2024 · 8 comments · Fixed by #2508
Closed

"error decoding response body" after upgrading to 0.12.10 #2507

NobodyXu opened this issue Dec 27, 2024 · 8 comments · Fixed by #2508

Comments

@NobodyXu
Copy link
Contributor

NobodyXu commented Dec 27, 2024

https://github.com/cargo-bins/cargo-binstall/actions/runs/12511426634/job/34903489849#step:5:1

ERROR Fatal error:

  × For crate b3sum: Reqwest error: error decoding response body
  ├─▶ Reqwest error: error decoding response body
  ├─▶ error decoding response body
  ╰─▶ there are extra bytes after body has been decompressed
@rjzak
Copy link

rjzak commented Dec 27, 2024

I think I have a similar situation https://github.com/malwaredb/malwaredb-rs/actions/runs/12510436402/job/34905296392?pr=620: 1: there are extra bytes after body has been decompressed

@NOBLES5E
Copy link

It's strange that such a seemingly simple scenario can trigger this "error decoding response body" and that it wasn't caught by the CI tests.

@seanmonstar
Copy link
Owner

I'll revert and release today.

It'd be nice to understand why the bodies have extra bytes, because this didn't "slip" through CI, the error was designed on purpose. After putting the body in a decompressor and it claims the body is done, reqwest purposefully polls the inner body once to consume the end of a chunked 0\r\n\r\n. If extra bytes are found instead, we assume that's bad. Before this release, that data was just lost. Why are there extra bytes? Are there legitimate uses that should purposely be ignored?

@NobodyXu
Copy link
Contributor Author

Based on debug logging from cargo-bins/cargo-binstall#2004, the issue happens when downloading from https://index.crates.io/3/b/bat

@seanmonstar
Copy link
Owner

OK, I think I've found the issue. It was working fine with HTTP/1, but if I connect with HTTP/2, the server sends an extra empty data frame. I'll have a release up that ignores those frames if they are empty.

@seanmonstar
Copy link
Owner

PR #2508 up with a fix (in case you want to try it before I publish).

@Ten0

This comment was marked as resolved.

@seanmonstar
Copy link
Owner

v0.12.11 is published with the fix. Sorry for the inconvenience.

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

Successfully merging a pull request may close this issue.

5 participants