-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
handler wrote more than declared Content-Length #6716
Comments
Thanks for the report. Wow a 18k line config! I'll look at this soon. I appreciate the full details like the logs and config, but due to their size it may take some time. If you can figure out a minimally reproducible case that would make a fix arrive quite speedily. |
The config may look big, but most of the size is from MIME mappings (would not mind to have an alternative way). There are comments there, so you should be able to strip away unnecessary stuff. Log is a debug one + access log, I enabled it this way specifically to capture the errors an everything around them, so you probably need to focus on what's around "more than declared" messages. Unfortunately, I do not know conditions under which this happens. I just found them in my production log, tried to see if I can link them to something based on what I can get in debug log, but... I do not see anything obvious, besides the stream being closed after those messages, but that may be unrelated. Perhaps logging can be improved, so that we can link these kinds of errors to specific requests? Like... Request ID in logs or something similar? |
I would start fiddling with "encode" handlers (see if removing them resolves the error, etc) -- and also verify that the proxied backends (PHP pages?) aren't sending more than they declare too. |
question is - what pages? I tested those that around the errors - no issues. Of course they may be edge-cases, and I need some special conditions to trigger the errors, but I would still need to know where to put some extra logging. Generally, they seem to not be sending more than declared, though. |
I am getting periodic errors like
in my logs. Tried to debug what's happening, and do not see anything obvious. Attaching debug log (zipped since it's quite big) caddy_bck.zip. It has 2 instances of this error. My best guess would be that it's actually a false-positive, since in both cases there is a
failed to copy the response body: http2: stream closed
message right after, although not sure if that would even make sense. Definitely not related to specific pages (or types of those), at least not able to replicate this on test, just happens on PROD.My understanding is that it's not normal, possibly a bug somewhere, but unsure how to catch it exactly. I know there was #38, and I am also using Brotli, Zstd, so maybe something wrong with any of those in similar manner? I am launching FrankenPHP in Docker with this config.Caddy config is here (note it's JSON5, not JSON).
The text was updated successfully, but these errors were encountered: