Skip to content

FunctionsFetchError: Failed to send a request to the Edge Function - effecting 1% of invocations #263

Open
@williamlmao

Description

@williamlmao

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:

  1. 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.
  2. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: something isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions