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

Docs: in /create-medusa-app - Supabase IPv4 connection deprecated #6535

Closed
1 of 2 tasks
LucasMatuszewski opened this issue Feb 28, 2024 · 6 comments · Fixed by #7036
Closed
1 of 2 tasks

Docs: in /create-medusa-app - Supabase IPv4 connection deprecated #6535

LucasMatuszewski opened this issue Feb 28, 2024 · 6 comments · Fixed by #7036

Comments

@LucasMatuszewski
Copy link

LucasMatuszewski commented Feb 28, 2024

Preliminary Checks

Issue Summary

It looks like a connection to Supabase with direct DB access via IPv4 and pgBouncer doesn't work anymore (since January 26th 2024):
https://github.com/orgs/supabase/discussions/17817

I tried to install Medusa following this guide:
https://docs.medusajs.com/create-medusa-app#step-1-run-create-medusa-app

But the command from the Medusa example doesn't work anymore:
npx create-medusa-app@latest --db-url postgresql://postgres:<password>@<host>.supabase.co:5432/postgres

The new URI format is:
postgres://postgres.<host>:<password>@aws-0-eu-central-1.pooler.supabase.com:5432/postgres

But it didn't work when I tried it like this:
npx create-medusa-app@latest --db-url postgres://postgres.<host>:<password>@aws-0-eu-central-1.pooler.supabase.com:5432/postgres

I tried some other formats but neither works. I've tested the connection with other DB tools and all works.

Any ideas?

How can this issue be resolved?

  1. Probably this command should be supported: npx create-medusa-app@latest --db-url postgres://postgres.<host>:<password>@aws-0-eu-central-1.pooler.supabase.com:5432/postgres
    ...

Are you interested in working on this issue?

  • I would like to fix this issue
@LucasMatuszewski LucasMatuszewski changed the title Docs(Code Issue): Code Issue in /create-medusa-app - Supabase connection Docs: in /create-medusa-app - Supabase IPv4 connection deprecated Feb 28, 2024
@kailashv7
Copy link

I would like to work on this issue.

@salaxieb
Copy link

salaxieb commented Apr 4, 2024

I would like to work on this issue.

Any updates? it's very anticipated fix for me personally

@shahednasser
Copy link
Member

Hey guys, will take some time to look at this maybe early next week. Thank you for your patience!

@KailashVenthan
Copy link

KailashVenthan commented Apr 5, 2024

Hey guys @salaxieb @shahednasser
It works if .env is configured with connection string URI found in supabase dashboard as follows

DATABASE_URL="postgres://[USERNAME]:[YOUR-PASSWORD]@aws-0-ap-south-1.pooler.supabase.com:5432/postgres

@shahednasser
Copy link
Member

shahednasser commented Apr 9, 2024

Hey guys, just an update: while investigating this it seems like it's an inconsistent problem, maybe due to connection errors or something else. On one run I faced errors, but all other runs I was able to finish it successfully.

As the create-medusa-app command isn't focused on supabase, we can't go too deep on looking for a consistent fix. So, for now I'll update the docs with the new URL format, but no further actions will be taken on the command itself.

For those facing errors, they can run the setup with the --skip-db option, then change the DB URL after the setup and re-run migrations.

EDIT: Also just wanna point out that the database URL must be wrapped with double quotes. Will include this in the docs as well

@Charleslmbrt
Copy link

Charleslmbrt commented Apr 9, 2024 via email

@shahednasser shahednasser linked a pull request Apr 9, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants