[SERVER-12116] Running user commands with auth schema version as wrong type in db gives misleading error message Created: 16/Dec/13  Updated: 11/Jul/16  Resolved: 03/Mar/14

Status: Closed
Project: Core Server
Component/s: Security, Usability
Affects Version/s: 2.5.4
Fix Version/s: 2.6.0-rc1

Type: Bug Priority: Minor - P4
Reporter: sam.helman@10gen.com Assignee: Spencer Brody (Inactive)
Resolution: Done Votes: 0
Labels: 26qa
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: File auth_version_as_string.js    
Issue Links:
Related
Backwards Compatibility: Fully Compatible
Operating System: ALL
Participants:

 Description   

To reproduce:

  • Bring up a 2.6 node
  • Insert a user
  • Manually set the admin.system.version doc to have

    { currentVersion: '3' }

  • Run an authentication command, i.e usersInfo

The error message is a little misleading - it reports that the current schema version is 0, instead of the wrong type. It is conceivable that while running a downgrade someone could mistakenly set the value to a string type and get this error.

A js script to reproduce the error is attached.



 Comments   
Comment by Githook User [ 03/Mar/14 ]

Author:

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

Message: SERVER-12116 Return better messages to the user when the authz version field is the wrong type
Branch: master
https://github.com/mongodb/mongo/commit/803ae07cb3eb9cb9051995e9b2ac48958131fb3a

Comment by Andy Schwerin [ 10/Feb/14 ]

Two thoughts. First, can we replace "2" with the string name of the type – I'm pretty sure that the BSON library has a function for looking up string names of types.

And it would be preferable to return a more meaningful message to the user. They may not have easy access to the server logs.

Comment by Spencer Brody (Inactive) [ 05/Feb/14 ]

The message returned to the user is as you described, but there will also be a message logged on the server: "warning: Could not determine schema version of authorization data. TypeMismatch Bad (non-numeric) type 2 for currentVersion field in version document". schwerin, do you think that's sufficient?

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