[SERVER-12194] Better error message when invalid role document encountered while building role graph Created: 23/Dec/13  Updated: 11/Jul/16  Resolved: 14/Jan/14

Status: Closed
Project: Core Server
Component/s: Logging, Security, Usability
Affects Version/s: 2.5.4
Fix Version/s: 2.5.5

Type: Improvement Priority: Major - P3
Reporter: Spencer Brody (Inactive) Assignee: Spencer Brody (Inactive)
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Participants:

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



 Comments   
Comment by Githook User [ 14/Jan/14 ]

Author:

{u'username': u'stbrody', u'name': u'Spencer T Brody', u'email': u'spencer@10gen.com'}

Message: SERVER-12194 Better error message when an invalid role is encountered during role graph initialization
Branch: master
https://github.com/mongodb/mongo/commit/5faea8c7afbeaf271539e536dd9fee7f5be8723e

Generated at Thu Feb 08 03:27:52 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.