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.09k stars 212 forks source link

Getting "Invalid project ref format" error message when trying to run `npx supabase db push` #2915

Open bactrachdam opened 1 day ago

bactrachdam commented 1 day ago

Bug report

Describe the bug

I have a Supabase project and want to run some migrations that I have written against the managed instances. Here are the commands I ran:

npx supabase --version # --> 1.223.10
npx supabase login # --> login via browser
npx supabase link --project-ref <PROJECT_REF> # --> Project Ref I got from Supabase Dashboard
npx supabase db push # --> Invalid project ref format. Must be like `abcdefghijklmnopqrst`.
npx supabase db push --debug # --> WARN: no SMS provider is enabled. Disabling phone login. Invalid project ref format. Must be like `abcdefghijklmnopqrst`.

To Reproduce

Steps to reproduce the behavior, please provide code snippets or a repository:

  1. You can either use an existing Supabase project to create a new one with npx supabase init
  2. Create a simple migration file
  3. Run the following commands
npx supabase login # --> login via browser
npx supabase link --project-ref <PROJECT_REF> # --> Project Ref from Supabase Dashboard
npx supabase db push

Expected behavior

I expect the migration to run successfully. This has been working fine until the most recent upgrade to Supabase CLI. I haven't changed any configuration on my MacBook Pro M3.

Screenshots

Screenshot 2024-11-25 at 10 02 59 am

System information

automationconsulting commented 1 day ago

I can confirm that there is a bug with the latest version. In fact I have to go back all the way to v1.219.2.

npx supabase@1.219.2 db push                                
WARN: no SMS provider is enabled. Disabling phone login
Connecting to remote database...
Remote database is up to date.
A new version of Supabase CLI is available: v1.223.10 (currently installed v1.219.2)
We recommend updating regularly for new features and bug fixes: https://supabase.com/docs/guides/cli/getting-started#updating-the-supabase-cli