mailman-web Cleaning Up a Few Issues
I seems to be having a problem with some cronjobs not running; I'm getting the following email errors/warnings:
Subject: Cron <www-data@dap002> [ -f /usr/bin/django-admin ] && flock -n /var/run/mailman3-web/cron.minutely /usr/share/mailman3-web/manage.py runjobs minutely
Body: flock: cannot open lock file /var/run/mailman3-web/cron.minutely: No such file or directory
Obviously there is a path specified wrong but I can't find where that is.
Subject: Cron <mailman@dap002> /opt/mailman/venv/bin/mailman-web runjobs minutely
Body: System check identified some issues:
WARNINGS: ?: settings.ACCOUNT_AUTHENTICATION_METHOD is deprecated, use: settings.ACCOUNT_LOGIN_METHODS = {'username', 'email'} ?: settings.ACCOUNT_EMAIL_REQUIRED is deprecated, use: settings.ACCOUNT_SIGNUP_FIELDS = ['email*', 'username*', 'password1*', 'password2*']
Again I could probably fix these if I knew where to look.
On 11/3/25 08:06, dap1--- via Mailman-users wrote:
I seems to be having a problem with some cronjobs not running; I'm getting the following email errors/warnings:
Subject: Cron <www-data@dap002> [ -f /usr/bin/django-admin ] && flock -n /var/run/mailman3-web/cron.minutely /usr/share/mailman3-web/manage.py runjobs minutely
Body: flock: cannot open lock file /var/run/mailman3-web/cron.minutely: No such file or directory
Obviously there is a path specified wrong but I can't find where that is.
Something is configured incorrectly. Is this left over from a prior install of an Ubuntu mailman-web package?
https://docs.mailman3.org/en/latest/install/virtualenv.html#cron-jobs-for-ma... says these should run /opt/mailman/venv/bin/mailman-web runjobs, not /usr/share/mailman3-web/manage.py runjobs.
Subject: Cron <mailman@dap002> /opt/mailman/venv/bin/mailman-web runjobs minutely
Body: System check identified some issues:
WARNINGS: ?: settings.ACCOUNT_AUTHENTICATION_METHOD is deprecated, use: settings.ACCOUNT_LOGIN_METHODS = {'username', 'email'} ?: settings.ACCOUNT_EMAIL_REQUIRED is deprecated, use: settings.ACCOUNT_SIGNUP_FIELDS = ['email*', 'username*', 'password1*', 'password2*']
This is https://gitlab.com/mailman/mailman-web/-/issues/37, fixed for the next release by https://gitlab.com/mailman/mailman-web/-/merge_requests/58. See the changelog at https://gitlab.com/mailman/mailman-web
In the mean time, these aren't fatal.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
Not fatal but hundreds of emails per day. I copies the crontabs from the documentation; Here is the crontab I have:
* * * * * /opt/mailman/venv/bin/mailman-web runjobs minutely
0,15,30,45 * * * * /opt/mailman/venv/bin/mailman-web runjobs quarter_hourly
@hourly /opt/mailman/venv/bin/mailman-web runjobs hourly
@daily /opt/mailman/venv/bin/mailman-web runjobs daily
@weekly /opt/mailman/venv/bin/mailman-web runjobs weekly
@monthly /opt/mailman/venv/bin/mailman-web runjobs monthly
@yearly /opt/mailman/venv/bin/mailman-web runjobs yearly
On 11/4/25 11:22, dap1--- via Mailman-users wrote:
Not fatal but hundreds of emails per day. I copies the crontabs from the documentation; Here is the crontab I have:
0,15,30,45 * * * * /opt/mailman/venv/bin/mailman-web runjobs quarter_hourly @hourly /opt/mailman/venv/bin/mailman-web runjobs hourly @daily /opt/mailman/venv/bin/mailman-web runjobs daily @weekly /opt/mailman/venv/bin/mailman-web runjobs weekly @monthly /opt/mailman/venv/bin/mailman-web runjobs monthly @yearly /opt/mailman/venv/bin/mailman-web runjobs yearly/opt/mailman/venv/bin/mailman-web runjobs minutely
But based on https://lists.mailman3.org/archives/list/mailman-users@mailman3.org/message/... you have some other crontab running mailman stuff. Try
sudo grep -r '/usr/share/mailman3-web/manage.py' /etc/cron* /var/spool/cron
(on one line if wrapped) to find it.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
I installed mailman-web 0.0.10 and that cleared up half the problem. The django-admin problem still exists. Do I need to create the directory /var/run/mailman3-web or should there be a different path specified somewhere?
On 11/4/25 11:55, dap1--- via Mailman-users wrote:
I installed mailman-web 0.0.10 and that cleared up half the problem. The django-admin problem still exists. Do I need to create the directory /var/run/mailman3-web or should there be a different path specified somewhere?
Did you see https://lists.mailman3.org/archives/list/mailman-users@mailman3.org/message/...
Did you do the suggested grep? What does it find?
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
dap1--- via Mailman-users writes:
Not fatal but hundreds of emails per day. I copies the crontabs from the documentation; Here is the crontab I have:
I'm not sure if cron is the problem of "hundreds of emails", but if you check the jobs in site-packages/hyperkitty/jobs/*.py, you'll find that the active jobs run hourly, at the most frequently. (grep for "when"). So if your HyperKitty is like mine, you could save like 1500 mails/day by commenting out the lines for minutely, quarter_hourly, and weekly.
You may also be able to change the configuration of cron so that only processes that return a failure (non-zero) status send email.
Steve
-- GNU Mailman consultant (installation, migration, customization) Sirius Open Source https://www.siriusopensource.com/ Software systems consulting in Europe, North America, and Japan
On 11/5/25 09:47, dap1--- via Mailman-users wrote:
Thanks. I just decided to send the cron job output to /dev/null.
I think you need to find the cause of those errors rather than ignoring them and potentially more serious ones.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
Mark: I hope to do that but I am getting killed with emails in the mean time. I'm guessing all these issues stem from the incorrect location of django. How do I fix that?
Stephen: I can't find anything. Here is /opt/mailman/venv/lib/python3.12/site-packages/hyperkitty/jobs:
empty_threads.py __pycache__ thread_starting_email.py __init__.py recent_threads_cache.py update_and_clean_index.py new_lists_from_mailman.py sync_mailman.py update_index.py orphan_emails.py thread_order_depth.py
Stephen: My bad, typos. I'n not sure what to change or to what:
empty_threads.py: when = "monthly" new_lists_from_mailman.py: when = "hourly" orphan_emails.py:This can happen if HK receives the reply before the original message (when a orphan_emails.py: when = "daily" recent_threads_cache.py: when = "daily" sync_mailman.py: when = "daily" thread_order_depth.py: when = "yearly" thread_starting_email.py: help = "Find the starting email when it is missing" thread_starting_email.py: when = "hourly" update_and_clean_index.py: when = "monthly" update_index.py: when = "hourly"
dap1--- via Mailman-users writes:
Stephen: My bad, typos. I'n not sure what to change or to what:
empty_threads.py: when = "monthly" new_lists_from_mailman.py: when = "hourly" orphan_emails.py:This can happen if HK receives the reply before the original message (when a orphan_emails.py: when = "daily" recent_threads_cache.py: when = "daily" sync_mailman.py: when = "daily" thread_order_depth.py: when = "yearly" thread_starting_email.py: help = "Find the starting email when it is missing" thread_starting_email.py: when = "hourly" update_and_clean_index.py: when = "monthly" update_index.py: when = "hourly"
You leave these files alone. In the *cron* configuration, you can comment out the minutely, quarter_hourly, and weekly jobs to reduce the amount of mail you're getting from Mailman's cron jobs.
But if those messages are reporting errors, you should figure out why and fix it. See my previous message.
Steve
On 11/5/25 10:22, dap1--- via Mailman-users wrote:
Mark: I hope to do that but I am getting killed with emails in the mean time. I'm guessing all these issues stem from the incorrect location of django. How do I fix that?
See https://lists.mailman3.org/archives/list/mailman-users@mailman3.org/message/... and https://lists.mailman3.org/archives/list/mailman-users@mailman3.org/message/...
I find it very difficult to help you when you don't report the results of things I suggest
Stephen: I can't find anything. Here is /opt/mailman/venv/lib/python3.12/site-packages/hyperkitty/jobs:
empty_threads.py __pycache__ thread_starting_email.py __init__.py recent_threads_cache.py update_and_clean_index.py new_lists_from_mailman.py sync_mailman.py update_index.py orphan_emails.py thread_order_depth.py
The problem isn't with your virtualenv install. It is with some left over crontab from a prior attempt to install Ubuntu packages.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
Sorry Mark:
These hundreds of emails are distracting and I have too many irons in the fire between you and Stephen. That is not a criticism as I greatly appreciate the help from both of you. Just that I'm having difficulty keeping up with you both.
sudo grep -r '/usr/share/mailman3-web/manage.py' /etc/cron* /var/spool/cron
/etc/cron.d/mailman3-web:* * * * * www-data [ -f /usr/bin/django-admin ] && flock -n /v ar/run/mailman3-web/cron.minutely /usr/share/mailman3-web/manage.py runjobs minutely /etc/cron.d/mailman3-web:2,17,32,47 * * * * www-data [ -f /usr/bin/django-admin ] && flock -n /v ar/run/mailman3-web/cron.quarter_hourly /usr/share/mailman3-web/manage.py runjobs quarter_hourly /etc/cron.d/mailman3-web:@hourly www-data [ -f /usr/bin/django-admin ] && flock -n /v ar/run/mailman3-web/cron.hourly /usr/share/mailman3-web/manage.py runjobs hourly /etc/cron.d/mailman3-web:@daily www-data [ -f /usr/bin/django-admin ] && flock -n /v ar/run/mailman3-web/cron.daily /usr/share/mailman3-web/manage.py runjobs daily /etc/cron.d/mailman3-web:@weekly www-data [ -f /usr/bin/django-admin ] && flock -n /v ar/run/mailman3-web/cron.weekly /usr/share/mailman3-web/manage.py runjobs weekly /etc/cron.d/mailman3-web:@monthly www-data [ -f /usr/bin/django-admin ] && flock -n /v ar/run/mailman3-web/cron.monthly /usr/share/mailman3-web/manage.py runjobs monthly /etc/cron.d/mailman3-web:@yearly www-data [ -f /usr/bin/django-admin ] && flock -n /v ar/run/mailman3-web/cron.yearly /usr/share/mailman3-web/manage.py runjobs yearly
This was a fresh install of Ubuntu server so the only packages installed so far are dump/restore, Ubuntu-desktop, MySQL, Postfix, fetchmail and mailman3. Apache2 comes preinstalled with Ubuntu but there may be others of which I am currently unaware. As far as I know the only other crontab is for root where I have the backup jobs scheduled.
0 3 * * 0 /usr/local/sbin/sysbackup
On 11/5/25 11:17, dap1--- via Mailman-users wrote:
Sorry Mark:
These hundreds of emails are distracting and I have too many irons in the fire between you and Stephen. That is not a criticism as I greatly appreciate the help from both of you. Just that I'm having difficulty keeping up with you both.
> sudo grep -r '/usr/share/mailman3-web/manage.py' /etc/cron* /var/spool/cron
>
> /etc/cron.d/mailman3-web:* * * * * www-data [ -f /usr/bin/django-admin ] && flock -n /v
> ar/run/mailman3-web/cron.minutely /usr/share/mailman3-web/manage.py runjobs minutely
> /etc/cron.d/mailman3-web:2,17,32,47 * * * * www-data [ -f /usr/bin/django-admin ] && flock -n /v
> ar/run/mailman3-web/cron.quarter_hourly /usr/share/mailman3-web/manage.py runjobs quarter_hourly
> /etc/cron.d/mailman3-web:@hourly www-data [ -f /usr/bin/django-admin ] && flock -n /v
> ar/run/mailman3-web/cron.hourly /usr/share/mailman3-web/manage.py runjobs hourly
> /etc/cron.d/mailman3-web:@daily www-data [ -f /usr/bin/django-admin ] && flock -n /v
> ar/run/mailman3-web/cron.daily /usr/share/mailman3-web/manage.py runjobs daily
> /etc/cron.d/mailman3-web:@weekly www-data [ -f /usr/bin/django-admin ] && flock -n /v
> ar/run/mailman3-web/cron.weekly /usr/share/mailman3-web/manage.py runjobs weekly
> /etc/cron.d/mailman3-web:@monthly www-data [ -f /usr/bin/django-admin ] && flock -n /v
> ar/run/mailman3-web/cron.monthly /usr/share/mailman3-web/manage.py runjobs monthly
> /etc/cron.d/mailman3-web:@yearly www-data [ -f /usr/bin/django-admin ] && flock -n /v
> ar/run/mailman3-web/cron.yearly /usr/share/mailman3-web/manage.py runjobs yearly
This is not the crontab you reported at https://lists.mailman3.org/archives/list/mailman-users@mailman3.org/message/...
That one is probably /var/spool/cron/crontabs/mailman and wouldn't show here because it doesn't contain '/usr/share/mailman3-web/manage.py'.
So the system crontab at /etc/cron.d/mailman3-web is your issue and should be removed. That will get rid of the cron failure emails.
This was a fresh install of Ubuntu server so the only packages installed so far are dump/restore, Ubuntu-desktop, MySQL, Postfix, fetchmail and mailman3. Apache2 comes preinstalled with Ubuntu but there may be others of which I am currently unaware. As far as I know the only other crontab is for root where I have the backup jobs scheduled.
0 3 * * 0 /usr/local/sbin/sysbackup
Then the remaining question is how did that crontab get there in the system crontabs. The only way I know it could have gotten there if you didn't manually create it is via installation of Ubuntu Mailman packages.
I think you probably also have a django-admin and perhaps other things in /usr/bin/ and also a /usr/share/mailman-web/ directory which you don't want or need.
I suggest you do
sudo apt list mailman3 mailman3-web mailman3-full mailman3-doc
and see which of those unwanted packages are installed, and if any,
sudo apt remove them.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
On 11/5/25 13:48, Mark Sapiro wrote:
On 11/5/25 11:17, dap1--- via Mailman-users wrote:
This was a fresh install of Ubuntu server so the only packages installed so far are dump/restore, Ubuntu-desktop, MySQL, Postfix, fetchmail and mailman3. ... Then the remaining question is how did that crontab get there in the system crontabs.
Aaah, I missed the mailman3 in the above. That is why you have all this unwanted stuff. Do
sudo apt remove mailman3
You never should have installed it, It is incompatible with the virtualev install described at https://docs.mailman3.org/en/latest/install/virtualenv.html.
However you need to be careful as I think that package may put things in /etc/mailman3, so back that up before removing the package in case removal removes something you want.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
When I said mailman3 I did not mean it was installed outside of venv. My bad. Sorry.
On 11/6/25 08:27, dap1--- via Mailman-users wrote:
When I said mailman3 I did not mean it was installed outside of venv. My bad. Sorry.
You should still do
sudo apt list mailman3 mailman3-web mailman3-full mailman3-doc
to see if any of those packages is installed. I don't know how the /etc/cron.d/mailman3-web crontab would have been created except by installation of one of those packages.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
Odd, this is the output but none of those packages (if that is what they are) exist to be removed.
mailman3-doc/noble-updates 3.3.8-3.1ubuntu0.1 all mailman3-full/noble-updates 3.3.8-3.1ubuntu0.1 all mailman3-web/noble,now 0+20200530-2.1 all [residual-config] mailman3/noble-updates 3.3.8-3.1ubuntu0.1 all
I've removed that cron file.
On 11/6/25 10:23, dap1--- via Mailman-users wrote:
Odd, this is the output but none of those packages (if that is what they are) exist to be removed.
mailman3-doc/noble-updates 3.3.8-3.1ubuntu0.1 all mailman3-full/noble-updates 3.3.8-3.1ubuntu0.1 all mailman3-web/noble,now 0+20200530-2.1 all [residual-config] mailman3/noble-updates 3.3.8-3.1ubuntu0.1 all
I've removed that cron file.
And that cron is part of or maybe all of the residual-config left from mailman3-web. What happens if you do
sudo apt purge mailman3-web
Backup /etc/mailman3/ first in case it removes something wanted from there.
Note that all this says that at some point the mailman3-web package was installed and subsequently removed but not purged.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
Reading package lists... Done Building dependency tree... Done Reading state information... Done Package 'mailman3' is not installed, so not removed 0 upgraded, 0 newly installed, 0 to remove and 5 not upgraded.
dap1--- via Mailman-users writes:
Mark: I hope to do that but I am getting killed with emails in the mean time. I'm guessing all these issues stem from the incorrect location of django. How do I fix that?
Stephen: I can't find anything. Here is /opt/mailman/venv/lib/python3.12/site-packages/hyperkitty/jobs:
Do you know what "grep" is? You need to "grep when *.py" in that directory to get the settings for frequency. You most likely will find hourly, daily, monthly, and yearly and the other lines can be commented out. But you should check before disabling the cron jobs, some are necessary for functionality (indexing the archive) and others are cleanups of cruft that could eventually impact functionality.
But if the minutely and quarter_hourly jobs are reporting errors, you need to find out why, because as Mark points out that probably means you have garbage left over from a previous misconfiguration, either Ubuntu's package or while you were fiddling around to get to where you are now. And that garbage is quite possibly the cause of the current failures.
-- GNU Mailman consultant (installation, migration, customization) Sirius Open Source https://www.siriusopensource.com/ Software systems consulting in Europe, North America, and Japan
participants (3)
-
dap1@bellsouth.net -
Mark Sapiro -
Stephen J. Turnbull