New issue 177: Duplicate entry error in cache_invalidation table
https://bitbucket.org/conservancy/kallithea/issues/177/duplicate-entry-error-in

Dominik Ruf:

From time to time I get the following error.

WebApp Error: <class 'sqlalchemy.exc.IntegrityError'>: (IntegrityError) (1062, 
"Duplicate entry 'myrepo' for key 'cache_key'") 'INSERT INTO cache_invalidation 
(cache_key, cache_args, cache_active) VALUES (%s, %s, %s)' ('myrepo', 'myrepo', 
1)


```
#!text
...
Module kallithea.model.db:1449 in scm_instance_cached
>>  valid = CacheInvalidation.test_and_set_valid(rn, None, 
>> valid_cache_keys=valid_cache_keys)
Module kallithea.model.db:2141 in test_and_set_valid
>>  Session().commit()
Module sqlalchemy.orm.session:710 in commit
...
```

When I look at the code it seems that in case an inactive inv_obj is found it 
is set to active and re-add. But re-adding an object fails.

https://bitbucket.org/conservancy/kallithea/src/8bc8366a6874640c73c20ce8ecfb596c0b4134db/kallithea/model/db.py?at=default&fileviewer=file-view-default#db.py-2134


_______________________________________________
kallithea-general mailing list
[email protected]
http://lists.sfconservancy.org/mailman/listinfo/kallithea-general

Reply via email to