error: stat of /home/domainname/logs/access_log failed: No such file or directory

Hi

After the latest upgrade to Virtualmin it checks it's configuration and gives me a lot of errors regarding log rotation.

The error looks like this.

configuration is not valid : error: stat of /home/domainname.com/logs/access_log failed: No such file or directory This must be fixed, or log file rotation will not be done.

If I create the folder and copy some logfiles to it, it continuous to the next error. All the errors are releated to deleted sites.

Any way I can clear them from the database?

Status: 
Closed (fixed)

Comments

So just to clarify -- those sites that you're seeing are completely removed from Virtualmin... but although they don't exist in Virtualmin, you're seeing errors regarding their logrotate entry?

Chances are, what happened is that some time ago when they were deleted, something went awry with the deletion and the log rotate entry wasn't correctly removed. However, if you don't run a Re-Check Config, that would go unnoticed.

The Re-Check Config you ran recent just showed that issue, it wasn't actually related to the upgrade.

What I would recommend doing are two things --

  1. Double-check that the domains are actually removed from Virtualmin... that they don't appear in the drop-down list on the top-left of Virtualmin.

  2. Edit /etc/logrotate.conf, and comment out the blocks associated with the deleted Virtual Servers. It would look something like this:

/home/username/logs/access_log /home/username/logs/error_log {
        rotate 5
        weekly
        compress
        postrotate
        /usr/sbin/apachectl graceful
        endscript
}

Make sure you get the entire block, including the trailing } at the end there.

Doing that will make Virtualmin stop looking for those... as well as prevent logrotate from trying to rotate logs that don't exist :-)

Thanks for the proposed solution, only problems is, that I have about 1500 sites, and there is quite a lot of deletes. My best guess would be hundreds.

Anything else I can do?

One thing you could do is disable log rotation for all your domains, delete all the virtualmin-related entries from your logrotate.conf , then re-enable log rotation.

The simplest way to do a mass disable is with the command :

virtualmin disable-feature --logrotate --all-domains

and to enable again :

virtualmin enable-feature --logrotate --all-domains

The underlying cause of the problem is that in Virtualmin versions before 3.81, deleting multiple domains at once could cause leftover logrotate.conf entries. That bug is fixed now though..

Thanks, that fixed it. :-)

Automatically closed -- issue fixed for 2 weeks with no activity.

On the newer version (Cent OS 7 running VirtualMin 5.06), it was found that the logrotate config files for each virtual server are located at /etc/logrotate.d and it is required to carefully remove the files of those deleted virtual servers.