Closed nCrafts closed 9 months ago
@nCrafts is this an old project that was recently being restored? are you managing your database migrations using prisma + supabase CLI? it seems like your auth service is down because one of the migrations keeps failing to run on it - i've fixed the issue on your project (econnpaukunccukooobo
) already.
@kangmingtay Yes, this was an old project that was restored. I am using Supabase CLI but not Prisma. I reset the remote DB and then re-ran all migrations. How can I prevent this issue in the future? Thanks.
@nCrafts can you elaborate on the steps you took to reproduce this? what commands did you run to do this: "I reset the remote DB and then re-ran all migrations." ?
typically, you should be using the remote db as the main source of truth and ensure that your local dev is up-to-date. before re-running migrations, you should also inspect the migrations created to ensure that there are no migrations that touch the supabase managed schemas (auth, storage, realtime, etc..)
Basically I wanted to reset the remote database and re-create it based on the local migration files. I ran this on the remote database:
do $$ declare
r record;
begin
for r in (select tablename from pg_tables where schemaname = 'public') loop
execute 'drop table if exists ' || quote_ident(r.tablename) || ' cascade';
end loop;
end $$;
DELETE FROM auth.schema_migrations;
Then this:
npx supabase db reset --linked
npx supabase db push
The migrations ran without errors.
My migrations do contain changes to the storage schema, to create buckets. I am guessing that isn't the right way to do this?
hey @nCrafts, why did you run DELETE FROM auth.schema_migrations;
on the remote database? the auth service relies on that table to decide what migrations to run - was this generated by prisma or supabase CLI?
@kangmingtay I see. My intention was to reset the remote database and re-run all migrations from my local instance. I was hoping DELETE FROM auth.schema_migrations;
would allow me to do that, but I guess not? Is there another you recommend that I can use to reset the remote database? Like how I can use npx supabase db reset locally.
@nCrafts i'm not sure i understand, isn't the point of supabase db reset
to reset the remote database and re-run all local migrations?
@kangmingtay supabase db reset
does that, but locally. Now I see that a --linked
argument was added at some point which would do what I was trying to do, unsuccessfully, with some hacks. I will use that in the future. Thanks for your help!
@kangmingtay it looks like i have the same exact problem as nCrafts here.
can you please take a look at mrwkaizvbyavqcftnagf
?
i also use supabase without prisma. to my knowledge i didn't run any DELETE FROM auth.schema_migrations;
type query. woudl love to know how you debug this and see whats wrong.
hey everyone. If you're receiving invalid response was received from the upstream server
from the Auth system, it could be related to a faulty migration:
Describe the bug
I am trying to run
supabase.auth.admin.generateLink
on the server. I get the errorAuthRetryableFetchError
. When looking into the logs I can co-relate this to a postgres error instead. The error seems to be coming from an admin query, which I have no control over.I've tried re-starting my project, and have also done a database reset. Everything short of starting a new project.
Here is the error stack:
System information
Additional context
The error doesn't happen for me locally, and I am guessing won't happen in a new project. I could start a new project now but would not be feasible in a live environment. Would love to know what's happening here.