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

Running auth upgrade step gives cryptic error and dumps stack if version doc and actual schema are out of sync

    XMLWordPrintableJSON

Details

    • ALL

    Description

      To reproduce:

      • Start a 2.6 mongod
      • Add a user with __system privileges
      • Manually reset the admin.system.version doc so that currentVersion == 1
      • Run the auth schema upgrade step

      The shell gives the cryptic error

      { "ok" : 0, "errmsg" : "wrong type for field (0) 3 != 2", "code" : 13111 }

      And mongod dumps stack:

       m27000| 2013-12-16T16:49:53.778-0500 [conn1] Assertion: 13111:wrong type for field (0) 3 != 2
       m27000| 2013-12-16T16:49:53.783-0500 [conn1] 0x100658a2b 0x100612f22 0x10060382f 0x10060390d 0x100591fa0 0x1000a9204 0x100040653 0x100033523 0x1000331f7 0x1000bd7b9 0x1000aad5b 0x10019fcd0 0x1001c4de5 0x1001c5b67 0x1001c67cc 0x10032c89e 0x10032d35c 0x1002b0886 0x100006e84 0x100620161
       m27000|  0   mongod                              0x0000000100658a2b _ZN5mongo15printStackTraceERSo + 43
       m27000|  1   mongod                              0x0000000100612f22 _ZN5mongo10logContextEPKc + 114
       m27000|  2   mongod                              0x000000010060382f _ZN5mongo11msgassertedEiPKc + 255
       m27000|  3   mongod                              0x000000010060390d _ZN5mongo11msgassertedEiRKSs + 29
       m27000|  4   mongod                              0x0000000100591fa0 _ZNK5mongo11BSONElement3chkEi + 800
       m27000|  5   mongod                              0x00000001000a9204 _ZN5mongo12_GLOBAL__N_118upgradeProcessUserEPNS_25AuthzManagerExternalStateERKNS_10StringDataERKNS_7BSONObjES8_ + 4164
       m27000|  6   mongod                              0x0000000100040653 _ZN5mongo20DBClientFunConvertorclERNS_27DBClientCursorBatchIteratorE + 231
       m27000|  7   mongod                              0x0000000100033523 _ZN5mongo12DBClientBase5queryEN5boost8functionIFvRNS_27DBClientCursorBatchIteratorEEEERKSsNS_5QueryEPKNS_7BSONObjEi + 249
       m27000|  8   mongod                              0x00000001000331f7 _ZN5mongo12DBClientBase5queryEN5boost8functionIFvRKNS_7BSONObjEEEERKSsNS_5QueryEPS4_i + 397
       m27000|  9   mongod                              0x00000001000bd7b9 _ZN5mongo31AuthzManagerExternalStateMongod5queryERKNS_15NamespaceStringERKNS_7BSONObjES6_RKN5boost8functionIFvS6_EEE + 347
       m27000|  10  mongod                              0x00000001000aad5b _ZN5mongo20AuthorizationManager17upgradeSchemaStepERKNS_7BSONObjEPb + 3035
       m27000|  11  mongod                              0x000000010019fcd0 _ZN5mongo24CmdAuthSchemaUpgradeStep3runERKSsRNS_7BSONObjEiRSsRNS_14BSONObjBuilderEb + 290
       m27000|  12  mongod                              0x00000001001c4de5 _ZN5mongo12_execCommandEPNS_7CommandERKSsRNS_7BSONObjEiRSsRNS_14BSONObjBuilderEb + 37
       m27000|  13  mongod                              0x00000001001c5b67 _ZN5mongo7Command11execCommandEPS0_RNS_6ClientEiPKcRNS_7BSONObjERNS_14BSONObjBuilderEb + 1865
       m27000|  14  mongod                              0x00000001001c67cc _ZN5mongo12_runCommandsEPKcRNS_7BSONObjERNS_11_BufBuilderINS_16TrivialAllocatorEEERNS_14BSONObjBuilderEbi + 1388
       m27000|  15  mongod                              0x000000010032c89e _ZN5mongo11runCommandsEPKcRNS_7BSONObjERNS_5CurOpERNS_11_BufBuilderINS_16TrivialAllocatorEEERNS_14BSONObjBuilderEbi + 46
       m27000|  16  mongod                              0x000000010032d35c _ZN5mongo8runQueryERNS_7MessageERNS_12QueryMessageERNS_5CurOpES1_ + 2204
       m27000|  17  mongod                              0x00000001002b0886 _ZN5mongo16assembleResponseERNS_7MessageERNS_10DbResponseERKNS_11HostAndPortE + 1958
       m27000|  18  mongod                              0x0000000100006e84 _ZN5mongo16MyMessageHandler7processERNS_7MessageEPNS_21AbstractMessagingPortEPNS_9LastErrorE + 308
       m27000|  19  mongod                              0x0000000100620161 _ZN5mongo17PortMessageServer17handleIncomingMsgEPv + 1681
       m27000| 2013-12-16T16:49:53.783-0500 [conn1] Auth schema upgraded failed with Unknown error code wrong type for field (0) 3 != 2

      Attached is a minimal reproducing case.

      Attachments

        Activity

          People

            spencer@mongodb.com Spencer Brody (Inactive)
            sam.helman@10gen.com sam.helman@10gen.com
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: