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

Supabase Local CLI, Database is not healthy #2252

Closed CptJJ closed 5 months ago

CptJJ commented 6 months ago

Describe the bug Supabase db pull works once but then fails on all subsequent pulls. Docker contain loads then goes away instantly (looking in the docker desktop ui)

To Reproduce Steps to reproduce the behavior:

  1. Supabase init
  2. supabase link
  3. supabase db pull
  4. supabase db pull --schema storage
Failed to remove container: a6e826a9a158f55c6fd8a62c2eda43f4f8806f3688f07b8cc7e24b1b366b55d4 Error response from daemon: No such container: a6e826a9a158f55c6fd8a62c2eda43f4f8806f3688f07b8cc7e24b1b366b55d4
database is not healthy

Also supabase start then gives:

Starting database...
Setting up initial schema...
error running container: exit 1

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

System information

Silur commented 6 months ago

likely related to https://github.com/supabase/cli/issues/2250

can you check with the --debug flag?

haydn commented 6 months ago

I hit this when I upgraded the Supabase CLI. I'm guessing I didn't do a supabase stop --no-backup beforehand.

I was able to work around it be deleting the volumes with Docker:

docker volume ls # find the back-ups for your project
docker volume rm <volume name>
ThatGuySam commented 5 months ago

Figured out a command to delete just the Supabase Docker Images here: https://github.com/supabase/cli/issues/1415#issuecomment-2135605792

sweatybridge commented 5 months ago

Yup, this is likely due to running outdated postgres image locally, ie. 15.1.0.32. I'd suggest upgrading your hosted project to latest version when possible.

Or as an alternative rm supabase/.temp/postgres-version to use the latest version locally.

Silur commented 5 months ago

tested with postgres image 15.1.1.61 and still encountering this error