-
Notifications
You must be signed in to change notification settings - Fork 291
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
🐛 BUG: Worker <-> Worker request over custom_domain
returns instant 522 timeout response
#787
Comments
Hey! It doesn't look like you're using service bindings to communicate between the two Workers. A fetch request between two Workers on the same zone is expected to fail without service bindings. Service binding documentation: https://developers.cloudflare.com/workers/platform/bindings/about-service-bindings/ |
I don't think this is accurate. Same zone worker to worker communication should work either through service bindings or through custom domain triggers. See the blog post linked above: https://blog.cloudflare.com/custom-domains-for-workers/ I am aware that same zone worker to worker communication is not possible when route trigger is used. From https://developers.cloudflare.com/workers/platform/triggers/custom-domains/:
Either the code should be fixed or the docs. They are incompatible |
Any update on this? We can't fall back on a workers dev zone as well, and have configured both the workers with custom domains as per documentation! |
Hmm, you're right. We'll look into this and get back to you. I'm curious what's preventing you from using service bindings? |
Service bindings are cost effective since all downstream calls happen in the same thread however they don't allow parallelism. |
Also we want to aim for "smart placements" when it's ready and I doubt service bindings can support that since some people may be relying on the single thread guarantee already. |
@KimlikDAO-bot as an update, we originally thought this might be an internal issue but have found that the problem doesn't surface when everything is done through the dashboard, so this does appear to be a bug in wrangler. we're continuing to investigate 👍 |
We've looked into this a bit more, and it looks like it's an internal bug. We're working on finding the root cause, but in the meantime, a workaround is to set your compatibility date to before |
A more ergonomic solution might be just to specifically remove the # https://github.com/cloudflare/workerd/issues/787
compatibility_flags = ["no_minimal_subrequests"] |
I think a bug related to this are quests from worker to an api that's using the same subdomain. My scenario was: Adding the |
Hey any update on this, I deployed my workers via terraform and also getting 522 when calling from a.domain.com -> b.domain.com |
No update right now, unfortunately—we're tracking this internally though, and will update here when there's a resolution. For now, @KianNH's workaround should be a reasonable stopgap: # https://github.com/cloudflare/workerd/issues/787
compatibility_flags = ["no_minimal_subrequests"] |
Moving to the |
got the same issue now. |
@penalosa this is actually not a runtime issue either, it is a Cloudflare stack issue outside of the workers runtime, so routing it to workerd unfortunately doesn't send it to the right people. Perhaps we need to create a new github project for these kinds of issues and make sure the right people are watching it. |
Just to follow up on this, I can't use service bindings because I need the proxy fetch (to call itself) to go through the Cloudflare request flow to convert a clientID and clientSecret to a JWT - which doesn't happen when using service bindings. |
Last update Jul, 13th. Where is the proper place to track progress on this important issue? Cross-referencing community thread: |
This should be fixed now—I can no longer reproduce the original issue. @KimlikDAO-bot could you confirm you're no longer seeing this behaviour? |
This is still happening for me. If it matters, my request is to the worker that is making the request (the worker requests itself) for the purpose of reading a set of static markdown files in the |
I still have this problem, my worker is being proxied to a subdomain of my site and the worker itself is okay, but the subdomain is not, it returns an error 522. I tried setting the compatilibility date and flag, to no avail. Any updates on this? |
Resolved: https://developers.cloudflare.com/workers/configuration/routing/routes/ |
Which Cloudflare product(s) does this pertain to?
Workers/Other
What version of
Wrangler
are you using?2.9.0
What operating system are you using?
Mac
Describe the Bug
Same zone worker <-> worker requests through custom domains returns an immediate 522 timeout http response.
Custom domains were introduced (partly?) to solve same zone worker <-> worker requests: https://blog.cloudflare.com/custom-domains-for-workers/
However, at least on some POPs the request immediately returns with a 522 response. To reproduce create the workers
Deploy them (wrangle 2.9.0) with the following configs:
One needs to replace example.com with a domain the CF account controls. Then
For a deployed example
Account: 8f0c2f2271ff857947d9a5b2c38595a0
Zone: 97fd67b98d0cc2080e9d13be10b3bca0
The text was updated successfully, but these errors were encountered: