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

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

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • 2.5.5
    • 2.5.4
    • Logging, Security, Usability
    • None
    • Fully Compatible

    Description

      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') }

      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: