
Hi Mark,
Thanks again for your answer.
First of all, all of what I write below happened on a test list server, so no real harm was done. I'm just curious how to recover from this, and how to get to what I need. :-)
On Wed, 11 Sept 2024 at 21:16, Mark Sapiro <mark@msapiro.net> wrote:
On 9/11/24 00:23, Marco van Tol wrote:
We're interested in the development of a feature in mailman3 where we can configure it to automatically expire/remove threads in/from the archive older than x number of days.
The script at https://www.msapiro.net/scripts/prune_arch3 could be easily modified to do this and then be run periodically by cron.
I made a modified version of the script, and ran it. (attachment: script-1.py)
The script went on its way for a bit, and then blew up. (attachment: error-run-1.txt)
Now the archive for the list is broken in the sense that when I search for "*", and order it by "earliest first", it will show a server error. The mailmanweb.log also gives errors when this happens. (attachment: mailman-web.log)
I tried to run ./manage.py update_index
which did not fix the issue for
the archive.
I then ran ./manage.py rebuild_index
which did fix the issue for the
archive.
Following this I ran the script again, and it showed similar output,
including an error message after a while, but on every run it would delete
new messages.
I could keep running it until all the messages that I needed to be gone
were gone, and then do a final rebuild_index
to get the server back in
shape.
The mailmanweb.log would show the occasional message like this while I was doing this: WARNING 2024-10-16 12:31:52,043 41 hyperkitty.tasks Cannot rebuild the thread cache: thread 28 does not exist.
These did not re-appear after I rebuilt the index.
Is there some call I need to make to refresh the Email.objects list between
runs?
Do I just blindly rerun Email.objects.filter(<args>)
after every call to
msg.delete()?
And secondary: can I avoid the call to rebuild_index? The actual production server has a massive count of messages.
Thanks!
Marco van Tol RIPE NCC