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

Improve error message on mongos when adding a user with a role that doesn't exist

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • 2.5.5
    • 2.5.4
    • Security, Sharding, Usability
    • None
    • Fully Compatible
    • ALL

    Description

      On mongod:

      > db.createUser({user: 'bob', pwd: 'pwd', roles: ['fakeRole']});
      2013-12-13T16:31:57.329-0500 Error: couldn't add user: No role named fakeRole@test at src/mongo/shell/db.js:1016

      On mongos:

      > db.createUser({user:'bob', pwd: 'pwd', roles:['fakeRole']})
      2013-12-13T16:30:35.561-0500 Error: couldn't add user: invalid parameter: expected an object () at src/mongo/shell/db.js:1016

      Attachments

        Activity

          People

            spencer@mongodb.com Spencer Brody (Inactive)
            spencer@mongodb.com Spencer Brody (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: