I think to found 2 bugs in archive.php script
1.
If API request fails with empty response (example in case of PHP memory_limit problem) the archive.php script realize that (output of the script), but marks the generated reports as valid (Archiving was last executed without error 2 Minuten 31s ago). But this is wrong then. The frontend then shows "There is no data for this report."
2.
I then try to run it to force this errors:
/usr/bin/php5 /var/www/piwik/misc/cron/archive.php --force-all-websites --url=http://mydomain.com/piwik/
This also produces a error output:
[2012-06-12 10:29:56] [dc268537] --force-all-websites was detected: the script will archive all websites and all periods sequentially
[2012-06-12 10:29:56] [dc268537] ---------------------------
[2012-06-12 10:29:56] [dc268537] INIT
[2012-06-12 10:29:56] [dc268537] Querying Piwik API at: http://mydomain.com/piwik/index.php
[2012-06-12 10:29:56] [dc268537] Running as Super User: admin
[2012-06-12 10:29:56] [dc268537] Notes
[2012-06-12 10:29:56] [dc268537] - Reports for today will be processed at most every 10 seconds. You can change this value in Piwik UI > Settings > General Settings.
[2012-06-12 10:29:56] [dc268537] - Reports for the current week/month/year will be refreshed at most every 3600 seconds.
[2012-06-12 10:29:56] [dc268537] - Archiving was last executed without error 2 Minuten 31s ago
[2012-06-12 10:29:56] [dc268537] Will process 1 websites
[2012-06-12 10:29:56] [dc268537] ---------------------------
[2012-06-12 10:29:56] [dc268537] START
[2012-06-12 10:29:56] [dc268537] Starting Piwik reports archiving...
PHP Notice: Undefined property: Archiving::$idSitesInvalidatedOldReports in /var/www/piwik/misc/cron/archive.php on line 236
PHP Warning: in_array() expects parameter 2 to be array, null given in /var/www/piwik/misc/cron/archive.php on line 236
The reports aren't generated again a result
(In [6487]) Refs #3218 fixing notice PHP Notice: Undefined property: Archiving::$idSitesInvalidatedOldReports in /var/www/piwik/misc/cron/archive.php on line 236
PHP Warning: in_array() expects parameter 2 to be array, null given in /var/www/piwik/misc/cron/archive.php on line 236
After looking at the code I cannot verify / reproduce the bug:
1. If API request fails with empty response (example in case of PHP memory_limit problem) the archive.php script realize that (output of the script), but marks the generated reports as valid (Archiving was last executed without error 2 Minuten 31s ago).
Please comment if the bug really exists in 1.8.2 -- thanks!