johnnykv / mnemosyne

Normalizer for honeypot data.
GNU General Public License v3.0
45 stars 39 forks source link

Concurrency issue while upserting #14

Closed johnnykv closed 11 years ago

johnnykv commented 11 years ago
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/gevent/greenlet.py", line 390, in run
    result = self._run(*self.args, **self.kwargs)
  File "/home/johnny/mnemosyne/normalizer/normalizer.py", line 102, in inserter
    self.database.insert_normalized(norm, id)
  File "/home/johnny/mnemosyne/persistance/mnemodb.py", line 71, in insert_normalized
    upsert=True)
  File "/usr/local/lib/python2.7/dist-packages/pymongo/collection.py", line 481, in update
    check_keys, self.__uuid_subtype), safe)
  File "/usr/local/lib/python2.7/dist-packages/pymongo/mongo_client.py", line 844, in _send_message
    rv = self.__check_response_to_last_error(response)
  File "/usr/local/lib/python2.7/dist-packages/pymongo/mongo_client.py", line 785, in __check_response_to_last_error
    raise DuplicateKeyError(details["err"])
DuplicateKeyError: E11000 duplicate key error index: mnemosyne.file.$hashes_1  dup key: { : { sha1: "6ed8493fa285bef8f5e8cb62727e54cbb2593c87", sha512: "383ad9a6c6aae35889cb698a5ec80c56fd93daf04438633bbfbce78ae0269c8b15920fa84523db06bf05b63ddce74e5b363e95a67a91173ab7757daf1b9a8ad0", md5: "7208134c90c1b6eb7b6843a783253ba8" } }
<Greenlet at 0x20b6f50: <bound method Normalizer.inserter of <normalizer.normalizer.Normalizer object at 0x1fc49d0>>([([{'file': {'data': '0a090909090977773d77696e646f)> failed with DuplicateKeyError

2013-03-15 22:27:02,775 (root) Mongo collection count: url: 58699,  hpfeed: 11982646 (184 in error state),  session: 2149846,  file: 3539,  dork: 776, 
johnnykv commented 11 years ago

closed with 3c6db2613fbac4dd03bba218ee3d79c7d5c24a06