mongo atlas connection troubles

Viewed 103

I have an app, created in meteor.js but it shouldn't be important i think. I have also mongo cluster on mongo atlas. So far during development i connected to db by connection string without problem from my local machine. However when i created linux machine on DigitalOcean and tried to connect my app using same connection string mongodb+srv://<user>:<password>@xyz.mongodb.net/<dbName>?retryWrites=true&w=majority

I got the following error.

MongoNetworkError: failed to connect to server [xyz.mongodb.net:27017] on first connect [MongoNetworkError: connection 5 to xyz.mongodb.net:27017 closed
    at TLSSocket.<anonymous> (/home/ubuntu/staging/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/core/connection/connection.js:440:9)
    at Object.onceWrapper (events.js:421:26)
    at TLSSocket.emit (events.js:314:20)
    at TLSSocket.EventEmitter.emit (domain.js:483:12)
    at net.js:675:12
    at TCP.done (_tls_wrap.js:568:7)]
    at Pool.<anonymous> (/home/ubuntu/staging/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/core/topologies/server.js:438:11)
    at Pool.emit (events.js:314:20)
    at Pool.EventEmitter.emit (domain.js:483:12)
    at /home/ubuntu/staging/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/core/connection/pool.js:562:14
    at /home/ubuntu/staging/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/core/connection/pool.js:1009:9
    at callback (/home/ubuntu/staging/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/core/connection/connect.js:75:5)
    at /home/ubuntu/staging/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/core/connection/connect.js:101:9
    at _callback (/home/ubuntu/staging/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/core/connection/connection.js:329:7)
    at Connection.errorHandler (/home/ubuntu/staging/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/core/connection/connection.js:344:7)
    at Object.onceWrapper (events.js:421:26)
    at Connection.emit (events.js:314:20)
    at Connection.EventEmitter.emit (domain.js:483:12)
    at TLSSocket.<anonymous> (/home/ubuntu/staging/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/core/connection/connection.js:438:12)
    at Object.onceWrapper (events.js:421:26)
    at TLSSocket.emit (events.js:314:20)
    at TLSSocket.EventEmitter.emit (domain.js:483:12)

Do you have any idea of what could be wrong with me server config? I guess it is server config as on other machine same connection string works.

0 Answers
Related