Better error message when invalid role document encountered while building role graph

XMLWordPrintableJSON

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

      If you insert an invalid document (such as {_id:1}) into the admin.system.roles collection, then when you start up mongod you get the following message in the logs

      warning: Skipping invalid role document.  NoSuchKey Missing expected field "role"; document { _id: ObjectId('52b89d3f891856e1f39f7d33') }
      

      Note that this message does not indicate anywhere what collection this document came from or what process was trying to read it.

      I propose changing the message to saying something like:

      warning: Skipping invalid admin.system.roles document while initializing role graph to calculate privileges for user-defined roles:  NoSuchKey Missing expected field "role"; document { _id: ObjectId('52b89d3f891856e1f39f7d33') }
      

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

              Created:
              Updated:
              Resolved: