edge-runtime: FunctionsFetchError: Failed to send a request to the Edge Function - effecting 1% of invocations
Bug report
- [Uncertain] I confirm this is a bug with Supabase, not with my own application.
- [x - threads I found on this same error did not help] I confirm I have searched the Docs, GitHub Discussions, and Discord.
Describe the bug
We are getting intermittent “Failed to send a request to the Edge Function” errors. This bug is quite hard to reproduce. I have never been able to reproduce it locally, and 98.5% of function invocations go through just fine. For context, we’ve seen this error 1.3k times out of 72,474 invocations. I’ve had users report that they are getting this error, but then when they retry it goes through fine the next time.
My big questions are:
- Is it normal to see this error intermittently in supabase edge runtime? Is this just a fact of life, is this a bug, or is something wrong on our end? It’s very hard to tell from my end.
- If it’s likely that something is wrong on our end, I’d love any suggestions of how to debug. The request body we send for this function is very simple (just a couple IDs and a text input) so there is not much variability. Having a hard time identifying a pattern especially since the error is not very descriptive.
The stack trace we see in sentry is this:
// 2. client-level headers
// 3. default Content-Type header
headers: Object.assign(Object.assign(Object.assign({}, _headers), this.headers), headers),
body,
}).catch((fetchError) => {
throw new FunctionsFetchError(fetchError);
});
const isRelayError = response.headers.get('x-relay-error');
if (isRelayError && isRelayError === 'true') {
throw new FunctionsRelayError(response);
}
To Reproduce
I can’t even reproduce this locally, so I can’t provide reproduction steps.
Additional Context
We are running supabase CLI 1.142.1 and "@supabase/supabase-js": "2.39.1",
Please let me know if there’s anything else I can provide that would be helpful.
About this issue
- Original URL
- State: open
- Created 3 years ago
- Reactions: 3
- Comments: 20 (6 by maintainers)
@laktek, thanks for your response.
The biggest issue here is that the error codes don’t give any information on which one of the options you listed was the reason for the error.
From our perspective
We already have retries and error handling built into our site, but that doesn’t fix the problem, and it doesn’t seem like there is a path forward on my end to solve the problem.
I hope you can find how incredible frustrating this is on our end. We really love supabase, and would really love to stay on supabase edge functions, but I’m starting to think we have to move off unless you are able to indicate to us that this is something that you can solve within the next month or so.