npx supabase start is failing w/ already exists errors
I started seeing below error since yesterday and I have been noodling to fix it.
null value in column \"provider_id\" of relation \"identities\" violates not-null constraint
Tried several solutions like removing supabase/.temp
, checking my seed.sql
for auth."identities" references etc. But that didn't work.
Upgraded my CLI to latest cli (Tried both npx and brew versions). And now I am seeing below error whenever I run npx supabase start
The above SQL statement is from my first migration sql file under migrations folder. First started seeing above error when I run npx supabase db reset
but now it's happening on start itself.
Any help please? I have been trying different solutions since yesterday w/o any luck. Also tried uninstalled and reinstalled Docker.4 Replies
There appears to be a massive difference between the schema in local development environments and their updated cloud-hosted environment. I am facing a ton of issues with the
auth
schema for example when running a data dump supabase db dump
For me, the auth.identities table migration started disruption to my local dev flow completely. I think it's time for me to switch to the remote until these issues are resolved.
@Reddy Same thing happened with me. What I am currently doing is just erasing them from the dump. They're pretty easy to spot and remove. If you want me to help with your specific use-case, I would gladly hop on a call with and/or start a new thread here and show you how you can do it.
Thank you for the offer to help.
I was able to resolve this finally. I did so many things so not sure what really helped. Here are a few things I did.
- Somehow the recent Supabase Auth identities schema migration was pulled into my remote migration history table. That was preventing my local DB reset and start. Reverted that migration.
- Remote schema wasn't checking if type exists before creating a new type. Similarly for constraints and policies. Squashed all migrations into one and updated schema to be upsert type-ish queries.
- Switched back to Colima from Docker Desktop. A peaceful one.
Still start was failing. Restarted the machine and now everything is all right.