-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
sometimes caddy closes connection to client prematurely #3557
Comments
Thanks for the report. First, can you please upgrade to Caddy 2? Caddy 1 is no longer being developed. Then, can you please try to reproduce the problem without any custom modules/plugins -- this is crucial so that we can reproduce it reliably if we are to fix any bug. Thanks! I'll reply with an issue template if we still need more information. |
|
Yep, in our documentation just click "reverse proxy": https://caddyserver.com/docs/quick-starts/reverse-proxy
Reduce the reproducible case down as minimal as possible. Start stripping things from the config and the build until the problem no longer occurs. If it can't be easily reproduced, then the best bet is for you to troubleshoot it yourself and submit a patch if there's a bug (along with documentation explaining the problem). |
I have created a server and a client to reproduce the bug. The attached archive contains a Java maven project together with a README file with detailed instructions on how to set up, build and run the bug reproduction scenario. What I tested with was caddy 2.1.1, which I believe is the latest release. |
Hi @mholt can you confirm the error/bug? What are the next steps? Thx. Andy Krieger [email protected], Daimler AG on behalf of Daimler TSS GmbH. |
Sorry, I've been focused on finishing the upgrades to the website, and got behind on issues and PRs. I'll circle back to this as soon as I can. Although, it might take a while, as there's quite a high barrier to reproducing the bug. It'll take me about a day to download and set up a VM with Java, etc, and that doesn't even include looking at the code and analyzing what is going on, which will take even more time. The repro instructions seem great, it's just... a lot of extra work. I suspect this will take me a few working days to make any sense of it. It's a lot of time to budget (voluntarily). I think the fastest path right now since you are already set up to reproduce the issue is to start looking into the code and determine why what you're experiencing may be happening. |
I've run your project and was able to reproduce it consistently with this: java -jar target/caddybug-0.0.1-SNAPSHOT-single.jar \
--lines=100 \
--size=100 \
--duration=100 \
"http://localohost:2080/random?lines=10&size=40000&duration=1000" It seems to be consistent when one end has shorter duration than the other. My hunch is, since there's simultaneous two-way copying, so if one side finishes, they'll try to close the connection. I'm attaching the pcaps from Wireshark of the 2 sessions when I run the reproduction code. two-sided-reproduction.pcapng.zip I wonder if golang/go#15527 or golang/go#22209 are related. |
I also encountered a similar problem. |
Quite likely this could be related to a bug upstream (based on what I've read around other issues in other repos): golang/go#40747 |
There's new information about this as per golang/go#40747 (comment) |
This can probably be resolved by enabling full-duplex as of v2.7.0. |
$caddy --version:
Caddy v1.0.3
Possibly related to #1710
Caddy is used as a proxy, with some custom modules thrown in to handle a custom authentication mechanism.
What we see:
The consequence is that the client never gets the full response.
I can't easily provide the actual tcp dumps, since they're filled with information not meant for public visibility. I'll try to reproduce the bug using a synthetic test application. But in repeated captures reproducing the error, the RST from the backend app to caddy is frequently followed in the dump immediately by the RST sent by caddy to the client, with no packets captured in between. When there are packets between them, they're more often than not various unrelated ACKs.
The text was updated successfully, but these errors were encountered: