Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-38625

Improve shell error handling when Atlas user has not configured IP Whitelisting

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 4.1.9, 4.0.10
    • Affects Version/s: None
    • Component/s: Shell
    • None
    • Fully Compatible
    • v4.0
    • Service Arch 2019-02-11, Service Arch 2019-02-25, Service Arch 2019-03-11, Service Arch 2019-03-25

      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 

            Assignee:
            mathias@mongodb.com Mathias Stearn
            Reporter:
            dan@mongodb.com Daniel Pasette (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            11 Start watching this issue

              Created:
              Updated:
              Resolved: