Wrong error message when connecting MongoDB

I’m using the latest version of Dremio. I wanted to connect Dremio with an Atlas MongoDB. This is sharded so you have to enter all mongos hosts. This is fine and in the tooltip.

However the primary has to be the first one - which was not clear to me. If you don’t do this you get error message

Could not authenticate user dremio for database admin

Which is clearly wrong.

You have to enable encryption. If you don’t do this you get the error message

Could not authenticate user dremio for database admin

On my deploy machine the company firewall blocked port 27017 which I didn’t know. Guess what error message you get:

Could not authenticate user dremio for database admin

The logs show:

2025-06-04 17:42:03,058 [source-management357] ERROR c.d.p.mongo.MongoDocumentHelper - Failed to run command Document{{ping=1}}, exception : com.mongodb.MongoTimeoutException: Timed out after 5000 ms while waiting for a server that matches ReadPreferenceServerSelector{readPreference=primary}. Client view of cluster state is …]

And Dremio turns this into error:

2025-06-04 17:42:03,058 [source-management357] ERROR c.d.p.mongo.MongoDocumentHelper - Mongo command returned with invalid return code (not OK), Could not authenticate user dremio for database admin : {“Exception”: "com.mongodb.MongoTimeoutException: Timed out after 5000 ms while waiting for a server that matches ReadPreferenceServerSelector{readPreference=primary}. Client view of cluster state is … }

The user experience could be improved tremendously by displaying the correct error messages and thus saving the user a lot of time.