MongoDB atlas stopped working on replit (Python, pymongo)

Same problem in hackerplan. But works perfectly in free plan.

Then, What is the benefit of Pro member?!

Fix it please.
Link to my repl:

1 Like

i have the same problem, is this bug is going to be fixed or what? if yes, please fix it ASAP, im begging…


My repls are running as okay! :")

Thanks replit team. <3


Great to hear @NafisAfzal2017!

We’re working on a fix!

1 Like

Replit staff member ^^. So that may be the fix


@not-ethan that’s not the fix :slight_smile: we’re working on a fix for the Mongo not connecting issue


Bardia, it worked for 48 hours and broke again this morning. What’s going on! :smiling_face_with_tear:

When can we expect a fix?

We have our engineering team working on it right now. Hopefully by the end of the week, maybe next week. Sorry for the disruption to our services!


Same here, it didn’t work, then worked for a while, and now doesn’t work.

I have a fix that works for me. I imported dns and my problems were resolved

import os
import dns
os.system("python -m pip install \"pymongo[srv]\"")
import pymongo
1 Like

Update: We are still digging into this issue


I’m also having Server selection error using Node.js. I think is something related to name resolution in the container.

I don’t do mongo, but see if this code works around the issue. It’s meant to switch the IP when the error happens

const { MongoClient, MongooseServerSelectionError } = require("mongodb");
// minimal webserver if you don't already serve a website
  .createServer((_, r) => r.end())
try {
  // whatever code you use to connect, like
  await new MongoClient(yourConnectionURI).connect();
} catch (err) {
  if (err instanceof MongooseServerSelectionError) {
    require("https").get(`https://${process.env.REPL_ID}`, () =>

This exact error randomly showed up on my repl today after no changes and having worked flawlessly for months.

Is there a solution for this? Python with PyMongo?


Yep started again for me too yesterday

again, no experience with mongo but

import pymongo, os, multiprocessing
from pymongo import errors
from urllib import request
from http import server

# minimal server for if your code isn't already serving a website before you connect to mongodb
class Server(server.BaseHTTPRequestHandler):
    # Do this to override the log_request function to prevent spammy logging output
    def log_request(_, __):

    def do_HEAD(self):

    do_GET = do_HEAD

    target=server.ThreadingHTTPServer(("", 80), Server).serve_forever
    # connect to mongo here, e.g.
    client = pymongo.MongoClient(
except errors.ServerSelectionTimeoutError:
    os.kill(1, 1)
1 Like

I’m now getting mongodb errors again (node.js), with Internal Server Error and Unknown system error -122. Looks like this issue wasn’t fully fixed and a timeframe on when this could be resolved would be great.

1 Like

Is there any update to this? Is it working again for anyone?

1 Like

No, it’s still a common error.

1 Like