• Please be aware: Kaspersky Anti-Virus has been deprecated
    With the upgrade to Plesk Obsidian 18.0.64, "Kaspersky Anti-Virus for Servers" will be automatically removed from the servers it is installed on. We recommend that you migrate to Sophos Anti-Virus for Servers.
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

Logrotate for error_log does not work for migrated domains

Kurt Ludikovsky

Basic Pleskian
Problem:

Logrotation does not work for error_log for domains migrated from a previous version.
Plesk Version 12.5

When I checked my error_log's I found that those where not rotated and have reached huge sizes.
Whilel only the error log's where not rotated, the other log's (e.g. access_log, xfer_log, ..) seemed ok.
I futhermore figured out that non of the 'newer' domains where affected. 'Newer', as created on this installation. Only domains migrated from a previous installation (and version) where affected.

Resolution:

When trying to figure out the reason I got trough some KB articles here, and finally found KB Article 129196 which brought me to the solution.
Running the command's
Code:
/usr/local/psa/logrotate/sbin/logrotate -v -f /usr/local/psa/etc/logrotate.conf  2> logrotate.debug
grep 'error:' logrotate.debug
and analysing the output brought the following errors
Code:
error: error creating output file /var/www/vhosts/system/domain.tld/logs/error_log.1: File exists
only for the migrated domains.

A previously attempt to rename the error_log.1 in the
Code:
var/www/vhosts/domain.tld/logs/
directory did not yield a result.

After the renaming and re-running of the manual logrotate all seems ok now in the var/www/vhosts/system/domain.tld/logs/ directory. The log's in the var/www/vhosts/domain.tld/logs/ are not up to date yet, but this is minor, and might be ok after a scheduled run.

Hope this helps somebody.
 
Hello Kurt,

I cannot get to reproduce your issue. Could you provide more details about your environment like OS, Plesk version, MU for source and destination servers and version of Plesk Migrator.
 
Hello, Mr.D

It's Version 12.5.30 Update #53, zuletzt aktualisiert: 29. Nov. 2016 14:26:24 and a Debian 7

I migrated from a 11.5 System I think, because that's already some time ago.

What I found, was that the error_log.1 file, which was transfered, prohibits the execution of the logrotate. But this is only true for the error_log, I could not see the same issue with the access_log .
I just deleted (renamed) the error_log.1 and logrotate seems to work now.

I discovered the root by comparing newly created domains, where the problem did no arise, to the transfered ones. The major difference with the error_log.1 file.

Maybe a simple test, create a error_log.1 file in a log-directory (I don't know which one, as I don't understand the difference between the /var/www/vhosts/system/domain.tld/logs and the /var/www/vhosts/domain.tld/logs directory completely.
 
Back
Top