assertion 10320 BSONElement: bad type 113 when querying profile collection, db.system.profile.find()

匿名 (未验证) 提交于 2019-12-03 01:00:01

问题:

I am running Mongo 2.2.1 in ec2, I have enabled profiling and I'm sending a slow op summary every 180 sec to graphite. Every now and again the script reports an error (BSONElement: bad type 113) and if I log to the Mongo shell and run a db.system.profile.find() I get a more detailed report:

Mon Feb 18 09:12:48 Assertion: 10320:BSONElement: bad type 113 0x6073f1 0x5d1aa9 0x4b0d98 0x5c17a6 0x6b3f35 0x6b6a2c 0x69be0a 0x6aa13f 0x668e46 0x668ec2 0x66a2ce 0x5cbcc4 0x4a4a14 0x4a67e6 0x7f1519bb776d 0x49f669   mongo(_ZN5mongo15printStackTraceERSo+0x21) [0x6073f1]  mongo(_ZN5mongo11msgassertedEiPKc+0x99) [0x5d1aa9]  mongo(_ZNK5mongo11BSONElement4sizeEv+0x1d8) [0x4b0d98]  mongo(_ZN5mongo16resolveBSONFieldEP9JSContextP8JSObjectljPS3_+0x146) [0x5c17a6]  mongo(js_LookupPropertyWithFlags+0x3f5) [0x6b3f35]  mongo(js_GetProperty+0x7c) [0x6b6a2c]  mongo(js_Interpret+0x10ea) [0x69be0a]  mongo(js_Execute+0x36f) [0x6aa13f]  mongo(JS_EvaluateUCScriptForPrincipals+0x66) [0x668e46]  mongo(JS_EvaluateUCScript+0x22) [0x668ec2]  mongo(JS_EvaluateScript+0x6e) [0x66a2ce]  mongo(_ZN5mongo7SMScope4execERKNS_10StringDataERKSsbbbi+0x144) [0x5cbcc4]  mongo(_Z5_mainiPPc+0x26c4) [0x4a4a14]  mongo(main+0x26) [0x4a67e6]  /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xed) [0x7f1519bb776d]  mongo(__gxx_personality_v0+0x2a1) [0x49f669] Error: BSONElement: bad type 113 

In the logs I can see when the script has run and reported the error:

Mon Feb 18 09:26:21 [conn577444] Assertion: 10320:BSONElement: bad type 113 0xaf8c41 0xabedb9 0x570aab 0x7fc84c 0x7fe2ca 0x8057a7 0x806268 0x651171 0x82c71e 0x82c7d4 0x8318f6 0x8345f3 0x7b0b0d 0x7b20e2 0x56fe42 0xae6ed1 0x7f0eb2526e9a 0x7f0eb183c4bd   /opt/mongodb/bin/mongod(_ZN5mongo15printStackTraceERSo+0x21) [0xaf8c41]  /opt/mongodb/bin/mongod(_ZN5mongo11msgassertedEiPKc+0x99) [0xabedb9]  /opt/mongodb/bin/mongod(_ZNK5mongo11BSONElement4sizeEv+0x1cb) [0x570aab]  /opt/mongodb/bin/mongod(_ZNK5mongo7Matcher13matchesDottedEPKcRKNS_11BSONElementERKNS_7BSONObjEiRKNS_14ElementMatcherEbPNS_12MatchDetailsE+0x153c) [0x7fc84c]  /opt/mongodb/bin/mongod(_ZNK5mongo7Matcher7matchesERKNS_7BSONObjEPNS_12MatchDetailsE+0xfa) [0x7fe2ca]  /opt/mongodb/bin/mongod(_ZNK5mongo19CoveredIndexMatcher7matchesERKNS_7BSONObjERKNS_7DiskLocEPNS_12MatchDetailsEb+0xc7) [0x8057a7]  /opt/mongodb/bin/mongod(_ZNK5mongo19CoveredIndexMatcher14matchesCurrentEPNS_6CursorEPNS_12MatchDetailsE+0xa8) [0x806268]  /opt/mongodb/bin/mongod(_ZN5mongo6Cursor14currentMatchesEPNS_12MatchDetailsE+0x41) [0x651171]  /opt/mongodb/bin/mongod(_ZN5mongo20QueryResponseBuilder14currentMatchesERNS_12MatchDetailsE+0x1e) [0x82c71e]  /opt/mongodb/bin/mongod(_ZN5mongo20QueryResponseBuilder8addMatchEv+0x44) [0x82c7d4]  /opt/mongodb/bin/mongod(_ZN5mongo23queryWithQueryOptimizerEiRKSsRKNS_7BSONObjERNS_5CurOpES4_S4_RKN5boost10shared_ptrINS_11ParsedQueryEEES4_RKNS_17ShardChunkVersionERNS7_10scoped_ptrINS_25PageFaultRetryableSectionEEERNSG_INS_19NoPageFaultsAllowedEEERNS_7MessageE+0x376) [0x8318f6]  /opt/mongodb/bin/mongod(_ZN5mongo8runQueryERNS_7MessageERNS_12QueryMessageERNS_5CurOpES1_+0x1a93) [0x8345f3]  /opt/mongodb/bin/mongod() [0x7b0b0d]  /opt/mongodb/bin/mongod(_ZN5mongo16assembleResponseERNS_7MessageERNS_10DbResponseERKNS_11HostAndPortE+0x3a2) [0x7b20e2]  /opt/mongodb/bin/mongod(_ZN5mongo16MyMessageHandler7processERNS_7MessageEPNS_21AbstractMessagingPortEPNS_9LastErrorE+0x82) [0x56fe42]  /opt/mongodb/bin/mongod(_ZN5mongo3pms9threadRunEPNS_13MessagingPortE+0x411) [0xae6ed1]  /lib/x86_64-linux-gnu/libpthread.so.0(+0x7e9a) [0x7f0eb2526e9a]  /lib/x86_64-linux-gnu/libc.so.6(clone+0x6d) [0x7f0eb183c4bd] Mon Feb 18 09:26:21 [conn577444] assertion 10320 BSONElement: bad type 113 ns:mydb.system.profile query:{ ts: { $gte: new Date(1361179280953), $lte: new Date(1361179580953) } } Mon Feb 18 09:26:21 [conn577444] problem detected during query over mydb.system.profile : { $err: "BSONElement: bad type 113", code: 10320 } 

The script will query the profile collection for slow operations since last time it ran ( ts: { $gte: new Date(1361179280953), $lte: new Date(1361179580953) })

I am fairly new to MongoDB, any help appreciated.

Thanks,

Simone

回答1:

This generally means you have data corruption, caused possibly by an unclean shutdown. If you do not have too much data, you could run a repair on the database - or, preferably, if you have a backup somewhere, restore your data from the backup.

(It is always recommended that you run with replication, partially so that if you experience corruption you have a data backup.)



标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!