© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•2mo ago•
3 replies

500: Database error granting user

When trying to log in as a user with email & password using supabasejs, the error
500: Database error granting user
500: Database error granting user
occurs.
When looking at the logs, the event message is
{
    "auth_event": "[REDACTED]",
    "component": "api",
    "error": "error creating refresh token: failed to close prepared statement: ERROR: current transaction is aborted, commands ignored until end of transaction block (SQLSTATE 25P02): ERROR: duplicate key value violates unique constraint \"refresh_tokens_pkey\" (SQLSTATE 23505)",
    "grant_type": "password",
    "level": "error",
    "method": "POST",
    "msg": "500: Database error granting user",
    "path": "/token",
    "referer": "http://localhost:3000",
    "remote_addr": "[REDACTED]",
    "request_id": "9ab4a43ac581daab-MUC",
    "time": "2025-12-09T12:52:46Z"
}
{
    "auth_event": "[REDACTED]",
    "component": "api",
    "error": "error creating refresh token: failed to close prepared statement: ERROR: current transaction is aborted, commands ignored until end of transaction block (SQLSTATE 25P02): ERROR: duplicate key value violates unique constraint \"refresh_tokens_pkey\" (SQLSTATE 23505)",
    "grant_type": "password",
    "level": "error",
    "method": "POST",
    "msg": "500: Database error granting user",
    "path": "/token",
    "referer": "http://localhost:3000",
    "remote_addr": "[REDACTED]",
    "request_id": "9ab4a43ac581daab-MUC",
    "time": "2025-12-09T12:52:46Z"
}

I haven't touched auth at all as far as I know, how I can fix this?
Supabase banner
SupabaseJoin
Supabase gives you the tools, documentation, and community that makes managing databases, authentication, and backend infrastructure a lot less overwhelming.
45,816Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Error 500 Auth: Database error finding user from email
SupabaseSSupabase / help-and-questions
3mo ago
Error 500 - user management
SupabaseSSupabase / help-and-questions
5mo ago
After update on Auth.users.last_sign_in result in "Database Error Granting User" error
SupabaseSSupabase / help-and-questions
3y ago
Database error finding user
SupabaseSSupabase / help-and-questions
4y ago