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.07k stars 209 forks source link

Clearer error message on permission issue with docker named volumes #1526

Open sweatybridge opened 1 year ago

sweatybridge commented 1 year ago

Describe the bug https://github.com/supabase/cli/issues/1415#issuecomment-1733707587

To Reproduce supabase db start returns database is unhealthy

Expected behavior A clear and concise description of what you expected to happen.

Screenshots

PostgreSQL Database directory appears to contain a database; Skipping initialization

 2023-09-25 14:48:44.696 UTC [8] LOG:  pgaudit extension initialized
 2023-09-25 14:48:44.770 UTC [8] LOG:  pgsodium primary server secret key loaded
 2023-09-25 14:48:44.819 UTC [8] LOG:  starting PostgreSQL 15.1 (Ubuntu 15.1-1.pgdg20.04+1) on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0, 64-bit
 2023-09-25 14:48:44.821 UTC [8] LOG:  listening on IPv4 address "0.0.0.0", port 5432
 2023-09-25 14:48:44.821 UTC [8] LOG:  listening on IPv6 address "::", port 5432
 2023-09-25 14:48:44.846 UTC [8] LOG:  could not bind Unix address "/var/run/postgresql/.s.PGSQL.5432": Invalid argument
 2023-09-25 14:48:44.846 UTC [8] WARNING:  could not create Unix-domain socket in directory "/var/run/postgresql"
 2023-09-25 14:48:44.846 UTC [8] FATAL:  could not create any Unix-domain sockets
 2023-09-25 14:48:44.860 UTC [8] LOG:  database system is shut down

Desktop (please complete the following information):

Additional context Add any other context about the problem here.

monsoir commented 1 year ago

As mentioned at the reply of the original issue:

More info: I have redirected the Docker data to an external drive, and it has 60+GB spared space. It works fine with other containers,

Seems like this is the cause exactly. Once I change the data-root back to default, everything is fine.

Since more and more images and containers are downloaded and created during using docker, it's great if I can redirect the data-root.

Have a look if you may, thank you!