S
Supabase9mo ago
Danish

Switching Between two different local Supabase Projects issue

When switching between two Supabase projects using supabase link and supabase unlink, running supabase start for the previously linked project results in an error. It appears the local Supabase environment remains configured for the new project, causing conflicts. To Reproduce Steps to reproduce the behavior: Create two Supabase projects: Set up two separate Supabase projects (e.g., Project A and Project B). Link to Project A: In your terminal, navigate to your Project A directory and run supabase link --project-ref <Project A ref>. Start Project A: Run supabase start. This should work correctly. Link to Project B: Navigate to your Project B directory and run supabase link --project-ref <Project B ref>. Start Project B: Run supabase start. This should also work correctly. Unlink Project B: Run supabase unlink. Attempt to start Project A: Navigate back to your Project A directory and run supabase start. This will likely result in an error. Expected behavior: supabase start should successfully start the local Supabase environment for Project A, regardless of previous linking to Project B.
10 Replies
silentworks
silentworks9mo ago
I'm going to test this out
vick
vick9mo ago
Do both your projects have the same project_id in the supabase/config.toml file? That would case overlapping with the docker containers.
silentworks
silentworks9mo ago
I'm assuming from the instructions above that they aren't. But lets wait and see what the user answers.
Danish
DanishOP9mo ago
Hi! Thank you for your response No they have different projectIds The issue is coming in when I run supabase start My health checks is unhealthy I can share the error message ERROR: type "one_time_token_type" already exists (SQLSTATE 42710)
At statement 0: create type "auth"."one_time_token_type" as enum ('confirmation_token', 'reauthentication_token', 'recovery_token', 'email_change_token_new', 'email_change_token_current', 'phone_change_token') This is the error I am getting
vick
vick9mo ago
That's from running supabase start? It really sounds like you're sharing the same project id.
silentworks
silentworks9mo ago
Wait but from your steps you are running both supabase start at the same time which isn't possible unless you change the ports. Please provide correct steps as the steps you've outlined doesn't actually work.
Danish
DanishOP9mo ago
project_id = "EZXS" project_id = "Code" These are the two project ID's I am actually stopping one project and running another one But looks like there is an issue with Auth
silentworks
silentworks9mo ago
Can't reproduce this issue after following your steps. I've done a screen recording of me following the steps without any issues.
vick
vick9mo ago
Wild-assed guessing here: are you using an old version of the supabase CLI that wants to run an old version of the supabase docker image by default? I'm guessing when you do an unlink it removes the versions locked in by the .temp files and it has a clash in the DB versions.
Danish
DanishOP8mo ago
I fixed it, had to clean my Docker and unlink the project

Did you find this page helpful?