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

Assertion Failure when creating a user with any roles

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • ALL
    • Hide

      1. Start up mongod

      mongod --version
      db version v2.5.3-pre-
      2013-10-08T00:20:35.513+0000 git version: 2603ba8d2ae338e18635621dc0965965f0f9c5cb
      2013-10-08T00:20:35.513+0000 OpenSSL version: OpenSSL 0.9.8y 5 Feb 2013
      
      mongod --auth  --smallfiles --nojournal --dbpath data/db
      

      2. Fire up a mongo shell

      > use test
      switched to db test
      > db.runCommand({
      ...   "createUser":"luke",
      ...   "pwd":"lukepwd",
      ...   "roles":[ { name: 'readWrite', db: 'test', hasRole:true, canDelegate:true}, {name:'userAdminAnyDatabase', db:'admin', hasRole:true, canDelegate:true}]
      ... })
      {
      	"errmsg" : "exception: BSONElement: bad type 110",
      	"code" : 10320,
      	"ok" : 0
      }
      

      The mongod log has the following:

      2013-10-08T00:17:28.982+0000 [conn1] Attempting to lock user data for: Create user
      2013-10-08T00:17:28.982+0000 [conn1] Assertion: 10320:BSONElement: bad type 110
      2013-10-08T00:17:28.988+0000 [conn1] 0x107ced22b 0x107cabad2 0x107c9cd9f 0x107727ef8 0x107734f26 0x10775b6db 0x107725b18 0x107725cbd 0x107725989 0x1077256cd 0x1077bf234 0x1077add3f 0x10786e8c5 0x10789c155 0x10789cf06 0x10789db3c 0x1079ebe4e 0x1079ec93d 0x10798184a 0x1076fe784
       0   mongod                              0x0000000107ced22b _ZN5mongo15printStackTraceERSo + 43
       1   mongod                              0x0000000107cabad2 _ZN5mongo10logContextEPKc + 114
       2   mongod                              0x0000000107c9cd9f _ZN5mongo11msgassertedEiPKc + 255
       3   mongod                              0x0000000107727ef8 _ZNK5mongo11BSONElement4sizeEv + 664
       4   mongod                              0x0000000107734f26 _ZN5mongo14BSONObjBuilder8appendAsERKNS_11BSONElementERKNS_10StringDataE + 118
       5   mongod                              0x000000010775b6db _ZN5mongo16BSONArrayBuilder6appendERKNS_11BSONElementE + 83
       6   mongod                              0x0000000107725b18 _ZNK5mongo11mutablebson7Element12writeElementINS_16BSONArrayBuilderEEEvPT_PKNS_10StringDataE + 202
       7   mongod                              0x0000000107725cbd _ZNK5mongo11mutablebson7Element13writeChildrenINS_16BSONArrayBuilderEEEvPT_ + 73
       8   mongod                              0x0000000107725989 _ZNK5mongo11mutablebson7Element12writeElementINS_14BSONObjBuilderEEEvPT_PKNS_10StringDataE + 587
       9   mongod                              0x00000001077256cd _ZNK5mongo11mutablebson7Element13writeChildrenINS_14BSONObjBuilderEEEvPT_ + 75
       10  mongod                              0x00000001077bf234 _ZN5mongo31AuthzManagerExternalStateMongod18getRoleDescriptionERKNS_8RoleNameEPNS_7BSONObjE + 1912
       11  mongod                              0x00000001077add3f _ZN5mongo20AuthorizationManager18getRoleDescriptionERKNS_8RoleNameEPNS_7BSONObjE + 27
       12  mongod                              0x000000010786e8c5 _ZN5mongo13CmdCreateUser3runERKSsRNS_7BSONObjEiRSsRNS_14BSONObjBuilderEb + 2831
       13  mongod                              0x000000010789c155 _ZN5mongo12_execCommandEPNS_7CommandERKSsRNS_7BSONObjEiRSsRNS_14BSONObjBuilderEb + 37
       14  mongod                              0x000000010789cf06 _ZN5mongo7Command11execCommandEPS0_RNS_6ClientEiPKcRNS_7BSONObjERNS_14BSONObjBuilderEb + 1920
       15  mongod                              0x000000010789db3c _ZN5mongo12_runCommandsEPKcRNS_7BSONObjERNS_11_BufBuilderINS_16TrivialAllocatorEEERNS_14BSONObjBuilderEbi + 1388
       16  mongod                              0x00000001079ebe4e _ZN5mongo11runCommandsEPKcRNS_7BSONObjERNS_5CurOpERNS_11_BufBuilderINS_16TrivialAllocatorEEERNS_14BSONObjBuilderEbi + 46
       17  mongod                              0x00000001079ec93d _ZN5mongo8runQueryERNS_7MessageERNS_12QueryMessageERNS_5CurOpES1_ + 2301
       18  mongod                              0x000000010798184a _ZN5mongo16assembleResponseERNS_7MessageERNS_10DbResponseERKNS_11HostAndPortE + 1818
       19  mongod                              0x00000001076fe784 _ZN5mongo16MyMessageHandler7processERNS_7MessageEPNS_21AbstractMessagingPortEPNS_9LastErrorE + 308
      
      Show
      1. Start up mongod mongod --version db version v2.5.3-pre- 2013-10-08T00:20:35.513+0000 git version: 2603ba8d2ae338e18635621dc0965965f0f9c5cb 2013-10-08T00:20:35.513+0000 OpenSSL version: OpenSSL 0.9.8y 5 Feb 2013 mongod --auth --smallfiles --nojournal --dbpath data/db 2. Fire up a mongo shell > use test switched to db test > db.runCommand({ ... "createUser":"luke", ... "pwd":"lukepwd", ... "roles":[ { name: 'readWrite', db: 'test', hasRole:true, canDelegate:true}, {name:'userAdminAnyDatabase', db:'admin', hasRole:true, canDelegate:true}] ... }) { "errmsg" : "exception: BSONElement: bad type 110", "code" : 10320, "ok" : 0 } The mongod log has the following: 2013-10-08T00:17:28.982+0000 [conn1] Attempting to lock user data for: Create user 2013-10-08T00:17:28.982+0000 [conn1] Assertion: 10320:BSONElement: bad type 110 2013-10-08T00:17:28.988+0000 [conn1] 0x107ced22b 0x107cabad2 0x107c9cd9f 0x107727ef8 0x107734f26 0x10775b6db 0x107725b18 0x107725cbd 0x107725989 0x1077256cd 0x1077bf234 0x1077add3f 0x10786e8c5 0x10789c155 0x10789cf06 0x10789db3c 0x1079ebe4e 0x1079ec93d 0x10798184a 0x1076fe784 0 mongod 0x0000000107ced22b _ZN5mongo15printStackTraceERSo + 43 1 mongod 0x0000000107cabad2 _ZN5mongo10logContextEPKc + 114 2 mongod 0x0000000107c9cd9f _ZN5mongo11msgassertedEiPKc + 255 3 mongod 0x0000000107727ef8 _ZNK5mongo11BSONElement4sizeEv + 664 4 mongod 0x0000000107734f26 _ZN5mongo14BSONObjBuilder8appendAsERKNS_11BSONElementERKNS_10StringDataE + 118 5 mongod 0x000000010775b6db _ZN5mongo16BSONArrayBuilder6appendERKNS_11BSONElementE + 83 6 mongod 0x0000000107725b18 _ZNK5mongo11mutablebson7Element12writeElementINS_16BSONArrayBuilderEEEvPT_PKNS_10StringDataE + 202 7 mongod 0x0000000107725cbd _ZNK5mongo11mutablebson7Element13writeChildrenINS_16BSONArrayBuilderEEEvPT_ + 73 8 mongod 0x0000000107725989 _ZNK5mongo11mutablebson7Element12writeElementINS_14BSONObjBuilderEEEvPT_PKNS_10StringDataE + 587 9 mongod 0x00000001077256cd _ZNK5mongo11mutablebson7Element13writeChildrenINS_14BSONObjBuilderEEEvPT_ + 75 10 mongod 0x00000001077bf234 _ZN5mongo31AuthzManagerExternalStateMongod18getRoleDescriptionERKNS_8RoleNameEPNS_7BSONObjE + 1912 11 mongod 0x00000001077add3f _ZN5mongo20AuthorizationManager18getRoleDescriptionERKNS_8RoleNameEPNS_7BSONObjE + 27 12 mongod 0x000000010786e8c5 _ZN5mongo13CmdCreateUser3runERKSsRNS_7BSONObjEiRSsRNS_14BSONObjBuilderEb + 2831 13 mongod 0x000000010789c155 _ZN5mongo12_execCommandEPNS_7CommandERKSsRNS_7BSONObjEiRSsRNS_14BSONObjBuilderEb + 37 14 mongod 0x000000010789cf06 _ZN5mongo7Command11execCommandEPS0_RNS_6ClientEiPKcRNS_7BSONObjERNS_14BSONObjBuilderEb + 1920 15 mongod 0x000000010789db3c _ZN5mongo12_runCommandsEPKcRNS_7BSONObjERNS_11_BufBuilderINS_16TrivialAllocatorEEERNS_14BSONObjBuilderEbi + 1388 16 mongod 0x00000001079ebe4e _ZN5mongo11runCommandsEPKcRNS_7BSONObjERNS_5CurOpERNS_11_BufBuilderINS_16TrivialAllocatorEEERNS_14BSONObjBuilderEbi + 46 17 mongod 0x00000001079ec93d _ZN5mongo8runQueryERNS_7MessageERNS_12QueryMessageERNS_5CurOpES1_ + 2301 18 mongod 0x000000010798184a _ZN5mongo16assembleResponseERNS_7MessageERNS_10DbResponseERKNS_11HostAndPortE + 1818 19 mongod 0x00000001076fe784 _ZN5mongo16MyMessageHandler7processERNS_7MessageEPNS_21AbstractMessagingPortEPNS_9LastErrorE + 308

      Following the instructions at http://codereview.10gen.com/12205003/diff/7001/source/release-notes/2.6.txt, I am unable to create a user who has any roles.

            Assignee:
            andrew.morrow@mongodb.com Andrew Morrow (Inactive)
            Reporter:
            luke.lovett Luke Lovett
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: