1

I can successfully connect to a MongoDB database hosted on mLab from Google App Engine Standard (Node.js 8 runtime) using the 3.4+ driver.

But I can't connect to a MongoDB database hosted on MongoDB Atlas from Google App Engine Standard (Node.js 8 runtime) using both, 3.6+ driver as well as 3.4+ driver. The 3.4+ driver works for a while before failing.

I get the error "Error: querySrv ESERVFAIL _mongodb._tcp.xyz-wc7dj.gcp.mongodb.net"

3.6+ driver connection string:

mongodb+srv://username:password@xyz-wc7dj.gcp.mongodb.net/dbname?retryWrites=true

3.4+ driver connection string

mongodb://username:password@xyz-shard-00-00-wc7dj.gcp.mongodb.net:27017,xyz-shard-00-01-wc7dj.gcp.mongodb.net:27017,xyz-shard-00-02-wc7dj.gcp.mongodb.net:27017/dbname?ssl=true&replicaSet=xyz-shard-0&authSource=admin&retryWrites=true

Please help!

Raj Chaudhary
  • 1,444
  • 3
  • 16
  • 31
  • Have you set the IP whitelists to include the necessary range for Google App Engine ? – Wan B. Nov 06 '18 at 05:07
  • Possible duplicate of [Connect to MongoDB Atlas from Google App Engine](https://stackoverflow.com/questions/51946930/connect-to-mongodb-atlas-from-google-app-engine) – Jofre Nov 08 '18 at 11:45

0 Answers0