Repository navigation
Report why the mail.err cron test fails when it does - #111
Merged
Merged
Conversation
"cron job stderr goes to mail.err" fails now and then in CI. In run 44396969569 the job succeeded and printed nothing, but its error never reached syslog at all: not in mail.err after 10 s, and not in the mail.log stream either. So it is not rsyslog writing late. The test now runs the job with a logger in front of the real one that keeps a copy of what it is given. On failure it writes, as TAP comments, the job's start time and status, the container's cron line, the owner of current-dbs.txt just before and after the job, any update already running, and everything the job handed to logger. Passing runs print nothing extra.
SaraSmiseth
approved these changes
Dec 1, 2026
AndrewSav
added a commit
to AndrewSav/mailserver
that referenced
this pull request
Dec 5, 2026
"cron job stderr goes to mail.err" makes current-dbs.txt root-owned so that the job, running as clamav, cannot write it. When the update at startup fails, the file is first created by a job the tests run through su, whose umask is 0002, so it is group-writable and clamav can still write it after the chown. Set its mode as well. The diagnostics added in mailserver2#111 led to this and are removed. "mail.err does not exist" failed when rspamd's public fuzzy server was slow to answer, which rspamd logs as an error. Ignore that message only; any other line still fails the test.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Note
TLDR: I'm still chasing intermittent failures in the tests. This adds some more logging for the case linked above where it failed last time after merging to my fork after succeeding here.
What is the current behavior (you can also link to an open issue here) ?
The test makes
current-dbs.txtroot-owned, runs the hourly clamav-unofficial-sigs job as cron would (asclamav), and expects the job'sPermission deniederror in/var/log/mail.err. The job's stderr goes there throughlogger -p mail.err(clamav-unofficial-sigs-cron.sh).In run 44396969569 (master,
1f66fe0), it failed. The log shows:wait_for_log(Update fetchmail.pl to current PostfixAdmin #104) waited 10,117 ms, and/var/log/mail.errwas never created. Thels /var/logfrommake logs(Report when a log check had to wait for rsyslog #106), taken at 21:05:30.6 after the suite stopped, shows nomail.erreither.mail.*message to the container's stdout as well as to the files, andmake logsdumped that stream. It has nothing between 21:05:15 and 21:05:30. The next two tests logged through the same path within the next second, and both of their lines are there.update already running, skipping this runline from the wrapper for this test, and noOnly one instance can run at the same timeerror from the script, so neither lock check stopped the job.So the job never reported the error. The line that fails,
clamav-unofficial-sigs.sh:3191(sort ... > "$current_dbs_file"), runs on every update, and I found nothing before it that exits without logging. The explanations left are:current-dbs.txtwas not root-owned when the job wrote it.loggeror rsyslog lost the message.This is the only failure of this test in the fork's last 9 master runs.
What is the new behavior (if this is a feature change) ?
The test checks the same thing, and the job and the image are unchanged. Two things are added to the test:
loggerscript first on its PATH. The script saves each call's arguments and input to a file under/tmp/sigs-diag/and passes them on, unchanged, to/usr/bin/logger.current-dbs.txtjust before and just after the joblogger, with its priority and text, or(logger was not called)A passing run prints nothing extra.
How to read the next failure:
clamavbefore the jobPermission deniedline handed tologgerloggeror rsyslog lost itloggercalled without that line, or not calledType of change
Status
Todo List
How has this been tested ?
On this branch as pushed (
f8dad99, on master23a7bc2), with a fresh build:Default suite: 140/140.
The failure path, against the same container: a copy of the test waiting for a line that never comes. It printed the full report, including the
Permission deniedline handed tologgeratmail.err, and(none)for running updates, so the process listing no longer matches its ownpscommand: