I am using Docker Desktop with WSL enabled. and I see following logs from express container:
Welcome to mongo-express 1.0.2
------------------------
Could not connect to database using connectionString: mongodb://admin:****@mongodb_1:27017/"
/app/node_modules/mongodb/lib/cmap/connection.js:227
callback(new error_1.MongoServerError(document));
^
MongoServerError: Authentication failed.
at Connection.onMessage (/app/node_modules/mongodb/lib/cmap/connection.js:227:30)
at MessageStream.<anonymous> (/app/node_modules/mongodb/lib/cmap/connection.js:60:60)
at MessageStream.emit (node:events:517:28)
at processIncomingData (/app/node_modules/mongodb/lib/cmap/message_stream.js:125:16)
at MessageStream._write (/app/node_modules/mongodb/lib/cmap/message_stream.js:33:9)
at writeOrBuffer (node:internal/streams/writable:392:12)
at _write (node:internal/streams/writable:333:10)
at Writable.write (node:internal/streams/writable:337:10)
at Socket.ondata (node:internal/streams/readable:809:22)
at Socket.emit (node:events:517:28) {
ok: 0,
code: 18,
codeName: 'AuthenticationFailed',
connectionGeneration: 0,
[Symbol(errorLabels)]: Set(2) { 'HandshakeError', 'ResetPool' }
}
Node.js v18.20.3
Waiting for mongo:27017...
/docker-entrypoint.sh: line 15: mongo: Name does not resolve
/docker-entrypoint.sh: line 15: /dev/tcp/mongo/27017: Invalid argument
Sat Feb 22 08:24:45 UTC 2025 retrying to connect to mongo:27017 (2/10)
/docker-entrypoint.sh: line 15: mongo: Name does not resolve
/docker-entrypoint.sh: line 15: /dev/tcp/mongo/27017: Invalid argument
Sat Feb 22 08:24:49 UTC 2025 retrying to connect to mongo:27017 (3/10)