• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

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