medusa icon indicating copy to clipboard operation
medusa copied to clipboard

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

Open LucasMatuszewski opened this issue 1 year ago • 1 comments

Preliminary Checks

  • [X] This issue is not a duplicate. Before opening a new issue, please search existing issues: https://github.com/medusajs/medusa/issues

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 avatar Feb 28 '24 14:02 LucasMatuszewski

I would like to work on this issue.

kailashv7 avatar Mar 22 '24 12:03 kailashv7

I would like to work on this issue.

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

salaxieb avatar Apr 04 '24 21:04 salaxieb

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

shahednasser avatar Apr 05 '24 06:04 shahednasser

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

KailashVenthan avatar Apr 05 '24 13:04 KailashVenthan

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

shahednasser avatar Apr 09 '24 13:04 shahednasser

Thank you Shahed for your reply! 🙌

Le mar. 9 avr. 2024 à 15:33, Shahed Nasser @.***> a écrit :

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.

— Reply to this email directly, view it on GitHub https://github.com/medusajs/medusa/issues/6535#issuecomment-2045191370, or unsubscribe https://github.com/notifications/unsubscribe-auth/AZOTEWHXSF2CTF5WAUXEHZLY4PUZRAVCNFSM6AAAAABD6DS5I2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANBVGE4TCMZXGA . You are receiving this because you are subscribed to this thread.Message ID: @.***>

Charleslmbrt avatar Apr 09 '24 14:04 Charleslmbrt