cli icon indicating copy to clipboard operation
cli copied to clipboard

Error: [500] An error has occured: Failed to fetch

Open Mohsen7s opened this issue 3 years ago • 0 comments

Bug report

Describe the bug

Im getting error when I visit api url right after inited git & supabase.

Output

         API URL: http://localhost:54321
          DB URL: postgresql://postgres:postgres@localhost:54322/postgres
      Studio URL: http://localhost:54323
    Inbucket URL: http://localhost:54324
        anon key: longkey
service_role key: longkey

To Reproduce

git init supabase init supabase start visiting http://localhost:54323/project/default/api Getting Error: [500] An error has occured: Failed to fetch

Expected behavior

I should be able to visit url without any error.

System information

  • OS: [Windows]
  • Browser chrome
  • Version of supabase 0.18.1
  • Version of Node.js: v6.9.2

Additional context

When I open chrome dev tools I see the requests are made to port 8000 which fails. I tried to manually open the requests in another tab with all supabase container ports from 54321 to 54325. Looks like its a bad mapping of port 54321 which kongs uses. Here is the logs for my kong container.

2022/03/13 19:16:39 [warn] 28#0: *5 [lua] globalpatches.lua:55: sleep(): executing a blocking 'sleep' (0.002 seconds), context: init_worker_by_lua*
2022/03/13 19:16:39 [warn] 25#0: *3 [lua] globalpatches.lua:55: sleep(): executing a blocking 'sleep' (0.002 seconds), context: init_worker_by_lua*
2022/03/13 19:16:39 [warn] 24#0: *2 [lua] globalpatches.lua:55: sleep(): executing a blocking 'sleep' (0.004 seconds), context: init_worker_by_lua*

After manually change the port 8000 to 54321 then I get following logs

172.20.0.1 - - [13/Mar/2022:19:39:13 +0000] "GET / HTTP/1.1" 404 48 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.51 Safari/537.36"
172.20.0.1 - - [13/Mar/2022:19:42:15 +0000] "GET /rest/v1/?apikey=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyAgCiAgICAicm9sZSI6ICJhbm9uIiwKICAgICJpc3MiOiAic3VwYWJhc2UtZGVtbyIsCiAgICAiaWF0IjogMTY0MTc2OTIwMCwKICAgICJleHAiOiAxNzk5NTM1NjAwCn0.dc_X5iR_VP_qT0zsiyj_I_OZ2T9FtRU2BBNWN8Bu4GE HTTP/1.1" 401 197 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.51 Safari/537.36"

Docker ps info

CONTAINER ID   IMAGE                                    COMMAND                  CREATED             STATUS                       PORTS                                             
5211807ef86b   supabase/studio:latest                   "docker-entrypoint.s…"   About an hour ago   Up 59 minutes                0.0.0.0:54323->3000/tcp                           
9fd413b84f9a   supabase/postgres-meta:v0.33.2           "docker-entrypoint.s…"   About an hour ago   Up About an hour             8080/tcp                                          
622c9bf43b55   supabase/pgadmin-schema-diff:cli-0.0.4   "sleep infinity"         About an hour ago   Up About an hour                                                               
ad12825f4afa   supabase/storage-api:v0.12.0             "docker-entrypoint.s…"   About an hour ago   Up About an hour             5000/tcp                                          
683ce0ff65cf   postgrest/postgrest:v9.0.0.20220211      "/bin/postgrest"         About an hour ago   Up About an hour             3000/tcp                                          
da8eaa14016f   supabase/realtime:v0.22.0                "./prod/rel/realtime…"   About an hour ago   Up About an hour                                                               
ec3f3cb97e29   inbucket/inbucket:stable                 "/start-inbucket.sh …"   About an hour ago   Up About an hour (healthy)   1100/tcp, 2500/tcp, 0.0.0.0:54324->9000/tcp       
cdf841bb374a   supabase/gotrue:v2.5.8                   "gotrue"                 About an hour ago   Up About an hour                                                               
a2d210c5545c   kong:2.1                                 "/docker-entrypoint.…"   About an hour ago   Up About an hour             8001/tcp, 8443-8444/tcp, 0.0.0.0:54321->8000/tcp  
d60c688c6635   supabase/postgres:14.1.0                 "docker-entrypoint.s…"   About an hour ago   Up About an hour             0.0.0.0:54322->5432/tcp                           

Mohsen7s avatar Mar 13 '22 19:03 Mohsen7s