S
Supabase2w ago
Nick

Auth error: "relation audit_logs does not exist" - blocking all new user signups

Description: I'm trying to allow users to sign up for my application (both email/password and Google OAuth), but every signup attempt is failing with a database error. What's going wrong: All user creation attempts fail with this error: ERROR: relation "audit_logs" does not exist (SQLSTATE 42P01) Database error creating new user What I've discovered: - My auth schema contains a table named audit_log_entries (not audit_logs) - The Supabase Auth service is looking for auth.audit_logs which doesn't exist - I cannot create the missing table because auth schema is read-only - This was working previously and suddenly stopped working Environment details: - Platform: Web (Next.js) - Framework: Next.js 15.3.3 - Library: @supabase/supabase-js@2.50.0 - @supabase/ssr@0.5.2 - @supabase/auth-helpers-nextjs@0.10.0 - Project ref: wgofkssqahgiwjtypipc - OS: Production deployment on Vercel Impact: No new users can create accounts. All authentication methods are failing with the same error.
6 Replies
garyaustin
garyaustin2w ago
Do you have a trigger function on auth.users?
Nick
NickOP2w ago
Yes, I have a trigger function on auth.users that creates user profiles: -- Trigger function CREATE OR REPLACE FUNCTION public.handle_new_user() RETURNS trigger AS $$ BEGIN INSERT INTO public.user_profiles (id, email, created_at, updated_at) VALUES ( new.id, new.email, now(), now() ) ON CONFLICT (id) DO NOTHING; RETURN new; END; $$ LANGUAGE plpgsql SECURITY DEFINER; -- Trigger CREATE TRIGGER on_auth_user_created AFTER INSERT ON auth.users FOR EACH ROW EXECUTE FUNCTION public.handle_new_user(); This trigger has been working fine for months. It just creates a corresponding profile in the public.user_profiles table when a new user signs up.
garyaustin
garyaustin2w ago
Is that your only trigger function? Do you have a trigger on your user_profiles table? There is no audit_log table and there is no code in Auth server (just checked) that calls audit_log... just audit_log_entries. Check the Postgres logs and see if there is more info on public. or auth. for the "missing" table.
Fadi
Fadi2w ago
I sent a request to help in error to the Supabase team, but they are not replying? Did I do something wrong while sending, and didn't reach them? https://discord.com/channels/839993398554656828/1404445296590585926
garyaustin
garyaustin2w ago
Why are you linking your other help topic? I've seen it but don't know anything about it. So you are waiting on a user who does.
You sent a request to support on this issue? Are you Pro? If Free there is no guaranteed response time. You did not answer about other triggers. Or Postgres log.
No one else so far is reporting any error like this so seems like a code change on your part.
Nick
NickOP2w ago
@garyaustin Thank you asking me for those additional items as that allowed me to find the issue. The audit functions were using unqualified table name audit_logs which was being searched for in the auth schema first. I've updated them to use public.audit_logs explicitly. All good now!

Did you find this page helpful?