Dashboard errors when managing users #21247
TheOtherBrian1
announced in
Troubleshooting
Replies: 1 comment 3 replies
-
Here's what I see on the
Yet on the new row created in |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
PROBLEM
Receiving the following or similar error messages in the Dashboard when managing users.
Or, receiving a comparable 500 error from the Auth REST API:
SOLUTION 1 (trigger related)
Check if the auth schema contains any triggers in the Dashboard's trigger section. Remove all triggers by dropping their functions with a CASCADE modifier:
Then recreate the functions with a security definer modifier before recreating the triggers.
The SQL Editor contains a template for User Management. Within it, there is a working example of how to setup triggers with security definers that may be worth referencing:
EXPLANATION
One of the most common design patterns in Supabase is to add a trigger to the
auth.users
table. The database role managing authentication (supabase_auth_admin) only has the necessary permissions it needs to perform its duties. So, when a trigger operated by the supabase_auth_admin interacts outside the auth schema, it causes a permission error.A security definer function retains the privileges of the database user that created it. As long as it is the
postgres
role, your auth triggers should be able to engage with outside tables.SOLUTION 2 (constraint related)
If you did not create a trigger, check if you created a foreign/primary key relationship between the auth.users table and another table. If you did, then ALTER the behavior of the relationship and recreate it with a less restrictive constraint.
Beta Was this translation helpful? Give feedback.
All reactions