Worker subrequest fetch 90 sec timeout

For Workers & Pages, what is the name of the domain?

workers

What is the error message?

There’s also no real error message saying a timeout. The Worker logs just says “error” but no error number or message.

What is the issue or error you’re encountering

Subrequest fetch timeout after 90 seconds, not mentioned in docs

What are the steps to reproduce the issue?

Made a fetch to a URL that is not behind Cloudflare and after about 90 seconds waiting for the server to respond it was timed out. Running the same URL in a browser works fine in Chrome.

If the 90 second timeout is expected then this seems like a documentation issue:
https://developers.cloudflare.com/workers/platform/limits/
How long can a subrequest take?
There is no set limit on the amount of real time a Worker may use. As long as the client which sent a request remains connected, the Worker may continue processing, making subrequests, and setting timeouts on behalf of that request.

1 Like

As far as I try in the Wrangler (remote) environment, I get the following error in about 60 seconds. This seems to be the same in the Workers environment.
I am particularly troubled because the time-consuming OpenAI API times out and is unavailable.
Is there any way to change the timeout time?

[wrangler:inf] POST / 504 Gateway Time-out (60085ms)