Basically check the Auth log for database error. If so then check the Postgres log for SQL error. Then assuming you have an auth.users trigger function check the code to see where the error is being caused.
You can post the error and code if you need help.