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.02k stars 201 forks source link

Could not open configuration file when `supabase start` #1922

Closed leerobert closed 7 months ago

leerobert commented 7 months ago

Describe the bug

Upon supabase start, getting the following error after upgrading my supabase version.

2024-02-06 10:56:28 
2024-02-06 10:56:28 PostgreSQL Database directory appears to contain a database; Skipping initialization
2024-02-06 10:56:28 
2024-02-06 10:56:28 
2024-02-06 10:56:28 PostgreSQL Database directory appears to contain a database; Skipping initialization
2024-02-06 10:56:28 
2024-02-06 10:56:28 
2024-02-06 10:56:28 PostgreSQL Database directory appears to contain a database; Skipping initialization
2024-02-06 10:56:28 
2024-02-06 10:56:29 
2024-02-06 10:56:29 PostgreSQL Database directory appears to contain a database; Skipping initialization
2024-02-06 10:56:29 
2024-02-06 10:56:30 
2024-02-06 10:56:30 PostgreSQL Database directory appears to contain a database; Skipping initialization
2024-02-06 10:56:30 
2024-02-06 10:56:32 
2024-02-06 10:56:32 PostgreSQL Database directory appears to contain a database; Skipping initialization
2024-02-06 10:56:32 
2024-02-06 10:56:28 2024-02-06 15:56:28.439 GMT [10] LOG:  could not open configuration file "/etc/postgresql-custom/read-replica.conf": No such file or directory
2024-02-06 10:56:28 2024-02-06 15:56:28.439 GMT [10] FATAL:  configuration file "/etc/postgresql/postgresql.conf" contains errors
2024-02-06 10:56:28 2024-02-06 15:56:28.657 GMT [10] LOG:  could not open configuration file "/etc/postgresql-custom/read-replica.conf": No such file or directory
2024-02-06 10:56:28 2024-02-06 15:56:28.657 GMT [10] FATAL:  configuration file "/etc/postgresql/postgresql.conf" contains errors
2024-02-06 10:56:28 2024-02-06 15:56:28.999 GMT [10] LOG:  could not open configuration file "/etc/postgresql-custom/read-replica.conf": No such file or directory
2024-02-06 10:56:28 2024-02-06 15:56:28.999 GMT [10] FATAL:  configuration file "/etc/postgresql/postgresql.conf" contains errors
2024-02-06 10:56:29 2024-02-06 15:56:29.526 GMT [10] LOG:  could not open configuration file "/etc/postgresql-custom/read-replica.conf": No such file or directory
2024-02-06 10:56:29 2024-02-06 15:56:29.526 GMT [10] FATAL:  configuration file "/etc/postgresql/postgresql.conf" contains errors
2024-02-06 10:56:30 2024-02-06 15:56:30.438 GMT [10] LOG:  could not open configuration file "/etc/postgresql-custom/read-replica.conf": No such file or directory
2024-02-06 10:56:30 2024-02-06 15:56:30.438 GMT [10] FATAL:  configuration file "/etc/postgresql/postgresql.conf" contains errors
2024-02-06 10:56:32 2024-02-06 15:56:32.180 GMT [10] LOG:  could not open configuration file "/etc/postgresql-custom/read-replica.conf": No such file or directory
2024-02-06 10:56:32 2024-02-06 15:56:32.180 GMT [10] FATAL:  configuration file "/etc/postgresql/postgresql.conf" contains errors
➜  ~ supabase services

        SERVICE IMAGE      │        LOCAL         │ LINKED
  ─────────────────────────┼──────────────────────┼─────────
    supabase/postgres      │ 15.1.0.147           │ -
    supabase/gotrue        │ v2.132.3             │ -
    postgrest/postgrest    │ v12.0.1              │ -
    supabase/realtime      │ v2.25.50             │ -
    supabase/storage-api   │ v0.43.11             │ -
    supabase/edge-runtime  │ v1.32.0              │ -
    supabase/studio        │ 20240101-8e4a094     │ -
    supabase/postgres-meta │ v0.75.0              │ -
    supabase/logflare      │ 1.4.0                │ -
    bitnami/pgbouncer      │ 1.20.1-debian-11-r39 │ -
    darthsim/imgproxy      │ v3.8.0               │ -

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

Screenshots If applicable, add screenshots to help explain your problem.

System information Rerun the failing command with --create-ticket flag (preferred).

Additional context If applicable, add any other context about the problem here.

leerobert commented 7 months ago

Downgrading to 1.110.1 allows me to start my containers again, 1.126.1 did not work.

sweatybridge commented 7 months ago

This is most likely due to stale docker volume. You may delete them with supabase stop --no-backup before starting again.

leerobert commented 7 months ago

This is most likely due to stale docker volume. You may delete them with supabase stop --no-backup before starting again.

I started supabase with 1.110.1 via npm versioned supabase then ran supabase stop --no-backup w/ brew's latest 1.136.3 and supabase start and still encountering the same issue.

Also rm -rf supabase/.temp and rm -rf supabase/.branches

No luck.

leerobert commented 7 months ago

I changed my project_id within config.toml and I'm able to run supabase start. Not sure how to wipe out volumes other than creating new project and starting w/ new volumes.

sweatybridge commented 7 months ago

The command to delete all unused docker volumes is docker volume prune. After which running docker volume ls should not return any volume names which start with supabase_* prefix.

BoscoDomingo commented 7 months ago

Same issue here. Something's amiss with the Docker image. Changing project ID in config.toml worked

Edit: Remember to stop previous project with --project-id. Don't be dumb like me (#1942)

LavaGolem commented 6 months ago

Hi ppl, one question

Do you by any chance know how to downgrade, or install a specific version of Supabase I get this error, whatever I tried: Warning: No available formula or cask with the name "supabase/tap/supabase@1.126.1". Did you mean supabase/tap/supabase or supabase/tap/supabase-beta?

BennettDixon commented 6 months ago

The command to delete all unused docker volumes is docker volume prune. After which running docker volume ls should not return any volume names which start with supabase_* prefix.

Just FYI for anyone else with this issue if you are having trouble getting the volumes to delete (they still show in docker volume ls):

  1. Make sure you have no supabase containers running (docker ps)
  2. Pass -a to docker volume prune -a to prune all volumes, not just anonymous ones.
petercsiba commented 4 months ago

FWIW this started happening to me after the supabase/postgres image was updated on my localhost:

supabase db reset
Resetting local database...
Recreating database...
15.1.1.44: Pulling from supabase/postgres

tried the docker volume prune but got same results - but might have been unlucky with order of commands.

What worked with me was to rename project_id in config.toml as suggested by @leerobert