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

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Done
    • Priority: Major - P3
    • 2.5.5
    • Affects Version/s: 2.5.4
    • Component/s: Security, Sharding, Usability
    • None
    • Fully Compatible
    • ALL
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      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
      

            Assignee:
            Spencer Brody (Inactive)
            Reporter:
            Spencer Brody (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: