medusajs / medusa

The world's most flexible commerce platform.
https://medusajs.com
MIT License
26.23k stars 2.67k forks source link

Cannot connect with Supabase #6296

Closed Saadchr closed 10 months ago

Saadchr commented 10 months ago

Bug report

Describe the bug

Not able to connect with Supabase

System information

Medusa version (including plugins): 1.20 Node.js version: v20.10.0 Database: supabase Operating system: Mac OS Browser (if relevant):

Steps to reproduce the behavior

  1. npx @medusajs/medusa-cli develop

Expected behavior

The connection with the database used to work with the same credentials. When I tried to build the project to check for performance improvements, then started to run the development instance , it no longer works I have this message

error:   Error starting server
Error: The specified connection string for your PostgreSQL database might have illegal characters. Please check that it only contains allowed characters [a-zA-Z0-9]
getaddrinfo ENOTFOUND db.ogfgidofczbsxaglaeql.supabase.co

I double checked all my credentials , I don't get why I have this error. How can I debug this? Thakns

Saadchr commented 10 months ago

To resolve the issue, I changed the generated DATABASE_URL to the one suggested in supabase parameters: postgres://postgres.ogfgidofczbsxaglaeql:[password]@aws-0-eu-central-1.pooler.supabase.com:5432/postgres