Plesk

Unable to recalculate Plesk AWStats and rotate its log file: your log file must have a bad format or LogFormat parameter setup does not match this format

Symptoms

Cause

Product issue:

  • #PPPM-9832 "If web statistics are not generated properly, customers can now understand why because AWStats errors are now logged and customers can see them in the panel.log file (if the show.util_exec_io setting is set to true in the panel.ini file)."

    Fixed in:

Resolution

Please consider updating your server:

Workaround

If update is not possible for some reason you may try the following

workaround

  1. Connect to the server via SSH
  2. Open the file from the error message (/var/www/vhosts/system/example.com/logs/access_ssl_log.webstat) in any text editor, and remove incorrectly formatted lines like:

    203.0.113.2 - - [28/Oct/2017:09:10:31 +0900] "x15x03x00x00x02x01x00" 400 166 "-" "-"

    The correct format would be:

    203.0.113.1 - - [10/Jan/2001:02:14:14 +0200] "GET / HTTP/1.1" 200 1234 "http://www.fromserver.com/from.htm" "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)"

  3. Recalculate statistics again:

    # plesk sbin statistics --calculate-one --domain-name=example.com