cli icon indicating copy to clipboard operation
cli copied to clipboard

Supabase Local CLI, Database is not healthy

Open jjsessa opened this issue 1 year ago • 2 comments

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

  • Ticket ID: 86bed0e795d44450a70db9d882eb6d00

  • Version of OS: Max os Sanoma 14.1.2

  • Version of CLI: 1.165.0

  • Version of Docker: 26.1.1

  • Versions of services:

    supabase/postgres │ 15.1.0.32 │ 15.1.0.32 supabase/gotrue │ v2.150.1 │ v2.150.1 postgrest/postgrest │ v10.2.0 │ v10.2.0 supabase/realtime │ v2.28.32 │ - supabase/storage-api │ v1.2.1 │ v1.2.1 supabase/edge-runtime │ v1.45.2 │ - supabase/studio │ 20240422-5cf8f30 │ - supabase/postgres-meta │ v0.80.0 │ - supabase/logflare │ 1.4.0 │ - bitnami/pgbouncer │ 1.20.1-debian-11-r39 │ - darthsim/imgproxy │ v3.8.0 │ -

jjsessa avatar May 07 '24 19:05 jjsessa

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

can you check with the --debug flag?

Silur avatar May 08 '24 20:05 Silur

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>

haydn avatar May 10 '24 04:05 haydn

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

ThatGuySam avatar May 28 '24 16:05 ThatGuySam

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.

sweatybridge avatar Jun 07 '24 03:06 sweatybridge

tested with postgres image 15.1.1.61 and still encountering this error

Silur avatar Jun 15 '24 10:06 Silur