gromox-cleaner service is not talkative enough
So I ran gromox-cleaner service which failed with:
mai 02 13:11:36 email systemd[1]: Starting Gromox mailbox cleaner...
mai 02 13:14:40 email gromox-mbop[5920]: purge_softdel / failed
mai 02 13:14:40 email systemd[1]: gromox-cleaner.service: Main process exited, code=exited, status=1/FAILURE
mai 02 13:14:40 email systemd[1]: gromox-cleaner.service: Failed with result 'exit-code'.
mai 02 13:14:40 email systemd[1]: Failed to start Gromox mailbox cleaner.
It looks like /usr/sbin/gromox-mbop foreach.here.mb does not output which user folder fails, so I manually ran a for loop for my users and found the culprit, which was a corrupted sqlite3 database, which I could repair with the instructions from here
Running manually I get the following which gives me a clue what mailbox to fix
purge_softdel IPM_SUBTREE failed
ERROR: Failed to purge soft deletions for /var/lib/gromox/user/1/0
Would it be possible to add some logs for that particular foreach.here.mb command so we know what fails ?
sounds like a good idea to add a -v option
mbop foreach.x ( echo-username ) ( ... )
@jengelh Thanks. I tried to read the docs here but must admit they are a bit cryptic. Is there a list of commands available for that foreach.x loop ?
@crpb Do you think you could mod gromox-cleaner so it shows the username on failure ?
Is there a list of commands available for that foreach.x loop
All other commands?
root@grom-test-1:~# gromox-mbop foreach.mb
Usage: foreach[.filter]* [-j jobs] command [args...]
filter := secobj | user | mlist | sharedmb | contact |
active | susp | deleted | mb
Commands:
clear-photo clear-profile clear-rwz delmsg echo-maildir echo-username emptyfld get-freebusy get-photo get-websettings get-websettings-persistent get-websettings-recipients ping purge-datafiles purge-softdelete recalc-sizes set-locale set-photo set-websettings set-websettings-persistent set-websettings-recipients unload vacuum
Do you think you could mod gromox-cleaner so it shows the username on failure
No, and i can't find a darn server right now that threw errors in the recent past because i wanted to see it if those are logged to at least "warning" or lower (in number).... But jengelh shoud be able to tell us?
With that as a given you could add a script or a oneliner (with ExecStop[Post]= maybe) to look for anything in a particular loglevel (e.g. journalctl --priority 3..5 --unit gromox-cleaner --since -2hours)
So I don't have a server with problems too, but I just modified /usr/lib/systemd/system/gromox-cleaner.service to add ( echo-username ) which should at least show the last processed mailbox before a potential error rises:
ExecStart=/usr/sbin/gromox-mbop foreach.here.mb ( echo-username ) ( purge-softdelete -t ${softdelete_purgetime} -r / ) ( purge-datafiles )
@crpb mind to update the service file with this ? Could be useful for diag purposes since there are no other logs than a failure message
avril 20 00:00:00 email systemd[1]: Starting Gromox mailbox cleaner...
avril 20 00:03:07 email gromox-mbop[11571]: purge_softdel / failed
avril 20 00:03:07 email systemd[1]: gromox-cleaner.service: Main process exited, code=exited, status=1/FAILURE
avril 20 00:03:07 email systemd[1]: gromox-cleaner.service: Failed with result 'exit-code'.
avril 20 00:03:07 email systemd[1]: Failed to start Gromox mailbox cleaner.
avril 21 00:00:03 email systemd[1]: Starting Gromox mailbox cleaner...
avril 21 00:02:25 email gromox-mbop[26308]: purge_softdel / failed
avril 21 00:02:25 email systemd[1]: gromox-cleaner.service: Main process exited, code=exited, status=1/FAILURE
avril 21 00:02:25 email systemd[1]: gromox-cleaner.service: Failed with result 'exit-code'.
avril 21 00:02:25 email systemd[1]: Failed to start Gromox mailbox cleaner.
@crpb mind to update the service file with this ? Could be useful for diag purposes since there are no other logs than a failure message
you can just send in a PR, as it won't matter if you or me will do it :P.
mkdir -p /etc/systemd/system/gromox-cleaner.service.d/
<< 'EOF' > /etc/systemd/system/gromox-cleaner.service.d/override.conf
# /etc/systemd/system/gromox-cleaner.service.d/override.conf
[Service]
ExecStart=
ExecStart=/usr/sbin/gromox-mbop foreach.here.mb ( echo-username ) ( purge-softdelete -t ${softdelete_purgetime} -r / ) ( purge-datafiles )
EOF
systemctl daemon-reload
START=$(date +"%F %T")
systemctl start gromox-cleaner.service
journalctl -u gromox-cleaner.service -u gromox-http.service --since "$START"
gromox-2.48-48-g 9aba54cfa