mongo-express / mongo-express

Web-based MongoDB admin interface, written with Node.js and express
MIT License
5.51k stars 952 forks source link

Fails to connect to azure cosmos db mongodb instances #825

Open ashinzekene opened 2 years ago

ashinzekene commented 2 years ago

Steps to reproduce

  1. Create an azure cosmos db mongodb instances
  2. Get connection string
  3. npm i mongo-express
  4. mongo-express --url connection-string-from-azure
  5. Same connection string works on MongoDB compass

Error

Could not connect to database using connectionString: mongodb://username:password@mongodb-server.mongo.cosmos.azure.com:10255?ssl=True"
/Users/ashinzekene/code/projects/uca/sample-mongo-express/node_modules/mongodb/lib/core/topologies/server.js:441
          new MongoNetworkError(
          ^

MongoNetworkError: failed to connect to server [mongodb-server.mongo.cosmos.azure.com:10255] on first connect [MongoNetworkTimeoutError: connection 0 to mongodb-server.mongo.cosmos.azure.com:10255 timed out
    at Socket.<anonymous> (/Users/ashinzekene/code/projects/uca/sample-mongo-express/node_modules/mongodb/lib/core/connection/connection.js:425:7)
    at Object.onceWrapper (node:events:509:28)
    at Socket.emit (node:events:390:28)
    at Socket._onTimeout (node:net:501:8)
    at listOnTimeout (node:internal/timers:568:17)
    at processTimers (node:internal/timers:510:7) {
  [Symbol(beforeHandshake)]: true
}]
    at Pool.<anonymous> (/Users/ashinzekene/code/projects/uca/sample-mongo-express/node_modules/mongodb/lib/core/topologies/server.js:441:11)
    at Pool.emit (node:events:390:28)
    at /Users/ashinzekene/code/projects/uca/sample-mongo-express/node_modules/mongodb/lib/core/connection/pool.js:564:14
    at /Users/ashinzekene/code/projects/uca/sample-mongo-express/node_modules/mongodb/lib/core/connection/pool.js:1000:11
    at callback (/Users/ashinzekene/code/projects/uca/sample-mongo-express/node_modules/mongodb/lib/core/connection/connect.js:75:5)
    at /Users/ashinzekene/code/projects/uca/sample-mongo-express/node_modules/mongodb/lib/core/connection/connect.js:103:9
    at _callback (/Users/ashinzekene/code/projects/uca/sample-mongo-express/node_modules/mongodb/lib/core/connection/connection.js:333:7)
    at Connection.errorHandler (/Users/ashinzekene/code/projects/uca/sample-mongo-express/node_modules/mongodb/lib/core/connection/connection.js:348:7)
    at Object.onceWrapper (node:events:510:26)
    at Connection.emit (node:events:390:28)
    at Socket.<anonymous> (/Users/ashinzekene/code/projects/uca/sample-mongo-express/node_modules/mongodb/lib/core/connection/connection.js:423:10)
    at Object.onceWrapper (node:events:509:28)
    at Socket.emit (node:events:390:28)
    at Socket._onTimeout (node:net:501:8)
    at listOnTimeout (node:internal/timers:568:17)
    at processTimers (node:internal/timers:510:7)

Node.js v17.3.0
brampurnot commented 2 years ago

Any solution you found for this? We are facing the same issue...

shakaran commented 1 year ago

@brampurnot @ashinzekene could you try with the latest 1.0.0 or even master?

anmoel commented 1 year ago

@shakaran we have the same error with the docker container in version 1.0.0

UnhandledPromiseRejectionWarning: MongoNetworkError: failed to connect to server [server.mongo.cosmos.azure.com:10255] on first connect [MongoNetworkTimeoutError: connection 0 to server.mongo.cosmos.azure.com:10255 timed out

vasilegroza commented 1 year ago

@brampurnot @ashinzekene could you try with the latest 1.0.0 or even master? Hi, I'm facing a similar issue with Oracle Autonomous Database (Oracle flavor of cosmos DB) the build from master seems to solve the issue, also, I've tried all 1.0.X releases(none of them worked). Can you do a release to DockerHub from the master? or at least give an estimate as to when a release will be made?

ariretiarno commented 10 months ago

any updates guys?