mongo-express / mongo-express-docker

a dockerized mongo-express for viewing mongoDB in the browser
MIT License
201 stars 93 forks source link

Could not connect to database using connectionString: mongodb://mongo:27017 #88

Closed Ganesh-Ponipireddy closed 1 year ago

Ganesh-Ponipireddy commented 1 year ago

I'm unable to run the mongo-express in the local environment. I had attached the my docker file along this. Requesting you please help me here.

Welcome to mongo-express
mongo-express_1  | ------------------------
mongo-express_1  | 
mongo-express_1  | 
mongo-express_1  | (node:9) [MONGODB DRIVER] Warning: Current Server Discovery and Monitoring engine is deprecated, and will be removed in a future version. To use the new Server Discover and Monitoring engine, pass option { useUnifiedTopology: true } to the MongoClient constructor.
mongo-express_1  | Could not connect to database using connectionString: mongodb://mongo:27017"
mongo-express_1  | (node:9) UnhandledPromiseRejectionWarning: MongoNetworkError: failed to connect to server [mongo:27017] on first connect [Error: getaddrinfo ENOTFOUND mongo
mongo-express_
[mongodb.txt](https://github.com/mongo-express/mongo-express-docker/files/9868626/mongodb.txt)
1  |     at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:66:26) {
mongo-express_1  |   name: 'MongoNetworkError'
mongo-express_1  | }]
mongo-express_1  |     at Pool.<anonymous> (/node_modules/mongodb/lib/core/topologies/server.js:441:11)
mongo-express_1  |     at Pool.emit (events.js:314:20)
mongo-express_1  |     at /node_modules/mongodb/lib/core/connection/pool.js:564:14
mongo-express_1  |     at /node_modules/mongodb/lib/core/connection/pool.js:1000:11
mongo-express_1  |     at /node_modules/mongodb/lib/core/connection/connect.js:32:7
mongo-express_1  |     at callback (/node_modules/mongodb/lib/core/connection/connect.js:300:5)
mongo-express_1  |     at Socket.<anonymous> (/node_modules/mongodb/lib/core/connection/connect.js:330:7)
mongo-express_1  |     at Object.onceWrapper (events.js:421:26)
mongo-express_1  |     at Socket.emit (events.js:314:20)
mongo-express_1  |     at emitErrorNT (internal/streams/destroy.js:92:8)
mongo-express_1  |     at emitErrorAndCloseNT (internal/streams/destroy.js:60:3)
mongo-express_1  |     at processTicksAndRejections (internal/process/task_queues.js:84:21)
mongo-express_1  | (node:9) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
mongo-express_1  | (node:9) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
docker-compose_mongo-express_1 exited with code 0
Ganesh-Ponipireddy commented 1 year ago

fixed the issue by updating the my docker file.

sezanzeb commented 1 year ago

fixed the issue by updating the my docker file.

Please always explain your changes and the root cause in more detail, so that other people can learn something.