mikemajesty / nestjs-microservice-boilerplate-api

Nestjs boilerplate microservice api | Mongodb CRUD - Postgres CRUD | Docker | Husky | Secrets service | HTTP service | Logs service | Authentication | Authorization | Error Handler | Swaggger Documentation | Mongo Generic Repository | Postgres Generic Repository
294 stars 70 forks source link

Encountered issue when start the project #14

Open hoatepdev opened 2 months ago

hoatepdev commented 2 months ago

Environment:

System: Ubuntu 22.04 Node: 20.11.1 NPM: 10.2.4

Description:

When attempting to start the project, an issue was encountered that prevented the project from running as expected. Detailed information about the issue is provided below.

Steps to Reproduce:

  1. Clone the repository: git clone ...

  2. Install dependencies: yarn

  3. Infrastructure installation: yarn infra Actual Result: All docker containers are up and running successfully. In the microservice-mongo-express container, the system reports an error:

    • MongoError: no primary found in replicaset
    • /docker-entrypoint.sh: line 14: 10.5.0.5,10.5.0.6,10.5.0.7: Name does not resolve
    • /docker-entrypoint.sh: line 14: /dev/tcp/10.5.0.5,10.5.0.6,10.5.0.7/27017: Invalid argument

      Screenshot: image

  4. Run project: yarn start:dev Actual Result: When running the command npm run migration-mongo:run the following error occurs:

    DbConnectionError: MongoServerSelectionError: connect EHOSTUNREACH 10.5.0.5:27017

    Screenshot: image

Thanks for reading, I would appreciate a solution to this problem! @mike-lima-gaivota

mikemajesty commented 2 months ago

it's replica set, try to use a mongo single instance image. https://hub.docker.com/_/mongo