error occured when using sharded table and issuing find_and_modify to a nonexisting key
Traceback (most recent call last):
File "/service/dbconnector/dbconnector.py", line 36, in eval_cmd
res = eval_expr(block, variables)
File "/service/dbconnector/dbconnector.py", line 29, in eval_expr
return eval(expr,
, variables )
File "<string>", line 1, in <module>
File "/service/dbconnector/dbmodules.py", line 417, in call_ended
return find_token(connectionToken)
File "/service/dbconnector/dbmodules.py", line 383, in find_token
callstate = mdb.callstate.find_and_modify(query=
, remove=True)
File "build/bdist.linux-x86_64/egg/pymongo/collection.py", line 1009, in find_and_modify
return out['value']
KeyError: 'value'
> db.callstate.stats()
{
"sharded" : true,
"ns" : "db.callstate",
"count" : 0,
"size" : 0,
"avgObjSize" : NaN,
"storageSize" : 8192,
"nindexes" : 1,
"nchunks" : 1,
"shards" : {
"set1" : {
"ns" : "db.callstate",
"count" : 0,
"size" : 0,
"storageSize" : 8192,
"numExtents" : 1,
"nindexes" : 1,
"lastExtentSize" : 8192,
"paddingFactor" : 1,
"flags" : 1,
"totalIndexSize" : 8192,
"indexSizes" :
,
"ok" : 1
}
},
"ok" : 1
}
>
- depends on
-
SERVER-2698 mongos seems to swallow 'No matching object found' errors when running findAndModify on a sharded collection.
- Closed