2013-02-20 65 views
0

我從我的MongoDB一路上得到了很多紀錄,我得到一個錯誤pymongo操作錯誤

File "C:\database\models\mongodb.py", line 228, in __iter__ 
    for result in self.results: 
    File "C:\Python27\Lib\site-packages\pymongo\cursor.py", line 814, in next 
    if len(self.__data) or self._refresh(): 
    File "C:\Python27\Lib\site-packages\pymongo\cursor.py", line 776, in _refresh 
    limit, self.__id)) 
    File "C:\Python27\Lib\site-packages\pymongo\cursor.py", line 720, in __send_message 
    self.__uuid_subtype) 
    File "C:\Python27\Lib\site-packages\pymongo\helpers.py", line 99, in _unpack_response 
    cursor_id) 

pymongo.errors.OperationFailure: cursor id '866472135294727793' not valid at server 
Exception KeyError: KeyError(38556896,) in <module 'threading' from 'C:\Python27\lib\threading.pyc'> ignored 

這是什麼意思,我如何解決它。我不知道這是否是重要的,但我沒有 使用from gevent import monkey; monkey.patch_all()當我打開連接

+1

當要求別人來解決你的代碼,它有助於提供的代碼。 – kindall 2013-02-20 15:53:02

回答

1

當光標已經開了很長的時間上沒有操作,它(光標)可以超時 - >這導致到錯誤

您可以設置超時時間=假在查找查詢打開超時斷

reference