dioxus icon indicating copy to clipboard operation
dioxus copied to clipboard

Weird error in production "FailedToBufferBody(UnknownBodyError)" in magic.rs

Open patrik-cihal opened this issue 1 month ago • 3 comments

Problem

This keeps popping up in logs of my production fullstack server. Not sure what it breaks yet.


 2025-11-22T21:41:27.176 app[48e73d4f777d18] fra [info] thread '<unnamed>' (658) panicked at /usr/local/cargo/registry/src/index.crates.io-1949cf8c6b5b557f/dioxus-fullstack-0.7.1/src/magic.rs:542:69:

2025-11-22T21:41:27.176 app[48e73d4f777d18] fra [info] called `Result::unwrap()` on an `Err` value: FailedToBufferBody(UnknownBodyError(UnknownBodyError(Error { inner: hyper::Error(Body, Custom { kind: UnexpectedEof, error: IncompleteBody }) }))) 

Steps To Reproduce

No idea.

Expected behavior

No random errors.

Screenshots

Image

Environment:

  • Dioxus version: 0.7.1
  • App platform: fullstack web

Questionnaire

patrik-cihal avatar Nov 23 '25 09:11 patrik-cihal

@patrik-cihal Can you give us an idea to what your page and component structure are like? Also do you only see these logs in production or do you also see them while developing? If you have tracing on requests to print the path for the request that'll also help you figure out what type of body your app is responding with.

binarypie avatar Dec 04 '25 20:12 binarypie

I think the fix here is to just bubble up those errors with ? instead of unwrapping them. Some errors with incorrect requests are expected, but we shouldn't panic if that happens

ealmloff avatar Dec 04 '25 21:12 ealmloff

@binarypie No, these errors are relative rare, 1 per 500 requests or so and I see them only in production logs. I agree that the solution here is probably to just not unwrap.

patrik-cihal avatar Dec 05 '25 10:12 patrik-cihal