Webalizer statistic is not being updated: Unable to restore run data

Created:

2016-11-16 12:39:59 UTC

Modified:

2017-08-16 16:35:30 UTC

0

Was this article helpful?


Have more questions?

Submit a request

Webalizer statistic is not being updated: Unable to restore run data

Applicable to:

  • Plesk 10.x for Windows
  • Plesk 10.x for Linux
  • Plesk 11.x for Linux
  • Plesk 12.0 for Windows
  • Plesk 12.0 for Linux
  • Plesk 12.5 for Windows

Symptoms

  1. On Plesk server it is not possible to view webstat:

    https://example.com/plesk-stat/webstat/

    "Forbidden
    You don't have permission to access /plesk-stat/webstat/ on this server.
    Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request.
  2. I am receiving the following notifications:

    /etc/cron.daily/00webalizer:   
    Error: Unable to restore run data (1)
  3. Any attempts to calculate statistics for the domain in question failed with the mentioned error:

    "%plesk_bin%\\statistics.exe" --process-domains=example.com --http-traffic
    Error: Unable to restore run data (99)

Cause

Webalizer data files in directory are corrupted or empty.

Windows:

    %plesk_vhosts%\\example.com\\statistics\\webstat\\webalizer.hist

Linux:

    /var/lib/webalizer/webalizer.hist

Resolution

  1. Rename the file to webalizer.current to _webalizer.current in %plesk_vhosts%\\example.com\\statistics\\webstat\\ folder.

  2. If the file %plesk_vhosts%\\example.com\\statistics\\webstat\\webalizer.hist is empty - then repopulate it with the lines below:

    1 2012 916445 846957 33016 12269256 1 28 119878 46843
    2 2012 1584003 1435316 50603 22511693 1 28 185821 78416
    5 2011 1648379 1475596 48197 24441403 1 31 201845 78148
    6 2011 510434 459696 17685 7297632 1 24 59204 24102
    7 2011 2266340 2025857 67837 33415021 1 31 297475 113283
    8 2011 2827946 2358126 75462 41039980 1 31 425157 124673
    9 2011 1946209 1750214 57484 31979188 1 31 292926 92228
    10 2011 774452 697399 25973 13868881 1 27 103147 37103
    11 2011 951374 862861 32603 14180463 1 30 115184 45752
    12 2011 1124112 1020824 38380 15325125 1 26 149930 55873

    This file has the structure as below:

    Month Year Hits Files Sites KBytes Fdom Ldom Pages Visits

    Where Fdom and Ldom the first and last days of processed statistics. All the values can be retrieved from files %plesk_vhosts%\\example.com\\statistics\\webstat\\usage_YYYYMM.html

  3. Then retrieve example.com domain ID and change LastHttpStatisticsRun and LastFtpStatisticsRun to 2012/01/01 00:00:00 for the registry key below, using obtained domain ID (Windows only):

    %plesk_bin%\\dbclient.exe --direct-sql --sql="select id from domains where name='example.com'"
    id
    11

    id=11, so the path to the key will be:

    HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\PLESK\\PSA Config\\Config\\Statistics\\DomainIds\\11
  4. Recalculate statistics using command:

    For windows:

    "%plesk_bin%"\\statistics.exe --calculate-one --domain-name=example.com
    "%plesk_bin%"\\web_statistics_executor.exe --calculate-domain --domain-name=example.com --webspace-name=example.com

    For Linux:

        [root@www ~]# sh /etc/cron.daily/00webalizer
Have more questions? Submit a request
Please sign in to leave a comment.