Compass connects to database, but MongoSH Beta window does not

I have two clusters (one development, one production). The dev cluster is M30, v4.4.6; the prod cluster is M40, v4.4.6. They have the same network access rules.

I can connect to the dev cluster using Compass, and the MongoSH Beta terminal in Compass connects as well. The command prompt is “Enterprise atlas-xxxx-shard-0 [primary] >”.

I can also connect to the prod cluster using Compass, but the MongoSH Beta terminal in Compass does not connect. The command prompt is “>” and no command works; all give the following error message: “MongoServerSelectionError: Server selection timed out after 30000 ms”. I do not understand why Compass itself can connect to the database, but the mongo shell in Compass cannot.

Hey @Jeffrey_Pinyan! This definitely sounds like a bug. We would like to get some additional info to help us investigate. Can you please share connection information for both clusters (excluding all personal information of course) and also can you please tell us if this happens consistently with those two clusters for you?

Connection information being the full hostname and port?

This is happening consistently: we have never noticed any problems getting mongo shell in Compass to work with the dev cluster, and the problem on the prod cluster has been constant since at least May 7.

We are mostly interesting in connection options, the query params that are part of connection string, it would also help to know if you are using an srv record to connect or directly connecting to one of the nodes. What version of Compass are you on? There were no GA Compass releases around 7th of May, the last one was in April, so if you haven’t updated Compass around this date, maybe something changed in your prod cluster configuration?

This is Compass 1.26.1 (the latest stable release, I think?).

Connecting to the dev cluster via: mongodb+srv://user:pass@XXX.XXX.mongodb.net/test?authSource=admin&replicaSet=atlas-XXX-shard-0&w=majority&readPreference=primary&appname=MongoDB%20Compass&retryWrites=true&ssl=true

Connecting to the prod cluster via: mongodb+srv://user:pass@XXX.XXX.mongodb.net/test?authSource=admin&replicaSet=XXX-XXX-shard-0&w=majority&readPreference=primary&appname=MongoDB%20Compass&retryWrites=true&ssl=true

I note that the replicaSet name is differently formatted for dev than for prod.

Yeah, you’re right 1.26.1 is the latest stable one and as I mentioned was released in April. Hmm, nothing jumps out as suspicious when looking at the connection info, it’s the same except this replicaSet difference that you spotted.

So just for some context, from 1.26.1 mongosh beta is using Node.js driver 4 (which is also a beta at the moment) internally and it might be the root cause for the issue, although it’s still weird that this started happening for you later than the actual Compass update. If it’s not too much work can you try connecting to your production cluster (the one that times out in Compass) with mongosh CLI and tell us if it works?