Applicable to:
- Plesk for Linux
Symptoms
-
The database of Plesk's Log Browser extension takes up too much disk space:
# du -sh /usr/local/psa/var/modules/log-browser/log-browser.sqlite3
446G /usr/local/psa/var/modules/log-browser/log-browser.sqlite3 -
While trying to verify journalctl it shows that some of the files are corrupted:
# journalctl --verify
3db870: Invalid data object at hash entry 143457 of 233016
File corruption detected at /run/log/journal/405a34574915da418df82dde7572cad0/system.journal:3db780 (of 8388608 bytes, 48%). - Big number of incoming/outgoing mails
Cause
Journalctl corruption causes logs to iterate over logs and the parse-maillog task to process the same lines over and over again, filling up the database.
Resolution
- Connect to your Plesk server via SSH.
-
Flush the journalctl:
# journalctl --flush
-
Remove the corrupted files.
Note: These were initially obtained when verifying the journalctl
-
Restart the service:
# systemctl restart systemd-journald
-
Ensure there are absolutely no logs using the following commands:
# CURSOR=$(/usr/local/psa/admin/sbin/modules/log-browser/journalctl first SYSLOG_FACILITY=2 --output=json --since=@1741579411.000000 | jq '.__CURSOR'| tr -d '"')
# journalctl "SYSLOG_FACILITY=2" "--after-cursor=$CURSOR" "--no-pager" "--quiet" --output=json --lines=7500 | jq '(.__REALTIME_TIMESTAMP | tonumber) / 1000000 | floor' | while read -r t; do date --date=@$t +"%Y-%m-%d"; done | uniq\
-
Drop all queued parse-maillog tasks from the task-manager:
# plesk bin task-manager -l | grep parse-maillog -B3 | grep '^ID' | cut -d':' -f2 | tr -d ' ' | while read -r id; do plesk bin task-manager -d "$id"; done
- Run the rotate-mail task from the Plesk UI (in Tools & Settings > Scheduled Tasks).
-
Remove the last journald cursor from the database:
# plesk db 'DELETE FROM ModuleSettings WHERE name = 'lastMailJournalCursor'
-
Check if the task parse-maillog finishes successfully with:
# plesk bin task-manager -l
Comments
Please sign in to leave a comment.