Database error saving new user #13043
Locked
silentworks
announced in
Troubleshooting
Replies: 1 comment
-
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
This is a copy of a troubleshooting article on Supabase's docs site. It may be missing some details from the original. View the original article.
You generally get this error when trying to invite a new user from the dashboard or when trying to insert a user into a table using the table editor in the Supabase dashboard. You may also see this error in logs in connection to failed signups.
This error is normally associated with a side effect of a database transaction.
Common causes of this error:
auth.userstable that has an errorauth.userstable which isn't being metauth.userstableDebugging this error:
Step 1: Check the Auth logs
Start in the Auth logs explorer in your project dashboard. The logs surface the specific error message and give you the most direct signal about what went wrong.
Step 2: Check the Postgres logs
If the Auth logs point to a database-level issue, open the Postgres logs explorer to look for corresponding errors.
Common errors
NULL value in auth schema column
Example Auth log error:
Cause:
The
authschema is managed by Supabase and expects specific column formats. This error typically happens when users are inserted directly via SQL or using an AI tool that uses a direct SQLINSERT, rather than through the Auth API. A direct insert can leave required columns asNULLwhen the Auth service expects an empty string.Fix:
Run the following in the SQL editor, replacing
confirmation_tokenwith whichever column appears in your error message:This sets all
NULLvalues in that column to an empty string, which is what the Auth service expects.Relation does not exist
Example Auth log error:
Example Postgres log error:
Cause:
A trigger on
auth.usersis calling a function (in this casehandle_new_user) that tries to insert into a table that does not exist. This is common when aprofilestable is referenced in a trigger function but was never created, or was accidentally dropped.Fix:
Check whether the missing table should exist in your
publicschema. If it should, create the table for the trigger to succeed and the error should resolve.If the table is not needed, review the function definition and update or remove the reference. You can view and edit your database functions from the Database Functions page in the dashboard.
Beta Was this translation helpful? Give feedback.
All reactions