2

我在 ec2 中运行 Mongo 2.2.1,我启用了分析,并且我每 180 秒向石墨发送一个缓慢的操作摘要。脚本时不时地报告一个错误(BSONElement: bad type 113),如果我登录到 Mongo shell 并运行 db.system.profile.find() 我会得到更详细的报告:

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

在日志中,我可以看到脚本何时运行并报告错误:

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 }

该脚本将查询自上次运行以来运行缓慢的配置文件集合( ts: { $gte: new Date(1361179280953), $lte: new Date(1361179580953) })

我对 MongoDB 相当陌生,任何帮助表示赞赏。

谢谢,

西蒙娜

4

1 回答 1

3

这通常意味着您有数据损坏,可能是由不干净的关机引起的。如果您没有太多数据,您可以对数据库进行修复- 或者,如果您在某处有备份,最好从备份中恢复您的数据。

(始终建议您使用复制运行,部分原因是如果您遇到损坏,您可以备份数据。)

于 2013-03-08T22:41:08.527 回答