Could not query the database for the schema cache. Retrying.
Hey there I receive this error when i call supabase from supabasejs with anon key.
6 Replies
This is a PostgREST error (the database API Supabase uses). I've not seen it reported before. Can you provide more info on your Supabase environment (hosted, new, was working now not, etc.)
It was working since yesterday,
i think what is causing the problem is releated to db privileges, but not really sure what to fix
Its hosted on Supabase cloud
Did you change the privileges/grants somehow?
we did change lots of roles and tried not to touch any thing related to Supabase roles.
is there a way to restore default privileges for Supabase roles?
No automatic way. The two roles that are critical for PostgREST with anon are anon and authenticator. https://github.com/supabase/supabase/issues/4833 discusses a bit on this.
But I'm not sure best way to dig thru all the different setup/migration scripts to see what it is set. Maybe look at a new instance and see, but you need to know what you are doing.
If you have alot invested you could try support, if not starting over might be fastest.
GitHub
Grant CONNECT permission to authenticator, supabase_storage_admin a...
Chore Describe the chore In order to tighten the security of a PostgreSQL instance, some suggest to revoke the permissions for the database and 'public' from the PUBLIC role and onl...
Thanks 🙏🏼 , we'll try and see how it goes.
We cant start over as the db connected to many services. And lots of users already using the app.
Thanks for the advice,
I looked at a new project and ran:
and found
PUBLIC
role does not have SELECT
privilege in the old project.
Fixed it with:
GRANT SELECT ON pg_class TO PUBLIC;