Sorry for necro'ing this thread, but I have exactly this issue on mailman 3.3.0. My instance has about 500 lists, and some of them seem to get corrupted in this way every once in a while.
I wrote a script which removes the duplicate entries, but this doesn't stop the issue from reappearing. Any idea on how to find out what is happening here?
The script I wrote: `from mailman.interfaces.listmanager import IListManager from zope.component import getUtility from mailman.config import config from mailman.model.mailinglist import ListArchiver
def get_list_manager(): return getUtility(IListManager)
def get_mhonarc_archivers(mlist, thedb): return list(thedb.query(ListArchiver).filter(ListArchiver.mailing_list == mlist, ListArchiver.name == 'mhonarc'))
def remove_last(archivers, mlist, thedb): lastid = archivers[1].id thedb.query(ListArchiver).filter(ListArchiver.mailing_list == mlist, ListArchiver.name == 'mhonarc', ListArchiver.id == lastid).delete()
def do_the_thing(mlists, thedb): do_commit = False for mlist in mlists: mhonarcs = get_mhonarc_archivers(mlist, thedb) if len(mhonarcs) > 1: print("{} has {}".format(mlist.fqdn_listname, len(mhonarcs))) remove_last(mhonarcs, mlist, thedb) do_commit = True return do_commit
listmgr = get_list_manager() mlists = list(listmgr.mailing_lists) store = config.db.store print() do_commit = do_the_thing(mlists, store) if do_commit: store.commit()`
In the script I am filtering for 'mhonarc' ListArchivers, since the duplicate ListArchivers always seem to be mhonarc archivers.
If this is not the appropriate place, please let me know - I would like to get to the bottom of this :).
Kind regards, Ike