medusajs / b2b-starter-medusa

Official Medusa B2B Starter template. Features common B2B ecommerce requirements and can be easily adapted and extended.
https://dub.sh/medusa-b2b-starter
MIT License
141 stars 42 forks source link

Problem at setting up the starter with different database credentials #75

Closed abusarah-tech closed 14 hours ago

abusarah-tech commented 4 weeks ago

Bug report

Describe the bug

Trying to set up the b2b starter with an existing database instance that has different credentials (username, password) but it throws an error. (see the screenshot below)

System information

Node.js version: v22.8.0 Database: Postgres 14 Operating system: WSL (Ubuntu 22.04)

Steps to reproduce the behavior

  1. Create database instance using docker compose with the following setup

    services:
    medusa-db:
    image: postgres:14
    environment:
      - POSTGRES_DB=medusa-backend
      - POSTGRES_USER=username
      - POSTGRES_PASSWORD=password
    ports:
      - "5432:5432"
    
    medusa-cache:
    image: redis:6
    ports:
      - "6379:6379"
  2. Clone the repository and run yarn install && yarn setup

Expected behavior

It should to prompt me to enter the database credentials then the database name then complete the setup.

Screenshots

image

abusarah-tech commented 4 weeks ago

Additionally it would be nice to provide a docker-compose.yml file to start with in this case. This is the docker-compose.yml file that I used to circumvent the problem for now.

services:
  medusa-db:
    image: postgres:latest
    environment:
      - POSTGRES_HOST_AUTH_METHOD=trust
    ports:
      - "5432:5432"

  medusa-cache:
    image: redis:6
    ports:
      - "6379:6379"
riqwan commented 1 week ago

Hey @abusarah-tech, apologies for the delay, I was on vacation. Did you manage to figure this out yet?

abusarah-tech commented 1 week ago

Hey @abusarah-tech, apologies for the delay, I was on vacation. Did you manage to figure this out yet?

Hey, welcome back! I saw you got back to a surprise from @VariableVic 😄 I haven't still figured out how to use a postgres instance that requires authentication.

riqwan commented 6 days ago

Thanks! Can you open a PR on this repo with the docker changes? Let me know how I can reproduce the issue, will dig in later today.

riqwan commented 14 hours ago

closing due to inactivity, feel free to reopen if this is still an issue with the new repo setup