Skip to content

Failed to launch locally - MongoDB not connecting on Accounts #25

Open
@pavlosidelov

Description

@pavlosidelov

From the Article for Local launch a lot of things is unclear.
For example about DB

Get your mongo connection string. Almost all your microservices need it; keep it safe!
Ok, I save it in .env:
MONGO_URL=mongodb://$USERNAME:$PASSWORD@e07eca23-91af-413b-8bf6-3e3f9825717c-0.497129fd685f442ca4df759dd55ec01b.databases
BASE_PATH=e07eca23-91af-413b-8bf6-3e3f9825717c-0.497129fd685f442ca4df759dd55ec01b.databases.appdomain.cloud

When I do "npm start" on /accounts/ folder, I got a lot of missing components and I setup all of them, but the error still threw.

Running on e07eca23-91af-413b-8bf6-3e3f9825717c-0.497129fd685f442ca4df759dd55ec01b.databases.appdomain.cloud:3400, connecting to mongodb://$USERNAME:$PASSWORD@e07eca23-91af-413b-8bf6-3e3f9825717c-0.497129fd685f442ca4df759dd55ec01b.databases.appdomain.cloud:31892,e07eca23-91af-413b-8bf6-3e3f9825717c-1.497129fd685f442ca4df759dd55ec01b.databases.appdomain.cloud:31892/ibmclouddb?authSource=admin&replicaSet=replset
(node:20293) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'onOpen' of undefined
at /home/pavlo/prj/innovate-digital-bank/accounts/server.js:12:16
at promise.then.err (/home/pavlo/prj/innovate-digital-bank/accounts/node_modules/mongoose/lib/connection.js:394:53)
at
at runMicrotasksCallback (internal/process/next_tick.js:121:5)
at _combinedTickCallback (internal/process/next_tick.js:131:7)
at process._tickCallback (internal/process/next_tick.js:180:9)
at Function.Module.runMain (module.js:695:11)
at startup (bootstrap_node.js:188:16)
at bootstrap_node.js:609:3

What I'm doing wrong and how to resolve it?
Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions