[SERVER-49488] Mongo shell is conflating authentication & network errors Created: 13/Jul/20  Updated: 17/Sep/20  Resolved: 20/Aug/20

Status: Closed
Project: Core Server
Component/s: Networking, Shell
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: Adinoyi Omuya Assignee: Robert Guo (Inactive)
Resolution: Won't Fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Related
related to SERVER-49402 Misleading error message when connect... Closed
Backport Requested:
v4.4
Sprint: STM 2020-08-10, STM 2020-08-24
Participants:
Story Points: 1

 Description   

The mongo shell attempts to authenticate right after it connects to a server and returns an exception if it's unable to. This means that if the client credentials are invalid, it will interpret that as a connection failure and raise an exception.

It is unexpected that the shell would conflate an authentication problem with the general class of network connection failures. Here's what clients see when all that's wrong is invalid credentials:

*** It looks like this is a MongoDB Atlas cluster. Please ensure that your IP whitelist allows connections from your network.

It's unclear to me if this is expected behavior (it's confusing at best). If so, using a more generic error message instead of specifically offering that clients check their IP allowlist would be less confusing to users. If not, we should fix it.



 Comments   
Comment by Githook User [ 17/Sep/20 ]

Author:

{'name': 'Robert Guo', 'email': 'robert.guo@10gen.com', 'username': 'guoyr'}

Message: SERVER-49488 update shell error message for ADL

(cherry picked from commit e4aa1021d6e126b46f334d3354c97f052e3d4561)
Branch: v4.4
https://github.com/mongodb/mongo/commit/6570f1a329ecc5d2f3b5b89dc06f7052b465faf6

Comment by Robert Guo (Inactive) [ 20/Aug/20 ]

Sounds good. Thanks Wisdom!

Comment by Adinoyi Omuya [ 20/Aug/20 ]

I think this ticket is still applicable but it is relatively minor so I'm happy if y'all want to close it as "Won't Fix" - especially if it's not an issue in mongosh.

Comment by Robert Guo (Inactive) [ 20/Aug/20 ]

adinoyi.omuya Since you mentioned in SERVER-49402 that we want to keep the "allow connections" error message, is this ticket still applicable? Note that the shell can't easily distinguish between different reasons for connection failures since the error message is coming from the Server

Comment by Brooke Miller [ 14/Jul/20 ]

Regardless of whether you get the same error message, we will update this message to 'You have failed to connect to an Atlas Cluster.'

Generated at Thu Feb 08 05:19:58 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.