mongodb - 断言 10320 BSONElement : bad type 113 when querying profile collection, db.system.profile.find()

标签 mongodb

我在 ec2 中运行 Mongo 2.2.1,我已启用分析,并且每 180 秒向 Graphite 发送一个缓慢的操作摘要。脚本时不时地报告错误(BSONElement:错误类型 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 还很陌生,希望得到任何帮助。

谢谢

西蒙

最佳答案

这通常意味着您有数据损坏,可能是由不正常的关闭引起的。如果您没有太多数据,您可以运行 repair在数据库上 - 或者,最好,如果您在某处有备份,请从备份中恢复数据。

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

关于mongodb - 断言 10320 BSONElement : bad type 113 when querying profile collection, db.system.profile.find(),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15296088/

相关文章:

c++ - 在C++中与libmongoclient链接时出错

mongodb - 创建嵌入对象时 Moped::Errors::OperationFailure

mongodb - 过滤 MongoDB 聚合中的查找集合

python - db.collection.find() 花费太多时间来返回完整数据

mongodb - 安装 parse 时我是否需要安装 mongodb-runner 甚至认为 mongodb 已经安装

mongodb - 如何使用 nodejs 流式传输 MongoDB 查询结果?

python - 毫升抗体 : Temporary Failure in name resolution

arrays - 在 mongoDB 中使用数组索引获取数组元素

javascript - 在 MONGODB 上使用 $in 和 $and 在我的情况下不起作用

javascript - MongoDB 批量保存等效?