"permission denied for schema net" after enabling hook functions alpha
See original GitHub issueBug report
Describe the bug
Enabling Hook functions results in a collection of permission related errors when calling supabase.from("table").insert({ ...data })
or supabase.from("table").update({ ...data })
on a table with an associated hook which runs on inserts/updates.
Examples include:
“permission denied for schema net” “permission denied for schema supabase_functions” “permission denied for table http_request_queue”
To Reproduce
Steps to reproduce the behavior, please provide code snippets or a repository:
- Create a new Supabase project
- Go to ‘Database’ -> ‘Function Hooks’
- Click ‘Enable Hooks’
- Create a new hook that fires on any event against an existing table in the public schema
- Try to perform an operation on this table using the Supabase JS client, e.g.
supabase.from("profiles").update({ email: "some@email.com" })
- Check the network request response in your browser
Expected behavior
When enabling hooks, appropriate privileges should be created on all necessary schemas / tables / sequences.
System information
- Version of supabase-js: 1.21.0
Additional context
I’ve resolved the issue by manually granting privileges through the SQL editor in the dashboard:
GRANT USAGE ON SCHEMA net TO "authenticated";
GRANT ALL ON ALL TABLES IN SCHEMA net TO "authenticated";
GRANT USAGE, SELECT ON ALL SEQUENCES IN SCHEMA net TO "authenticated";
GRANT USAGE ON SCHEMA supabase_functions TO "authenticated";
GRANT ALL ON ALL TABLES IN SCHEMA supabase_functions TO "authenticated";
GRANT USAGE, SELECT ON ALL SEQUENCES IN SCHEMA supabase_functions TO "authenticated";
However, I have no idea if these are the correct permissions/privileges, they just seem to work and from what I can tell mirror the privileges on tables within the storage schema!
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (4 by maintainers)
@Marc-Hoch please email support@supabase.io with a link to this discussion and your project ref. We’ll investigate!
@w3b6x9 Wen, facing the same issue here. Have already mailed to support, but would you have a solve here
Error is occuring if I try to modify a table with a function - it says permission denied for schema supabase_functions
Thanks a lot