Article ID: 115572, created on Feb 20, 2013, last review on May 11, 2014

  • Applies to:
  • Plesk 11.x for Linux
  • Plesk 10.x for Linux
  • Plesk 9.x for Linux/Unix


Log rotation is not functioning properly on this server for the access_log.processed files.
It fails with the following error: 
# /usr/local/psa/admin/sbin/statistics --calculate-all
WARNING during statistics_collector execution: : statistics_collector: cannot seek /var/www/vhosts/ at required position: Invalid argument

System error 22: Invalid argument


The issue may occur if a log file of one of the domains is too large for the statistics script to process it in the current environment.
You may find the largest log file with this command:
# du -s /var/www/vhosts/*/statistics/logs/*.processed* | sort -n
604554      /var/www/vhosts/domain.tld/statistics/logs/access_log.processed
2245455      /var/www/vhosts/
The last file in the output will be the largest. Double-check its size:
# du -sh /var/www/vhosts/
2.2G     /var/www/vhosts/
If it is larger than 1 GB, it is most likely causing statistics to fail.


The problem usually occurs only on 32-bit systems, so in the long term, the best option would be to upgrade to a 64-bit environment.
Right now, we can split the file into smaller parts and have the statistics process those parts one-by-one. Follow these steps, assuming the problem domain name is "":
# cd /var/www/vhosts/
# split --line-bytes=1024m access_log.processed access_log.processed
You will get several small files like these:
Move the original access_log.processed file to a safe location, just in case:
# mkdir /root/log_backup
# mv access_log.processed /root/log_backup

Now we need to process each of the small files using the statistics utility:
Rename the first file to access_log.processed and launch statistics recalculation for the affected domain:
# mv access_log.processedaa access_log.processed
# /usr/local/psa/admin/bin/statistics --calculate-one
Then do the same for the rest of the small files, one-by-one. Once you complete all the steps, the statistics for the domain should become correct and its recalculation should stop failing.
To avoid the issue in the future, check your log rotation settings and make sure they are set to rotate log files by size, not by time.
In rare cases, if the minimum log rotation period, which is 1 day, is too long for you, you may create a cron job that will run every several hours and check statistics log file sizes, splitting them if necessary.

dd0611b6086474193d9bf78e2b293040 56797cefb1efc9130f7c48a7d1db0f0c a914db3fdc7a53ddcfd1b2db8f5a1b9c 29d1e90fd304f01e6420fbe60f66f838 6ef0db7f1685482449634a455d77d3f4 0a53c5a9ca65a74d37ef5c5eaeb55d7f

Email subscription for changes to this article
Save as PDF