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

Updating to 0.1.16 from 0.1.14 broke my wrapper due to access issues to wrappers.wrappers_fdw_stats #131

Open
2 tasks done
pjmv opened this issue Aug 24, 2023 · 8 comments
Labels
bug Something isn't working

Comments

@pjmv
Copy link

pjmv commented Aug 24, 2023

Bug report

  • I confirm this is a bug with Supabase, not with my own application. -> Well I can't be 100% sure...
  • I confirm I have searched the Docs, GitHub Discussions, and Discord.

Describe the bug

I was using a wrapper on my Cloud Supabase install. I needed to upgrade to be able to use the Airtable wrapper. To do so, I paused the project and reinstalled, as per advice offered on Discord (https://discord.com/channels/839993398554656828/1006358244786196510/threads/1144271220414631956)

Since then queries on the foreign tables fail because of permission denied for table wrappers_fdw_stats, even with the postgres user in psql.

To Reproduce

Steps to reproduce the behavior, please provide code snippets or a repository:

  1. Pause/Resume your project on Supabase from a previous version
  2. `select * from stripe.customers limit 3;
  3. see the following error message
ERROR:  permission denied for table wrappers_fdw_stats
CONTEXT:  SQL statement "insert into wrappers.wrappers_fdw_stats as s (fdw_name, create_times) values($1, $2)
         on conflict(fdw_name)
         do update set
            create_times = coalesce(s.create_times, 0) + excluded.create_times,
            updated_at = timezone('utc'::text, now())"

Expected behavior

My previously configured foreign tables to work as previously

System information

Irrelevant as the problem happens server-side at Supabase's

Additional context

I tried grant all on wrappers.wrappers_fdw_stats to postgres; but even that failed with the same error.

@pjmv pjmv added the bug Something isn't working label Aug 24, 2023
@pjmv
Copy link
Author

pjmv commented Aug 24, 2023

I "solved" my problem by nuking everything with DROP EXTENSION wrappers CASCADE and reinstalling everything afterwards which was acceptable for me as the cascade stopped at a foreign table. However I don't know how that would work for more intricate situations where the dependency chain goes further.

@burmecia
Copy link
Member

In which schema did you install wrappers extension? I suspect that might be caused by pause/restore didn't restore permission correctly. And how did you upgrade the extension, is it before pause/restore or after?

@pjmv
Copy link
Author

pjmv commented Aug 28, 2023

I did install the wrappers extension WITH SCHEMA wrappers

I did not see a solution to upgrade without doing pause/restore, and the pause/restore solution was suggested to me by GaryAustin1 on the Supabase Discord. It seemed like the only solution to graduate to the latest release of the wrappers extension.

@thompsonbear
Copy link

I ran into this issue in the past on database upgrade and it was determined that the api key for the integration (stored in vault) was not properly decrypted post database upgrade. The vault secret for the integration needed to be removed and re-added to access the foreign data from the wrapper table.

@pjmv
Copy link
Author

pjmv commented Sep 21, 2023

I ran into this issue in the past on database upgrade and it was determined that the api key for the integration (stored in vault) was not properly decrypted post database upgrade. The vault secret for the integration needed to be removed and re-added to access the foreign data from the wrapper table.

I am not sure how this is related because my issue was with the wrappers_fdw_stats which sits locally, not remotely ?

However it does suggest that the upgrade process should be handled a bit more gracefully...

@NeoPrint3D
Copy link

any updates I am currently trying to use the stripe wrapper but I am getting the same problem when trying to access data from the frontend

@imor
Copy link
Contributor

imor commented Sep 29, 2023

If anyone's on the hosted version, could you please raise a support ticket. As @burmecia has pointed out, the pause/resume might have failed to restore permissions.

@Pluriscient
Copy link

Created a support request for this on the hosted version (just set up a fresh install of the stripe wrapper - twice - and this problem occurs when querying a view that uses the stripe information

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

No branches or pull requests

6 participants