-
-
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
context canceled and 502 #1925
Comments
Btw this is reproducible every time. |
I think this is related to #1828 and https://caddy.community/t/error-context-canceled/2034 The request goes through to the backend, but the user gets a |
This can also be forced upon caddy via browser requests. Imagine a backend serving this simple php at localhost:8081 : <?php
sleep(10);
phpinfo();
?> And a simple Caddyfile like this:
In my case I'm currently using a Caddy Version: 0.10.11 (and build from git 5552dcb). |
Is this still an issue in 0.10.14? |
@tobya Just tested it and unfortunately yes, it is still present.
|
I'm having the same issue with Caddy 0.11.0. |
Having this issue too on 0.11.0 How can I solve or at least work around it? |
We stumbled upon this bug as well. Are there any plans to fix it? It has a devastating potential as it can be exploited for a DDoS attack... |
Do explain... |
@mholt: It is enough that one evil client will repeatly make request and immediately close connection and caddy will stop proxing for defined fail_timeout time. Even if you set max_fails higher than 1, only one client could easily do cancel that many requests in row. so it is not even DDoS, but more severe DoS attack. |
Hmm, I see. Well, you could for now use fail_timeout of 0 if you're worried about attacks like that; but better would be to have this fixed. I don't have the time right now to do it, but I welcome pull requests, and help reviewing them to get them merged. |
Setting fail_timeout to 0 will make load balancing proxy useless (it will forward requests to truely failed nodes, all the time), so it is not really option. |
I understand that. Feel free to open a pull request for quicker resolution! |
I suggest tagging this issue as "Bug". Was original issue fixed by #2297? |
Good point; yes, we seem to handle the context cancelled error specially now, so that it does not consider the backend to be down. I believe this is fixed. |
I've been running into issues with Caddy 0.11.5 constantly stopping, and noticed a lot of these in my log files:
After a bunch of trial and error with the way I call PHP in my caddyfile it just keeps happening no matter how I call it, or what environment vars I use, which led me to stumbling upon this post. I tested with @ionphractal 's instructions and it seems to still be happening in this version of Caddy.
|
1. What version of Caddy are you using (
caddy -version
)?0.10.10
2. What are you trying to do?
Proxy an express app.
Seems like caddy responds with 502 and complains when I write the request and close the socket for writing. I'm still available for reading, so caddy should send me the proper response.
Note that request gets proxied just fine (I can see in webapp's logs). If I enter request in
nc
manually without closing the stdin then I get the right response.3. What is your entire Caddyfile?
4. How did you run Caddy (give the full command and describe the execution environment)?
Docker,
abiosoft/caddy
image.5. Please paste any relevant HTTP request(s) here.
6. What did you expect to see?
A proper JSON response.
7. What did you see instead (give full error messages and/or log)?
The text was updated successfully, but these errors were encountered: