I originally looked into the issue because I received this cron email:
Error in the last Piwik archive.php run:
1 total errors during this script execution, please investigate and try and fix these errors. First error was: Got invalid response from API request: http://stats.postingplace.com/index.php?module=API&method=CoreAdminHome.runScheduledTasks&format=csv&convertToUnicode=0&token_auth=7abbdde2ba6f830a8b1808d2c48b2f4e&trigger=archivephp. Response was '<!-- SHTML Wrapper - 500 Server Error -->
<!-- PHP Wrapper - 500 Server Error -->
<html><head><title>500 Server Error</title></head> <body bgcolor=white>
<h1>500 S
Here is the full output of the script:
---------------------------
INIT
Querying Piwik API at: http://stats.postingplace.com/index.php
Running as Super User: admin
Notes
- Reports for today will be processed at most every 900 seconds. You can change this value in Piwik UI > Settings > General Settings.
- Reports for the current week/month/year will be refreshed at most every 3600 seconds.
- Archiving was last executed without error 59 min 13s ago Will process 0 websites with new visits since 59 min 13s
---------------------------
START
Starting Piwik reports archiving...
Done archiving!
---------------------------
SUMMARY
Total daily visits archived: 0
Archived today's reports for 0 websites
Archived week/month/year for 0 websites.
Skipped 20 websites: no new visit since the last script execution Skipped 0 websites day archiving: existing daily reports are less than 900 seconds old Skipped 0 websites week/month/year archiving: existing periods reports are less than 3600 seconds old Total API requests: 0
done: 0/0, 0 v, 0 wtoday, 0 wperiods, 0 req, 1 ms, no error Time elapsed: 0.001s
---------------------------
SCHEDULED TASKS
Starting Scheduled tasks...
ERROR: Got invalid response from API request: http://stats.postingplace.com/index.php?module=API&method=CoreAdminHome.runScheduledTasks&format=csv&convertToUnicode=0&token_auth=7abbdde2ba6f830a8b1808d2c48b2f4e&trigger=archivephp. Response was '<!-- SHTML Wrapper - 500 Server Error -->
<!-- PHP Wrapper - 500 Server Error -->
<html><head><title>500 Server Error</title></head> <body bgcolor=white>
<h1>500 Server Error</h1>
A misconfiguration on the server caused a hiccup.
Check the server logs, fix the problem, then try again.
<hr>
URL: http://stats.postingplace.com/index.php?module=API&method=CoreAdminHome.runScheduledTasks&format=csv&convertToUnicode=0&token_auth=7abbdde2ba6f830a8b1808d2c48b2f4e&trigger=archivephp<br>
<!-- CMD Wrapper -->
</body></html>'
done
---------------------------
SUMMARY OF ERRORS
Error: Got invalid response from API request: http://stats.postingplace.com/index.php?module=API&method=CoreAdminHome.runScheduledTasks&format=csv&convertToUnicode=0&token_auth=7abbdde2ba6f830a8b1808d2c48b2f4e&trigger=archivephp. Response was '<!-- SHTML Wrapper - 500 Server Error -->
<!-- PHP Wrapper - 500 Server Error -->
<html><head><title>500 Server Error</title></head> <body bgcolor=white>
<h1>500 S
1 total errors during this script execution, please investigate and try and fix these errors
ERROR: 1 total errors during this script execution, please investigate and try and fix these errors. First error was: Got invalid response from API request: http://stats.postingplace.com/index.php?module=API&method=CoreAdminHome.runScheduledTasks&format=csv&convertToUnicode=0&token_auth=7abbdde2ba6f830a8b1808d2c48b2f4e&trigger=archivephp. Response was '<!-- SHTML Wrapper - 500 Server Error -->
<!-- PHP Wrapper - 500 Server Error -->
<html><head><title>500 Server Error</title></head> <body bgcolor=white>
<h1>500 S
And misc/cron/error_log had this similar information:
[16-Jul-2012 07:54:28] PHP Fatal error: 1 total errors during this script execution, please investigate and try and fix these errors. First error was: Got invalid response from API request: http://stats.postingplace.com/index.php?module=API&method=CoreAdminHome.runScheduledTasks&format=csv&convertToUnicode=0&token_auth=7abbdde2ba6f830a8b1808d2c48b2f4e&trigger=archivephp. Response was ’
500 Server Error
500 S in /home3/postingp/public_html/stats/misc/cron/archive.php on line 555
Since none of the weekly emails were sent, I started going through as Admin and setting up a few test subscriptions and clicking “Download” to test and happened upon one that was causing the page to not load and a memory error to be recorded in php error log:
[26-Mar-2012 11:18:07] PHP Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 76 bytes) in /home3/postingp/public_html/stats/core/DataTable/Manager.php on line 76
Originally the memory limit was 64mb, I had bumped it a few times, ultimately to 512mb trying to resolve it.
[16-Jul-2012 13:08:28] PHP Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 72 bytes) in /home3/postingp/public_html/stats/core/DataTable/Manager.php on line 77
SInce other websites on the same Piwik were working, I started removing sections from the pdf email, ultimatley determining that the pagetitles section was culprit.
–
Nevertheless, after applying your patch, I am able to generate the report (Download link) where I was not able to before.
Our Piwik database is still very small if getting a backup helps.