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
stream xxx canceled by remote with error code 268 #5766
Comments
You should be able to reproduce this with a reverse proxy to a public librespeed instance like https://librespeed.org/ |
The only other time I've heard of this error is here: https://caddy.community/t/error-stream-292-canceled-with-error-code-268/18847/6 Can you provide a minimally-reproducible config? Ideally, self-contained (i.e. use If it's not reproducible that way, it's likely a bug in some other part of the network or one of the other applications involved (client, backend, etc). |
Example config:
Open the page via Firefox and hit the Start button. I suspect that the error is triggered by the client aborting the request while the response is still being transferred. |
I wonder if this is an HTTP/3 error code. https://www.iana.org/assignments/http3-parameters/http3-parameters.xhtml |
Interesting. Traefik seems to also be affected: traefik/traefik#8927 As caddy and traefik are both using quic-go, the HTTP/3 theory sounds plausible. |
Pretty sure this is an HTTP/3 error. Request cancelations are nothing unexpected, but it seems like the error return value is less than ideal... this should have been immediately obvious. Do you guys agree that this is not indicative of a bug, and the only action we should take is improve the error type / message? The problem here is the split between the I'd appreciate feedback on the error API. What do you think of the following: Any package http3
type Error struct {
Remote bool // assuming there are no cases where we'd return a local error, we might be able to remove this field
ErrorCode ErrorCode
ErrorMessage string // always empty for stream resets, might be set if the connection is closed
} The string representation of the error would then contain the name of the error (e.g. H3_REQUEST_CANCELLED for error 268). |
Yep! Stream cancellations are usually not a problem -- in the past we've tried to sequestered them to debug-level logs when possible.
Would there be a way to use types to know this kind of error? For example Thanks for helping with this! |
For With the proposal from #5766 (comment), you'd do the error assertion like this: var http3Err *http3.Error
if errors.As(err, &http3Err) {
if http3Err.ErrorCode == http3.ErrCodeRequestCanceled {
// request cancelled
}
} Any preferences? |
Ah, that works for me then! I like the error code approach. (I guess that's the point of an error code.) |
Great! Implementation is here: quic-go/quic-go#4039. Planned for the v0.39 release. |
That was quic, thank you! |
@mholt v0.39 is available with the fix |
I will update it shortly :) Thanks! (Been busy on a new Caddy website/docs.) |
Is this resolved with the update of quic-go in 88b4fbf or does this need some additional adjustments in the logging logic? |
We haven't made any changes to the error handling as per #5766 (comment) yet. PRs welcome, if you'd like to take a shot at it |
I often receive the following error in my caddy logs while doing speed tests with librespeed:
The mixture of HTTP/3 and librespeed canceling the requests seems to trigger this (bogus?) error.
The text was updated successfully, but these errors were encountered: