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

db-init scripts not compliant with RDS hosting #657

Open
Erin-Boehmer opened this issue Jun 5, 2023 · 4 comments
Open

db-init scripts not compliant with RDS hosting #657

Erin-Boehmer opened this issue Jun 5, 2023 · 4 comments
Labels
bug Something isn't working

Comments

@Erin-Boehmer
Copy link

Erin-Boehmer commented Jun 5, 2023

Bug report

Supabase's self-hosting documentation suggests decoupling the db from the middleware, listing AWS RDS as a viable option. But running init-db and migration scripts against a fresh RDS instance causes errors. Supabase provides no documentation for a workaround.

Describe the bug

The init-db / migration scripts try to execute commands reserved for a superuser. This is ok in postgres, but because RDS is a managed service, it restricts the default permission set for the postgres user (AWS documentation here). Specifically it disallows superuser and replication permissions for the default postgres user.

This leads to the error:

helicone=> alter user  supabase_admin with superuser createdb createrole replication bypassrls;
ERROR:  must be superuser to alter superuser roles or change superuser attribute

It's unclear how those using RDS with supabase should handle the discrepancy.

To Reproduce

  1. Create new RDS instance with default postgres main user
  2. Attempt to run init-db scripts in database
Screen Shot 2023-06-05 at 4 24 46 PM

Expected behavior

I expect the init-db and migration scripts to complete successfully when I follow the "Self-Hosting" instructions (here).

System information

  • RDS running postgres 15.2

Additional context

Encountered while mod'ing Helicone's docker-compose.yml based on supabase (here)

Related - also would have appreciated you linking to AWS's docs describing how to install the pgjwt extension (took me some searching to find & set up).

@Erin-Boehmer Erin-Boehmer added the bug Something isn't working label Jun 5, 2023
@fvaldes33
Copy link

Today I tried to do the same with the same issues you mentioned. I was able to get pgjwt installed, probably found the same documentation/guides you found.

Right now, at a total stand still and cannot move forward with this set up.

@Erin-Boehmer
Copy link
Author

@fvaldes33 the best I've found are these RDS / Aurora migration scripts in the community-built supabase-on-aws repo. They'll get you closer, but still require some modifications. The supabase-on-aws migrations also do not include the additional migrations from supabase's docker repo here. You'll need to add those separately.

Even getting these running, I'm still blocked because RDS does not support several important supabase extensions, namely:

@fvaldes33
Copy link

I need to get a POC running asap so I might just fall back to running postgres inside an EC2 for now. Hope the supabase folks give this ticket some attention, would love to get this running the "aws" way for the long term.

@koryonik
Copy link

@fvaldes33 any news on your side?

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

3 participants