Uploaded image for project: 'MongoDB Shell'
  1. MongoDB Shell
  2. MONGOSH-901

--host does not work like in legacy shell

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 1.0.1
    • Affects Version/s: None
    • Component/s: Connectivity
    • Labels:
      None
    • Not Needed
    • Iteration Geneva

      There seem to be at least two problems here:

      1. mongosh requires a replica set name in order to accept multiple hosts in --host:

      $ mongo --username anna2 --password [...] --host host2:27017,host1:27017,host0:27017 --tls
      MongoDB shell version v4.4.1
      connecting to: mongodb://host2:27017,host1:27017,host0:27017/?compressors=disabled&gssapiServiceName=mongodb
      Implicit session: session { "id" : UUID("fb634dc8-c03a-43f6-8271-b3b85c697817") }
      MongoDB server version: 4.4.6
      MongoDB Enterprise mongosh-shard-0:SECONDARY> 
      bye
      $ mongosh --username anna2 --password [...] --host host2:27017,host1:27017,host0:27017 --tls
      MongoshInvalidInputError: [COMMON-10001] The --host argument contains an invalid character: ,
      

      2. mongosh fails to authenticate properly when a replset name is used:

      $ /tmp/mongosh-1.0.0-linux-x64/bin/mongosh --username anna2 --password XYYZRALJUSNFKBbq --host mongosh-shard-0/host2:27017,host1:27017,host0:27017 --tls
      Current Mongosh Log ID:	60ef01f342d74576e83ad11f
      Connecting to:		mongodb://host2:27017,host1:27017,host0:27017/test?replicaSet=mongosh-shard-0
      MongoServerError: Authentication failed.
      

            Assignee:
            michael.rose@mongodb.com Michael Rose (Inactive)
            Reporter:
            anna.henningsen@mongodb.com Anna Henningsen
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: