[SERVER-38625] Improve shell error handling when Atlas user has not configured IP Whitelisting Created: 13/Dec/18  Updated: 29/Oct/23  Resolved: 11/Mar/19

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

Type: Improvement Priority: Major - P3
Reporter: Daniel Pasette (Inactive) Assignee: Mathias Stearn
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Problem/Incident
is caused by SERVER-39186 Shell should strip trailing dot from ... Closed
Related
is related to SERVER-7741 Suppress ReplicaSetMonitorWatcher log... Closed
Backwards Compatibility: Fully Compatible
Backport Requested:
v4.0
Sprint: Service Arch 2019-02-11, Service Arch 2019-02-25, Service Arch 2019-03-11, Service Arch 2019-03-25
Participants:

 Description   

When a user forgets to set up proper IP Whitelisting with their atlas cluster, it would be nice if the error message was more user friendly.  It could check that the hostname in the URI ended with "mongodb.net" and even suggest that this might be the problem, as the current error message gives users no clue as to what the problem might be.

Current output:

dan:(git)mongo[master]/$ ~/dist/4.0.3/bin/mongo "mongodb+srv://surflog-u9fko.mongodb.net/test" --username dan
MongoDB shell version v4.0.3
Enter password:
connecting to: mongodb+srv://surflog-u9fko.mongodb.net/test
2018-12-13T16:41:35.210-0500 I NETWORK  [js] Starting new replica set monitor for surflog-shard-0/surflog-shard-00-00-u9fko.mongodb.net.:27017,surflog-shard-00-02-u9fko.mongodb.net.:27017,surflog-shard-00-01-u9fko.mongodb.net.:27017
2018-12-13T16:41:35.282-0500 W NETWORK  [js] Unable to reach primary for set surflog-shard-0
2018-12-13T16:41:35.282-0500 I NETWORK  [js] Cannot reach any nodes for set surflog-shard-0. Please check network connectivity and the status of the set. This has happened for 1 checks in a row.
2018-12-13T16:41:35.860-0500 W NETWORK  [js] Unable to reach primary for set surflog-shard-0
2018-12-13T16:41:35.860-0500 I NETWORK  [js] Cannot reach any nodes for set surflog-shard-0. Please check network connectivity and the status of the set. This has happened for 2 checks in a row.
2018-12-13T16:41:36.439-0500 W NETWORK  [js] Unable to reach primary for set surflog-shard-0
2018-12-13T16:41:36.439-0500 I NETWORK  [js] Cannot reach any nodes for set surflog-shard-0. Please check network connectivity and the status of the set. This has happened for 3 checks in a row.
2018-12-13T16:41:37.018-0500 W NETWORK  [js] Unable to reach primary for set surflog-shard-0
2018-12-13T16:41:37.018-0500 I NETWORK  [js] Cannot reach any nodes for set surflog-shard-0. Please check network connectivity and the status of the set. This has happened for 4 checks in a row.
2018-12-13T16:41:37.596-0500 W NETWORK  [js] Unable to reach primary for set surflog-shard-0
2018-12-13T16:41:37.596-0500 I NETWORK  [js] Cannot reach any nodes for set surflog-shard-0. Please check network connectivity and the status of the set. This has happened for 5 checks in a row.
2018-12-13T16:41:38.175-0500 W NETWORK  [js] Unable to reach primary for set surflog-shard-0
2018-12-13T16:41:38.175-0500 I NETWORK  [js] Cannot reach any nodes for set surflog-shard-0. Please check network connectivity and the status of the set. This has happened for 6 checks in a row.
2018-12-13T16:41:38.753-0500 W NETWORK  [js] Unable to reach primary for set surflog-shard-0
2018-12-13T16:41:38.753-0500 I NETWORK  [js] Cannot reach any nodes for set surflog-shard-0. Please check network connectivity and the status of the set. This has happened for 7 checks in a row.
2018-12-13T16:41:39.332-0500 W NETWORK  [js] Unable to reach primary for set surflog-shard-0
2018-12-13T16:41:39.332-0500 I NETWORK  [js] Cannot reach any nodes for set surflog-shard-0. Please check network connectivity and the status of the set. This has happened for 8 checks in a row.
2018-12-13T16:41:39.911-0500 W NETWORK  [js] Unable to reach primary for set surflog-shard-0
2018-12-13T16:41:39.911-0500 I NETWORK  [js] Cannot reach any nodes for set surflog-shard-0. Please check network connectivity and the status of the set. This has happened for 9 checks in a row.
2018-12-13T16:41:40.490-0500 W NETWORK  [js] Unable to reach primary for set surflog-shard-0
2018-12-13T16:41:40.490-0500 I NETWORK  [js] Cannot reach any nodes for set surflog-shard-0. Please check network connectivity and the status of the set. This has happened for 10 checks in a row.
2018-12-13T16:41:41.068-0500 W NETWORK  [js] Unable to reach primary for set surflog-shard-0
2018-12-13T16:41:41.068-0500 I NETWORK  [js] Cannot reach any nodes for set surflog-shard-0. Please check network connectivity and the status of the set. This has happened for 11 checks in a row.
2018-12-13T16:41:41.646-0500 W NETWORK  [js] Unable to reach primary for set surflog-shard-0
2018-12-13T16:41:42.225-0500 W NETWORK  [js] Unable to reach primary for set surflog-shard-0
2018-12-13T16:41:42.803-0500 W NETWORK  [js] Unable to reach primary for set surflog-shard-0
2018-12-13T16:41:43.381-0500 W NETWORK  [js] Unable to reach primary for set surflog-shard-0
2018-12-13T16:41:43.959-0500 W NETWORK  [js] Unable to reach primary for set surflog-shard-0
2018-12-13T16:41:44.537-0500 W NETWORK  [js] Unable to reach primary for set surflog-shard-0
2018-12-13T16:41:45.114-0500 W NETWORK  [js] Unable to reach primary for set surflog-shard-0
2018-12-13T16:41:45.693-0500 W NETWORK  [js] Unable to reach primary for set surflog-shard-0
2018-12-13T16:41:46.272-0500 W NETWORK  [js] Unable to reach primary for set surflog-shard-0
2018-12-13T16:41:46.852-0500 W NETWORK  [js] Unable to reach primary for set surflog-shard-0
2018-12-13T16:41:46.852-0500 I NETWORK  [js] Cannot reach any nodes for set surflog-shard-0. Please check network connectivity and the status of the set. This has happened for 21 checks in a row.
2018-12-13T16:41:47.432-0500 W NETWORK  [js] Unable to reach primary for set surflog-shard-0
2018-12-13T16:41:48.012-0500 W NETWORK  [js] Unable to reach primary for set surflog-shard-0
2018-12-13T16:41:48.591-0500 W NETWORK  [js] Unable to reach primary for set surflog-shard-0
2018-12-13T16:41:49.170-0500 W NETWORK  [js] Unable to reach primary for set surflog-shard-0
2018-12-13T16:41:49.750-0500 W NETWORK  [js] Unable to reach primary for set surflog-shard-0
2018-12-13T16:41:49.750-0500 E QUERY    [js] Error: connect failed to replica set surflog-shard-0/surflog-shard-00-00-u9fko.mongodb.net.:27017,surflog-shard-00-02-u9fko.mongodb.net.:27017,surflog-shard-00-01-u9fko.mongodb.net.:27017 :
connect@src/mongo/shell/mongo.js:257:13
@(connect):1:6
exception: connect failed 



 Comments   
Comment by Githook User [ 02/May/19 ]

Author:

{'email': 'mathias@10gen.com', 'name': 'Mathias Stearn', 'username': 'RedBeard0531'}

Message: SERVER-38625 When the shell fails to connect to an Atlas cluster, tell the user to check their IP whitelist

(cherry picked from commit ef5c6c6f837cc317bd048db29948ca387517ef25)
Branch: v4.0
https://github.com/mongodb/mongo/commit/9bd646a2fb193698e40ae284f1f95bd70e8b55a4

Comment by Githook User [ 11/Mar/19 ]

Author:

{'name': 'Mathias Stearn', 'email': 'mathias@10gen.com', 'username': 'RedBeard0531'}

Message: SERVER-38625 When the shell fails to connect to an Atlas cluster, tell the user to check their IP whitelist
Branch: master
https://github.com/mongodb/mongo/commit/ef5c6c6f837cc317bd048db29948ca387517ef25

Generated at Thu Feb 08 04:49:29 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.