Intermittent MongoServerSelectionError when connecting from NodeJS using Google Cloud Run + MongoDB Atlas

Has this issue been resolved for you? I’m having the same issue, of intermittent connectivity due to a timeout, but mine is happening from a DigitalOcean droplet. I’ve tried almost everything, except use Mongoose.

For my setup:

  • using MongoDB Atlas M0, 4.2.11
  • mongodb native driver 3.6.3