Erreur 500 sur /auth/v1/token - "Database error querying schema" #48666
Replies: 2 comments
|
No idea what you details are as this is normally an English forum. But database error on /token is almost always an auth.users trigger function you wrote failing or an auth hook you wrote failing. You probably can get more info in the Postgres log on the actual error. |
|
The most useful detail in your report is the one that looks like a side note: your own Those two paths read the same rows. What differs is the role. Your RPC runs on the PostgREST connection ( Run this as select c.relname,
c.relowner::regrole as owner,
c.relrowsecurity as rls_enabled,
c.relforcerowsecurity as rls_forced,
has_table_privilege('supabase_auth_admin', c.oid, 'SELECT') as auth_admin_can_read
from pg_class c
join pg_namespace n on n.oid = c.relnamespace
where n.nspname = 'auth' and c.relkind = 'r'
order by 1;
select has_schema_privilege('supabase_auth_admin', 'auth', 'USAGE') as schema_usage;Every row should be owned by
If those all look right, then the other cause is the one GaryAustin1 pointed at, and it is worth checking directly rather than by elimination — a password grant updates select tgname, tgrelid::regclass as on_table, pg_get_triggerdef(oid)
from pg_trigger
where not tgisinternal
and tgrelid in ('auth.users'::regclass, 'auth.identities'::regclass, 'auth.sessions'::regclass);
-- and any column added to auth.users that GoTrue does not know to populate
select attname, atttypid::regtype as type, attnotnull
from pg_attribute
where attrelid = 'auth.users'::regclass and attnum > 0 and not attisdropped
order by attnum;A Your En français, en résumé : le fait que votre RPC fonctionne et que |
Uh oh!
There was an error while loading. Please reload this page.
Description :
L'API Auth standard de Supabase retourne une erreur 500 avec le message
"Database error querying schema" sur toutes les tentatives de connexion.
Le même compte fonctionne parfaitement avec une fonction RPC personnalisée
(auth_user_login), ce qui confirme que :
Le problème est reproductible à chaque tentative de connexion.
======== Informations à fournir ============
Logs d'erreur
{
"url": "https://mabcizxujioaicalhdvy.supabase.co/auth/v1/token?grant_type=password",
"method": "POST",
"status": 500,
"response": {
"code": 500,
"error_code": "unexpected_failure",
"msg": "Database error querying schema",
"error_id": "019fc961-519b-76a1-a75d-e0b5d0a5301d"
}
}
Configuration
All reactions