Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

permission denied for table http_request_queue as an authenticated user #72

Open
psteinroe opened this issue Sep 26, 2022 · 3 comments
Open
Labels
bug Something isn't working

Comments

@psteinroe
Copy link

Bug report

Describe the bug

After pg_net got upgraded, it throws a permission denied for table http_request_queue when trying to make a request as an authenticated user.

To Reproduce

Upgrade to the latest version and attempt to make a http request using the authenticated role.

Expected behavior

Assumption is that any supabase extension works out of the box with the role and auth setup in the database. If it is expected behaviour, it should be documented somewhere.

@psteinroe psteinroe added the bug Something isn't working label Sep 26, 2022
@psteinroe
Copy link
Author

The issue is fixed by applying this supabase/supabase#4883 (comment)

Nevertheless, the expectation is that pg_net, when enabled on supabase, automatically applies the correct permissions.

@steve-chavez
Copy link
Member

We still get support tickets related to this issue. It seems that some tool resets all the postgres role privileges, which we rely on

pg_net/sql/pg_net.sql

Lines 365 to 366 in 4c1ca73

grant all on schema net to postgres;
grant all on all tables in schema net to postgres;

The solution should be to instead grant all privileges to PUBLIC, which is something pg_cron also does:

https://github.com/citusdata/pg_cron/blob/main/pg_cron.sql#L27

steve-chavez added a commit to steve-chavez/pg_net that referenced this issue Jan 10, 2024
steve-chavez added a commit to steve-chavez/pg_net that referenced this issue Jan 12, 2024
steve-chavez added a commit to steve-chavez/pg_net that referenced this issue Jan 23, 2024
@PhilippS93
Copy link

We have the same error right now. Running the fix gives the result

must be owner of function net.http_get

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants