supabase / cli

Supabase CLI. Manage postgres migrations, run Supabase locally, deploy edge functions. Postgres backups. Generating types from your database schema.
https://supabase.com/docs/reference/cli/about
MIT License
1.04k stars 202 forks source link

Error status 502: An invalid response was received from the upstream server on supabase start with blank project #2753

Open NicoCaldo opened 1 day ago

NicoCaldo commented 1 day ago

Bug report

Describe the bug

I have correctly installed the latest version of the Supabase CLI and set up a new project with supabase init. I then have created a new supabase edge function with the supabase functions new . Then, I launched the local setup with supabase start.

All the image are correctly downloaded and the containers launched (all that one) but at the very end when the command is performing the healthcheck, everything kind of crash and appears the error

...
2024/10/09 19:42:24 Recv First Byte
2024/10/09 19:42:25 Sent Header: Host [api.moby.localhost]
2024/10/09 19:42:25 Sent Header: User-Agent [Docker-Client/unknown-version (linux)]
2024/10/09 19:42:25 Send Done
2024/10/09 19:42:25 Recv First Byte
2024/10/09 19:42:26 Sent Header: Host [api.moby.localhost]
2024/10/09 19:42:26 Sent Header: User-Agent [Docker-Client/unknown-version (linux)]
2024/10/09 19:42:26 Send Done
2024/10/09 19:42:26 Recv First Byte
2024/10/09 19:42:27 Sent Header: Host [api.moby.localhost]
2024/10/09 19:42:27 Sent Header: User-Agent [Docker-Client/unknown-version (linux)]
2024/10/09 19:42:27 Send Done
2024/10/09 19:42:27 Recv First Byte
2024/10/09 19:42:28 Sent Header: Host [api.moby.localhost]
2024/10/09 19:42:28 Sent Header: User-Agent [Docker-Client/unknown-version (linux)]
2024/10/09 19:42:28 Send Done
2024/10/09 19:42:28 Recv First Byte
2024/10/09 19:42:28 Connect Start: tcp 127.0.0.1:54321
2024/10/09 19:42:28 Connect Done: tcp 127.0.0.1:54321
2024/10/09 19:42:28 Sent Header: Host [127.0.0.1:54321]
2024/10/09 19:42:28 Sent Header: User-Agent [SupabaseCLI/1.203.0]
2024/10/09 19:42:28 Sent Header: Authorization [Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3M<more chars>0YpN81IU]
2024/10/09 19:42:28 Sent Header: Accept-Encoding [gzip]
2024/10/09 19:42:28 Send Done
2024/10/09 19:42:28 Recv First Byte
Stopping containers...
Pruned containers: [48140ad3aedf28e4b805ef53726391f7845852074e9071e33704bc72ba7e8113 576776629a4791004812be070bc57a2925d0aea11910fb172f21f99e5c0d7e82 71f4256bd86a189f080870b96a1ba2fd55de98eeeb18ea7dd88b43790c7c589f 04df85256addf17050109168d06a47efacfc517af6df83bf4393f26326151242 4d54c7b8e723db4f801f288f2abc9da87fd222a346a001d502d7b5578523d549 59dd3fbe7a3b486513a540fd5f31fc1b65795ae5f99c44760efd3f20f633ba45 7b2dad8e1ca8fed05716eca84d26e5d6e7e2510bfdef660192e1edbecbff42bf 8f375c7b58d23a29d634212c30c7cc26b278786a79a453b5d8f1cbb029ecd769 046e6ed0bf3f85e3c409b638b657412fd866ddbef9b6f22cea68518faa9a83c6 d22e0ff147bfd3bb316733ecc239b4b2ca922ac134c041ee5c0108ac9663e4eb c9aed2ed6e087d2d9ca0af0ee273fc3c1ebd331acb82468e6d8858b50ed794a9 af80dae956ac6eeb03223934081877369c9945176f3cc70369a64bb3b95eeecd 151a240345f8e5ff93e4ce8859250d9ff39cdf1c85a37cfdfc35ea010f98af5f]
Pruned volumes: [supabase_db_content-bridge-backend supabase_config_content-bridge-backend supabase_inbucket_content-bridge-backend supabase_storage_content-bridge-backend supabase_edge_runtime_content-bridge-backend]
Pruned network: [supabase_network_content-bridge-backend]
Error status 502: An invalid response was received from the upstream server

To Reproduce

Create a clean installation with

supabase init
supabase functions new my-function
supabase start

Expected behavior

The local deployment starts running

Screenshots

System information

Ubuntu 24.04.1 LTS 6.8.0-45-generic on a VirtualBox VM machine. I have tried both with network card bridged or NAT on the guest but same issue

Additional context

NicoCaldo commented 1 day ago

Spinned up another VM with the same setup on a different hosting machine (always on Virtualbox) and having the same issue


Status: Downloaded newer image for public.ecr.aws/supabase/postgres-meta:v0.83.2
20240930-16f2b8e: Pulling from supabase/studio
302e3ee49805: Already exists 
12d91d8d3f33: Pull complete 
3c47054f1b46: Pull complete 
357b88b87995: Pull complete 
06a1fd3314fb: Pull complete 
a8370f63df63: Pull complete 
2509fed50a78: Pull complete 
91effe94910a: Pull complete 
e48c03195175: Pull complete 
564d10fcb534: Pull complete 
Digest: sha256:b51d384a7b5da34e2011ab314aef53cf8f06ceaa009af4a6e21079c21d3493dc
Status: Downloaded newer image for public.ecr.aws/supabase/studio:20240930-16f2b8e
Stopping containers...
Error status 502: An invalid response was received from the upstream server

Running again the supabase start I have

No seed files matched pattern: supabase/seed.sql
Seeding globals from roles.sql...
Stopping containers...
Error status 502: An invalid response was received from the upstream server
red2678 commented 23 hours ago

+1 here. Rolling back to CLI v1.192.5 fixes both issues. I would also note that when I went to 1.204.3, I could not start Supabase either. Sorry, I did not save the error.

sweatybridge commented 21 hours ago

@nyannyacha could this be related to edge runtime update? https://github.com/supabase/cli/pull/2733

nyannyacha commented 20 hours ago

I believe there are no changes in edge runtime v1.58.12 other than the ability to use an mjs extension as an entry point for functions.

I tried to reproduce the problem using the develop branch of the supabase/cli by typing the commands in the description, but the edge runtime container returned a normal response.

Note that my attempt was on OrbStack, where no special network config exists for the guest vm.