Closed nicetomytyuk closed 5 months ago
Thanks for reporting!
Locally running Supabase will almost always return faster responses as it is on the same machine; this would be expected behaviour. Adding network hops will increase latency.
Just to clarify: this error is happening in your local environment deployed by docker? or when the function is deployed to Supabase?
Hi @encima,
The response is faster when I'm testing the functions locally by pointing the supabase instance to my remote self-hosted solution, so the functions are run with Deno locally.
When the same function is deployed to the remote server, it is slowed and often returns the InvalidWorkerResponse when the function is request.
So to clarify: this error is happening when the functions are deployed to self-hosted supabase on a remote server, when the functions are run by Deno locally there are no issues.
After further investigations, the issue seems to be related to edge-runtime:v1.29.1 and resolved in 1.31.0 by this PR request.
So I would suggest to change the edge-runtime version in docker-compose.yml to 1.31.0, I can open a PR for it.
@nicetomytyuk thank you for the extra clarification!
That does indeed look related, can you confirm 1.31.0 resolves this and close if it does? If it does not, I will triage to the functions team. 🙏
@encima I'd do some further tests before confirming that the 1.31.0 resolves the issue, I'd let you know as soon as possible.
@nicetomytyuk No rush at all, you testing saves me testing so I am grateful for that!
@encima I've did some more tests and after further investigation with @nyannyacha I've been able to resolve the issue by unlocking the CPU limit, so the PR to be highlited here is the PR-241 on edge-runtime.
I've created a PR that changes the edge-runtime version to v1.31.0 in docker-compose.yml
and add some explanation on how to unlock the CPU limits in it.
So I can confirm that the edge-runtime:v1.31.0
does fix that issue.
Hi everyone, I'm going to close this one but if you still have an issue with this please feel free to re open.
Bug report
Describe the bug
When I try to make some calls to edge functions in a self hosted environment, usually it returns an error with status code 500 like this:
The docker-compose file is update to the latest one in the repository.
To Reproduce
Create a self hosted environment using Docker, then try to create some functions in it and call it by using any of the official SDKs (I'm using JavaScript SDK in my case).
Here is a code snipper of one of the functions that usually returns the linked error:
Expected behavior
I'd expect the function to work without throwing the InvalidWorkerResponse error.
Screenshots
System information
Additional context
When the function is run locally by using deno, it does not return the InvalidWorkerResponse and it's responses are even more faster than when the function is published to supabase.
For example, locally one of the functions was fetching data in less than 300ms, once publish to supabase, sometimes it returns InvalidWorkerResponse or the data if fetched in >=1s (first time calls).