Database error saving new user

This error always appear when I want to register as a new user
No description
13 Replies
garyaustin
garyaustin2w ago
Check your Postgres and Auth logs. This is almost always the result of you having a database trigger function on auth.users that is incorrect.
ikanlautmakannasi
{ "event_message": "{"component":"api","error":"failed to close prepared statement: ERROR: current transaction is aborted, commands ignored until end of transaction block (SQLSTATE 25P02): ERROR: relation \"public.free_trials\" does not exist (SQLSTATE 42P01)","level":"error","method":"POST","msg":"500: Database error saving new user","path":"/signup","referer":"http://localhost/\",\"remote_addr\":\"125.163.127.115\",\"request_id\":\"96e942db27243da1-SIN\",\"time\":\"2025-08-13T15:31:44Z\"}", "id": "bf45aa58-7386-46c6-b799-9471e83a648e",
No description
ikanlautmakannasi
where can I setting so it doesnt require public free trials or maybe there are other way to fix it?
garyaustin
garyaustin2w ago
You have a trigger on auth.users calling a function that you wrote. That function is doing an operation to free_trials.
ikanlautmakannasi
Then how to fix that? I deleted the free trials table i think Bc i replaced it with other tablr with other name
garyaustin
garyaustin2w ago
You have to edit the function.
ikanlautmakannasi
Where
garyaustin
garyaustin2w ago
Look in the Database tab at Triggers in the auth schema. You should see a trigger probably on insert. That will say what function it is calling. Then you find that function in the Function tab or edit it with SQL editor.
ikanlautmakannasi
I see this in triggers, how to delete it?
No description
ikanlautmakannasi
I cant delete it
garyaustin
garyaustin2w ago
You have to delete from the SQL editor because auth is a protected schema. I assume that is how you created it. You could also just fix the function if you just renamed the table. You should search the docs or ask the AI if you need help finding your way around the dashboard and triggers and functions. https://supabase.com/docs/guides/database/postgres/triggers#dropping-a-trigger https://supabase.com/docs/guides/database/functions?queryGroups=language&language=swift
ikanlautmakannasi
Fixed Thanks man

Did you find this page helpful?