Applicable to:
- Plesk Obsidian for Linux
Symptoms
-
Log rotation doesn't rotate logs, resulting in no compressed
.gz
files being created. -
Forcing log rotation for specific domain results in error
# /usr/local/psa/logrotate/sbin/logrotate -v -f /usr/local/psa/etc/logrotate.d/example.com
(...)
considering log /var/www/vhosts/system/example.com/logs/access_log.processed log /var/www/vhosts/system/example.com/logs/access_log.processed has multiple (2) hard links. Rotation of files with multiple hard links is not allowed for /var/www/vhosts/system/example.com/logs/*.processed -- skipping.
(...)
Cause
Product issues:
- #PPPM-13473 "Log rotation now works correctly after updating to Plesk Obsidian 18.0.42."
Fixed in:- Plesk Obsidian 12 April 2022 (Linux)
- #PPPM-13519 "Log rotation now works correctly after updating to Plesk Obsidian 18.0.43 even if /usr/local/psa/etc/logrotate.conf was customized."
Fixed in:- Plesk Obsidian 24 May 2022 (Linux)
Resolution
Workaround
If update is not possible for some reason, you may try the following
As the workaround, It is possible to use the sed
command to add allowhardlink
option to all logrotate config files.
-
Connect to the Plesk server via SSH.
-
Use the following command to apply the option to all logrotate configuration files:
# sed -i '/copytruncate/a allowhardlink' /usr/local/psa/etc/logrotate.d/*
Comments
7 comments
We have experienced this issue since March (when 18.0.42 was installed), but only noticed recently, when available drive space became low. I see that a recent update (18.0.43) claims to address PPPM-13473...
"Log rotation now works correctly after updating to Plesk Obsidian 18.0.42. (PPPM-13473)"
If we have installed Obsidian 18.0.43 on CentOS 7, do we still need to perform the solution, using "sed", in this article? The option "allowhardlink" does not exist in any of the files located in "/usr/local/psa/etc/logrotate.d".
Hello Bob Benson, when you've updated to Plesk 18.0.43, issue PPPM-13473 is fixed within this version, meaning you don't have to apply the workaround from this article.
Luca Krebs,
I updated to 18.0.43 however, even after several days, the issue described in this article remained. Logs not rotated. *.gz files not being created. The error message (multiple hard links is not allowed) referenced in the above article still appears when attempting to forcing log rotation.
I opened a ticket with my server provider and they performed the "sed" workaround, even though your reply suggested it shouldn't be necessary. Now that all of the logrotate configuration files in /usr/local/psa/etc/logrotate.d/ have the "allowhardlink" option added, are there any side effects that I should be aware of, or should I have my provider revert this change?
It appears that simply upgrading to 18.0.43 does not resolve the issue without taking other steps.
Best Regards,
Bob
Hello Bob Benson, the behavior was submitted as bug PPPM-13519 and will be fixed in future versions of Plesk Obsidian.
As a workaround, add
allowhardlink
to the/usr/local/psa/etc/logrotate.conf
manually.How do we determine the next time maintenance is run. The crontab does not have it. It appears to be using /etc/anacrontab but, I could not determine the time. Is this 3:05AM
START_HOURS_RANGE=3-22
#period in days delay in minutes job-identifier command
1 5 cron.daily nice run-parts /etc/cron.daily
7 25 cron.weekly nice run-parts /etc/cron.weekly
@monthly 45 cron.monthly nice run-parts /etc/cron.monthly
Byron Briggs you can check it depending on the OS as explained here: https://support.plesk.com/hc/en-us/articles/115002502385
Seems this still isn't working in Plesk 18.0.44
Actually it looks to be the example command in this article thats askew. 18.0.44 and possibly 18.0.43 have allowhardlink prepended to logrotate.conf, but the example command tells you to reference logrotate.d/[domain], bypassing this root config.
The following seems to work now, but obviously rotates for all domains. Rotating for a single domain I guess would require prepending allowhardlink to the domains individual config in logrotate.d as well.
Please sign in to leave a comment.