After deleting archives, rebuild_mailinglist_cache_for_month may fail repeatedly with DoesNotExist
$ tail -f /var/log/mailman3/web/mailman-web.log
10:11:50 [Q] INFO Process-1:266 processing [rebuild_mailinglist_cache_for_month]
10:11:50 [Q] ERROR Failed [rebuild_mailinglist_cache_for_month] - MailingList matching query does not exist. : Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/django_q/cluster.py", line 421, in worker
res = f(*task["args"], **task["kwargs"])
File "/usr/lib/python3/dist-packages/hyperkitty/tasks.py", line 79, in _rebuild_mailinglist_cache_for_month
mlist = MailingList.objects.get(name=mlist_name)
File "/usr/lib/python3/dist-packages/django/db/models/manager.py", line 82, in manager_method
return getattr(self.get_queryset(), name)(*args, **kwargs)
File "/usr/lib/python3/dist-packages/django/db/models/query.py", line 406, in get
raise self.model.DoesNotExist(
hyperkitty.models.mailinglist.MailingList.DoesNotExist: MailingList matching query does not exist.
10:11:50 [Q] INFO Process-1:266 processing [rebuild_mailinglist_cache_for_month]
[...]
$ mailman info
GNU Mailman 3.3.3 (Tom Sawyer)
Python 3.9.2 (default, Feb 28 2021, 17:03:44)
[GCC 10.2.1 20210110]
config file: /etc/mailman3/mailman.cfg
db url: sqlite:////var/lib/mailman3/data/mailman.db
devmode: DISABLED
REST root url: [...]
REST credentials: [...]
I'm running Debian 11 with the latest updates installed. To trigger this, I have deleted ~200 list archives using the commands mentioned in #339 (comment 1056158888)
For some of those lists, the mailman list had already been successfully deleted and only the archive was left.
Edited by Luis Gerhorst