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

Tab completion results in an authentication error

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 0.12.1
    • Affects Version/s: None
    • Component/s: Autocomplete, UI / UX
    • Labels:
      None
    • Not Needed
    • Iteration Athens

      Problem Description

      Received Tab completion error: MongoError: command listCollections requires authentication when trying to tab complete a command that doesn't require authentication

      Steps to Reproduce

      • Create a cluster and enable authentication
      • Start mongosh
      • Type db.is followed by TAB

      Expected Results

      It completes to db.isMaster

      Actual Results

      Enterprise [direct: mongos]> db.isTab completion error: MongoError: command listCollections requires authentication
          at MessageStream.messageHandler (/usr/local/Cellar/mongosh/0.12.0/libexec/lib/node_modules/@mongosh/cli-repl/node_modules/mongodb/lib/cmap/connection.js:440:30)
          at MessageStream.emit (events.js:315:20)
          at MessageStream.EventEmitter.emit (domain.js:467:12)
          at processIncomingData (/usr/local/Cellar/mongosh/0.12.0/libexec/lib/node_modules/@mongosh/cli-repl/node_modules/mongodb/lib/cmap/message_stream.js:107:16)
          at MessageStream._write (/usr/local/Cellar/mongosh/0.12.0/libexec/lib/node_modules/@mongosh/cli-repl/node_modules/mongodb/lib/cmap/message_stream.js:27:9)
          at writeOrBuffer (internal/streams/writable.js:358:12)
          at MessageStream.Writable.write (internal/streams/writable.js:303:10)
          at Socket.ondata (internal/streams/readable.js:719:22)
          at Socket.emit (events.js:315:20)
          at Socket.EventEmitter.emit (domain.js:467:12) {
        ok: 0,
        code: 13,
        codeName: 'Unauthorized',
        operationTime: Timestamp(1, 1619456122),
        '$clusterTime': {
          clusterTime: Timestamp(1, 1619456122),
          signature: {
            hash: Binary(Buffer.from("95829dd58334f88280c462962cf43f0f86c4d356", "hex"), 0),
            keyId: Long("6954434199851892737")
          }
        }
      }
      

       

       

      Additional Notes

            Assignee:
            anna.henningsen@mongodb.com Anna Henningsen
            Reporter:
            jeff.yemin@mongodb.com Jeffrey Yemin
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: