Users get errors like the following from time to time when trying to save a wiki page. I think it may also occur occasionally for tickets. We should be able to clean this up easily, or better yet update the site code to handle the error automatically and continue.
File '/var/local/env-allura/lib/python2.7/site-packages/Ming-0.4.7-py2.7.egg/ming/session.py', line 162 in insert bson = self._impl(doc).insert(data, safe=kwargs.get('safe', True)) File '/var/local/env-allura/lib/python2.7/site-packages/TimerMiddleware-0.4.4-py2.7.egg/timermiddleware/__init__.py', line 117 in wrapper return self.run_and_log(func, inst, *args, **kwargs) File '/var/local/env-allura/lib/python2.7/site-packages/TimerMiddleware-0.4.4-py2.7.egg/timermiddleware/__init__.py', line 126 in run_and_log return func(*args, **kwargs) File '/var/local/env-allura/lib/python2.7/site-packages/pymongo-2.4.2-py2.7-linux-x86_64.egg/pymongo/collection.py', line 359 in insert continue_on_error, self.__uuid_subtype), safe) File '/var/local/env-allura/lib/python2.7/site-packages/pymongo-2.4.2-py2.7-linux-x86_64.egg/pymongo/mongo_client.py', line 844 in _send_message rv = self.__check_response_to_last_error(response) File '/var/local/env-allura/lib/python2.7/site-packages/pymongo-2.4.2-py2.7-linux-x86_64.egg/pymongo/mongo_client.py', line 785 in __check_response_to_last_error raise DuplicateKeyError(details["err"]) DuplicateKeyError: (u'E11000 duplicate key error index: project-data.page_history.$artifact_class_1_artifact_id_1_version_1 dup key: { : "forgewiki.model.wiki.Page", : ObjectId(\\'53bd2ee190954717fae54832\\'), : 51 }', 'doc: {\\'import_id\\': None, \\'app_config_id\\': ObjectId(\\'538661d5c4d1041477a0e495\\'), \\'artifact_id\\': ObjectId(\\'53bd2ee190954717fae54832\\'), \\'author\\': {\\'username\\': u\\'kenlunde\\', \\'display_name\\': u\\'Dr. Ken Lunde\\', \\'id\\': ObjectId(\\'4cc585dcb9363c527a0000bf\\'), \\'logged_ip\\': \\'X.X.X.X\\'}, \\'deleted\\': False, \\'timestamp\\': datetime.datetime(2014, 8, 29, 15, 47, 3, 985000), \\'labels\\': [], \\'artifact_class\\': \\'forgewiki.model.wiki.Page\\', \\'acl\\': [], \\'version\\': 51, \\'mod_date\\': datetime.datetime(2014, 8, 29, 15, 47, 3, 987628), \\'_id\\': ObjectId(\\'5400a077485acd3627d716fe\\'), \\'data\\': {\\'import_id\\': None, \\'app_config_id\\': ObjectId(\\'538661d5c4d1041477a0e495\\'), \\'title\\': u\\'Release Notes\\', \\'deleted\\': False, \\'text\\': u\\'Test\\\\r\\\\n\\\\r\\\\n# Overview\\\\r\\\\n*Source Han Sans* is a set of OpenType/CFF Pan-CJK f.....
Closed #669.
je/7647
I didn't manage to reproduce this by hand, but made a test.
You can test it like this:
git checkout HEAD~2
while on the branchcd ForgeWiki
nosetests forgewiki.tests.test_models:TestPageSnapshots._test_version_race
git checkout je/7647
nosetests forgewiki.tests.test_models:TestPageSnapshots.test_version_race
(note it's renamed)