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

Cannot use TLS with readPreference={mode: "secondary"} without specifying --ssl to mongo shell

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 4.0.7
    • Affects Version/s: 3.6.10, 4.0.5
    • Component/s: Shell
    • Labels:
      None
    • Fully Compatible
    • ALL
    • Service Arch 2019-01-28, Service Arch 2019-02-11, Service Arch 2019-02-25, Service Arch 2019-03-11

      It appears that when using a replica set connection string, the --ssl option is required in order to get the mongo shell to connect to the nodes using TLS. This issue reproduces with the 3.6 and 4.0 versions of the mongo shell but not the master version of the mongo shell.

      [js_test:explain_shell_helpers] 2019-01-18T14:31:03.881-0500 2019-01-18T14:31:03.880-0500 I NETWORK  [thread1] Marking host demo36-shard-00-01-3shst.mongodb.net:27017 as failed :: caused by :: Location11002: socket exception [CONNECT_ERROR] for demo36-shard-00-01-3shst.mongodb.net:27017
      [js_test:explain_shell_helpers] 2019-01-18T14:31:03.904-0500 2019-01-18T14:31:03.903-0500 I NETWORK  [thread1] Marking host demo36-shard-00-00-3shst.mongodb.net:27017 as failed :: caused by :: Location11002: socket exception [CONNECT_ERROR] for demo36-shard-00-00-3shst.mongodb.net:27017
      [js_test:explain_shell_helpers] 2019-01-18T14:31:03.943-0500 2019-01-18T14:31:03.943-0500 I NETWORK  [thread1] Marking host demo36-shard-00-00-3shst.mongodb.net:27017 as failed :: caused by :: Location11002: socket exception [CONNECT_ERROR] for demo36-shard-00-00-3shst.mongodb.net:27017
      [js_test:explain_shell_helpers] 2019-01-18T14:31:03.944-0500 2019-01-18T14:31:03.943-0500 E QUERY    [thread1] Error: Could not satisfy $readPreference of '{ mode: "secondary", tags: [] }' while attempting to run command explain :
      [js_test:explain_shell_helpers] 2019-01-18T14:31:03.944-0500 runClientFunctionWithRetries@src/mongo/shell/session.js:329:27
      [js_test:explain_shell_helpers] 2019-01-18T14:31:03.944-0500 runCommand@src/mongo/shell/session.js:423:25
      [js_test:explain_shell_helpers] 2019-01-18T14:31:03.945-0500 DB.prototype._runCommandImpl@src/mongo/shell/db.js:145:16
      [js_test:explain_shell_helpers] 2019-01-18T14:31:03.945-0500 DB.prototype.runCommand@src/mongo/shell/db.js:161:20
      [js_test:explain_shell_helpers] 2019-01-18T14:31:03.945-0500 DB.prototype.runReadCommand@src/mongo/shell/db.js:139:16
      [js_test:explain_shell_helpers] 2019-01-18T14:31:03.945-0500 constructor/this.finish@src/mongo/shell/explain_query.js:164:21
      [js_test:explain_shell_helpers] 2019-01-18T14:31:03.946-0500 @jstests/core/explain_shell_helpers.js:168:11
      [js_test:explain_shell_helpers] 2019-01-18T14:31:03.946-0500 failed to load: jstests/core/explain_shell_helpers.js
      

            Assignee:
            mathias@mongodb.com Mathias Stearn
            Reporter:
            max.hirschhorn@mongodb.com Max Hirschhorn
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: