Submitted by sebastianmorsony on Mon, 10/25/2010 - 10:09 Pro Licensee
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
Submitted by andreychek on Mon, 10/25/2010 - 10:25 Comment #1
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 --
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.
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 :-)
Submitted by sebastianmorsony on Mon, 10/25/2010 - 14:10 Pro Licensee Comment #2
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?
Submitted by JamieCameron on Mon, 10/25/2010 - 14:47 Comment #3
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..
Submitted by sebastianmorsony on Sat, 10/30/2010 - 10:56 Pro Licensee Comment #4
Thanks, that fixed it. :-)
Submitted by JamieCameron on Sat, 10/30/2010 - 11:25 Comment #5
Great!
Submitted by Issues on Sat, 11/13/2010 - 18:20 Comment #6
Automatically closed -- issue fixed for 2 weeks with no activity.
Submitted by thisara on Fri, 02/24/2017 - 10:22 Comment #7
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.