#SSR on CloudFlare Pages sometimes throwing "Error 1101: The script will never generate a response"

19 messages · Page 1 of 1 (latest)

molten ice
#

I have an Astro 2.1.7 project deployed to CloudFlare Pages with SSR enabled. This seems to be working just fine. For a CMS I'm using Storyblok hence the SSR in the deployment so my content editor can see their changes update every time they hit "save". However, as they edit content, hitting save a number of times and switching pages in the visual editor in Storyblok, they eventually get an error.

CloudFlare reports "Error 1101" which is a 500 error from the web worker that's doing the SSR. When I investigated the logs, it said "The script will never generate a response".

Based on my research, this can happen when a promise isn't fully resolved in the function. Could this be an issue with Storyblok not responding quickly enough in an API request? The web worker CPU limit is just 10ms https://developers.cloudflare.com/workers/platform/limits/#worker-limits

zenith terrace
#

idk about storyblok but the workers 10ms limit is the cpu usage limit, not the wall clock limit

#

it could sit idle waiting for a fetch response without bumping closer to 10ms

molten ice
#

Yeah, that's what I figured.

molten ice
#

I'm wondering if there's some way to debug this further.

zenith terrace
#

maybe try it on miniflare

molten ice
#

Ah I had no idea this existed. However, this is Astro's own SSR function, not mine.

river granite
#

@molten ice did you get anywhere with this? I'm also experiencing the same issue

molten ice
#

Basically, it seems like a Storyblok issue

molten ice
zenith terrace
#

storyblok may be able to do something about this, but really it is a limitation of cloudflare's infrastructure, isnt it

#

as explained by the cloudflare engineer in the hacker news threads

#

multiple requests may share the same worker instance, and its global state

#

but if some code attempts to read write shared global state, the runtime does not handle it well

deft bear
#

Great thread, thanks all. Bummer that it's an issue with Storyblok not playing nice with Cloudflare, until now I was assuming upgrading to Paid Workers would resolve 🙃

molten ice
zenith terrace
#

by whose code?