Can't get web cron to work on a shared host


#1

I’m trying to enable web cron on a shared hosting provider (TransIP). I am running Matomo v3.4.0. All three sites don’t seem to process, all with the same error:

ERROR CoreAdminHome[2018-04-07 13:00:01 UTC] [c6553] Empty or invalid response '<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <html><head> <title>301 Moved Permanently</title> </head><body> <h1>Moved Permanently</h1> <p>The document has moved <a href="https://mydomain.com/piwik/?module=API&amp;method=API.get&amp;idSite=1&amp;period=day&amp;date=last52&amp;format=php&amp;trigger=archivephp&amp;token_auth=removed">here</a>.</p> </body></html>' for website id 1, Time elapsed: 0.115s, skipping

Any thoughts on what may be causing this? I have taken a look at system check, and it tells me all is fine except:

  • shell_exec
  • set_time_limit
  • LOAD DATA INFILE

I have tried fixing these but since I am on a shared host there isn’t much I can do… Would any of these be the cause? Or is something else going on?

Full web cron log pasted below.

INFO CoreAdminHome[2018-04-07 13:00:01 UTC] [c6553] ---------------------------
INFO CoreAdminHome[2018-04-07 13:00:01 UTC] [c6553] INIT
INFO CoreAdminHome[2018-04-07 13:00:01 UTC] [c6553] Running Matomo 3.4.0 as Super User
INFO CoreAdminHome[2018-04-07 13:00:01 UTC] [c6553] ---------------------------
INFO CoreAdminHome[2018-04-07 13:00:01 UTC] [c6553] NOTES
INFO CoreAdminHome[2018-04-07 13:00:01 UTC] [c6553] - If you execute this script at least once per hour (or more often) in a crontab, you may disable 'Browser trigger archiving' in Matomo UI > Settings > General Settings.
INFO CoreAdminHome[2018-04-07 13:00:01 UTC] [c6553] See the doc at: https://matomo.org/docs/setup-auto-archiving/
INFO CoreAdminHome[2018-04-07 13:00:01 UTC] [c6553] - Reports for today will be processed at most every 150 seconds. You can change this value in Matomo UI > Settings > General Settings.
INFO CoreAdminHome[2018-04-07 13:00:01 UTC] [c6553] - Reports for the current week/month/year will be requested at most every 3600 seconds.
INFO CoreAdminHome[2018-04-07 13:00:01 UTC] [c6553] - Archiving was last executed without error 1 years 11 days ago
INFO CoreAdminHome[2018-04-07 13:00:01 UTC] [c6553] - Will process 3 other websites because the last time they were archived was on a different day (in the website's timezone) , IDs: 1, 2, 3
INFO CoreAdminHome[2018-04-07 13:00:01 UTC] [c6553] - Will process 1 other websites because some old data reports have been invalidated (eg. using the Log Import script or the InvalidateReports plugin) , IDs: 3
INFO CoreAdminHome[2018-04-07 13:00:01 UTC] [c6553] ---------------------------
INFO CoreAdminHome[2018-04-07 13:00:01 UTC] [c6553] START
INFO CoreAdminHome[2018-04-07 13:00:01 UTC] [c6553] Starting Matomo reports archiving...
INFO CoreAdminHome[2018-04-07 13:00:01 UTC] [c6553] Day has finished for website id 1 since last run
INFO CoreAdminHome[2018-04-07 13:00:01 UTC] [c6553] Will pre-process for website id = 1, period = day, date = last52
INFO CoreAdminHome[2018-04-07 13:00:01 UTC] [c6553] - pre-processing all visits
ERROR CoreAdminHome[2018-04-07 13:00:01 UTC] [c6553] Empty or invalid response '<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <html><head> <title>301 Moved Permanently</title> </head><body> <h1>Moved Permanently</h1> <p>The document has moved <a href="https://mydomain.com/piwik/?module=API&amp;method=API.get&amp;idSite=1&amp;period=day&amp;date=last52&amp;format=php&amp;trigger=archivephp&amp;token_auth=removed">here</a>.</p> </body></html>' for website id 1, Time elapsed: 0.115s, skipping
INFO CoreAdminHome[2018-04-07 13:00:01 UTC] [c6553] Day has finished for website id 2 since last run
INFO CoreAdminHome[2018-04-07 13:00:01 UTC] [c6553] Will pre-process for website id = 2, period = day, date = last52
INFO CoreAdminHome[2018-04-07 13:00:01 UTC] [c6553] - pre-processing all visits
ERROR CoreAdminHome[2018-04-07 13:00:01 UTC] [c6553] Empty or invalid response '<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <html><head> <title>301 Moved Permanently</title> </head><body> <h1>Moved Permanently</h1> <p>The document has moved <a href="https://mydomain.com/piwik/?module=API&amp;method=API.get&amp;idSite=2&amp;period=day&amp;date=last52&amp;format=php&amp;trigger=archivephp&amp;token_auth=removed">here</a>.</p> </body></html>' for website id 2, Time elapsed: 0.110s, skipping
INFO CoreAdminHome[2018-04-07 13:00:01 UTC] [c6553] Day has finished for website id 3 since last run
INFO CoreAdminHome[2018-04-07 13:00:01 UTC] [c6553] Will pre-process for website id = 3, period = day, date = last52
INFO CoreAdminHome[2018-04-07 13:00:01 UTC] [c6553] - pre-processing all visits
ERROR CoreAdminHome[2018-04-07 13:00:02 UTC] [c6553] Empty or invalid response '<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <html><head> <title>301 Moved Permanently</title> </head><body> <h1>Moved Permanently</h1> <p>The document has moved <a href="https://mydomain.com/piwik/?module=API&amp;method=API.get&amp;idSite=3&amp;period=day&amp;date=last52&amp;format=php&amp;trigger=archivephp&amp;token_auth=removed">here</a>.</p> </body></html>' for website id 3, Time elapsed: 0.109s, skipping
INFO CoreAdminHome[2018-04-07 13:00:02 UTC] [c6553] Done archiving!
INFO CoreAdminHome[2018-04-07 13:00:02 UTC] [c6553] ---------------------------
INFO CoreAdminHome[2018-04-07 13:00:02 UTC] [c6553] SUMMARY
INFO CoreAdminHome[2018-04-07 13:00:02 UTC] [c6553] Total visits for today across archived websites: 0
INFO CoreAdminHome[2018-04-07 13:00:02 UTC] [c6553] Archived today's reports for 0 websites
INFO CoreAdminHome[2018-04-07 13:00:02 UTC] [c6553] Archived week/month/year for 0 websites
INFO CoreAdminHome[2018-04-07 13:00:02 UTC] [c6553] Skipped 3 websites
INFO CoreAdminHome[2018-04-07 13:00:02 UTC] [c6553] - 0 skipped because no new visit since the last script execution
INFO CoreAdminHome[2018-04-07 13:00:02 UTC] [c6553] - 0 skipped because existing daily reports are less than 150 seconds old
INFO CoreAdminHome[2018-04-07 13:00:02 UTC] [c6553] - 0 skipped because existing week/month/year periods reports are less than 3600 seconds old
INFO CoreAdminHome[2018-04-07 13:00:02 UTC] [c6553] - 3 skipped because got an error while querying reporting API
INFO CoreAdminHome[2018-04-07 13:00:02 UTC] [c6553] Total API requests: 0
INFO CoreAdminHome[2018-04-07 13:00:02 UTC] [c6553] done: 0/3 0%, 0 vtoday, 0 wtoday, 0 wperiods, 0 req, 337 ms, 3 errors.
INFO CoreAdminHome[2018-04-07 13:00:02 UTC] [c6553] Time elapsed: 0.337s
INFO CoreAdminHome[2018-04-07 13:00:02 UTC] [c6553] ---------------------------
INFO CoreAdminHome[2018-04-07 13:00:02 UTC] [c6553] SCHEDULED TASKS
INFO CoreAdminHome[2018-04-07 13:00:02 UTC] [c6553] Starting Scheduled tasks...
INFO CoreAdminHome[2018-04-07 13:00:02 UTC] [c6553] Scheduler: executing task Piwik\Plugins\ExamplePlugin\Tasks.myTask...
INFO CoreAdminHome[2018-04-07 13:00:02 UTC] [c6553] Scheduler: finished. Time elapsed: 0.000s
INFO CoreAdminHome[2018-04-07 13:00:02 UTC] [c6553] Scheduler: executing task Piwik\Plugins\CustomPiwikJs\Tasks.updateTracker...
INFO CoreAdminHome[2018-04-07 13:00:02 UTC] [c6553] Scheduler: finished. Time elapsed: 0.001s
INFO CoreAdminHome[2018-04-07 13:00:02 UTC] [c6553] done
INFO CoreAdminHome[2018-04-07 13:00:02 UTC] [c6553] ---------------------------
INFO CoreAdminHome[2018-04-07 13:00:02 UTC] [c6553] ---------------------------
INFO CoreAdminHome[2018-04-07 13:00:02 UTC] [c6553] SUMMARY OF ERRORS
INFO CoreAdminHome[2018-04-07 13:00:02 UTC] [c6553] Error: Empty or invalid response '<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <html><head> <title>301 Moved Permanently</title> </head><body> <h1>Moved Permanently</h1> <p>The document has moved <a href="https://mydomain.com/piwik/?module=API&amp;method=API.get&amp;idSite=1&amp;period=day&amp;date=last52&amp;format=php&amp;trigger=archivephp&amp;token_auth=removed">here</a>.</p> </body></html>' for website id 1, Time elapsed: 0.115s, skipping
INFO CoreAdminHome[2018-04-07 13:00:02 UTC] [c6553] Error: Empty or invalid response '<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <html><head> <title>301 Moved Permanently</title> </head><body> <h1>Moved Permanently</h1> <p>The document has moved <a href="https://mydomain.com/piwik/?module=API&amp;method=API.get&amp;idSite=2&amp;period=day&amp;date=last52&amp;format=php&amp;trigger=archivephp&amp;token_auth=removed">here</a>.</p> </body></html>' for website id 2, Time elapsed: 0.110s, skipping
INFO CoreAdminHome[2018-04-07 13:00:02 UTC] [c6553] Error: Empty or invalid response '<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <html><head> <title>301 Moved Permanently</title> </head><body> <h1>Moved Permanently</h1> <p>The document has moved <a href="https://mydomain.com/piwik/?module=API&amp;method=API.get&amp;idSite=3&amp;period=day&amp;date=last52&amp;format=php&amp;trigger=archivephp&amp;token_auth=removed">here</a>.</p> </body></html>' for website id 3, Time elapsed: 0.109s, skipping
ERROR CoreAdminHome[2018-04-07 13:00:02 UTC] [c6553] 3 total errors during this script execution, please investigate and try and fix these errors.
Error: 3 total errors during this script execution, please investigate and try and fix these errors.

Update: my host tells me a script is producing the following error:

FastCGI: server "/var/run/php71-cgi/php-cgi" stderr: PHP message: PHP Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 65536 bytes) in /www/piwik/vendor/composer/ClassLoader.php on line 444 

#2

In an attempt to isolate the issue I decided to do a clean install of Matomo 3.5.0 on the same shared hosting account. Set up a web cron, and it outputs the same error. So I guess at least we can be sure this isn’t caused by the particulars of my data. But I am stumped on what is causing the issue. Anyone? Below is the latest output of the web cron.

INFO CoreAdminHome[2018-05-23 06:00:02 UTC] [847d6] ---------------------------
INFO CoreAdminHome[2018-05-23 06:00:02 UTC] [847d6] INIT
INFO CoreAdminHome[2018-05-23 06:00:02 UTC] [847d6] Running Matomo 3.5.0 as Super User
INFO CoreAdminHome[2018-05-23 06:00:02 UTC] [847d6] ---------------------------
INFO CoreAdminHome[2018-05-23 06:00:02 UTC] [847d6] NOTES
INFO CoreAdminHome[2018-05-23 06:00:02 UTC] [847d6] - If you execute this script at least once per hour (or more often) in a crontab, you may disable 'Browser trigger archiving' in Matomo UI > Settings > General Settings.
INFO CoreAdminHome[2018-05-23 06:00:02 UTC] [847d6] See the doc at: https://matomo.org/docs/setup-auto-archiving/
INFO CoreAdminHome[2018-05-23 06:00:02 UTC] [847d6] - Reports for today will be processed at most every 150 seconds. You can change this value in Matomo UI > Settings > General Settings.
INFO CoreAdminHome[2018-05-23 06:00:02 UTC] [847d6] - Reports for the current week/month/year will be requested at most every 3600 seconds.
INFO CoreAdminHome[2018-05-23 06:00:02 UTC] [847d6] - Archiving was last executed without error 9 hours 0 min ago
INFO CoreAdminHome[2018-05-23 06:00:02 UTC] [847d6] - Will process 1 other websites because the last time they were archived was on a different day (in the website's timezone) , IDs: 1
INFO CoreAdminHome[2018-05-23 06:00:02 UTC] [847d6] ---------------------------
INFO CoreAdminHome[2018-05-23 06:00:02 UTC] [847d6] START
INFO CoreAdminHome[2018-05-23 06:00:02 UTC] [847d6] Starting Matomo reports archiving...
INFO CoreAdminHome[2018-05-23 06:00:02 UTC] [847d6] Day has finished for website id 1 since last run
INFO CoreAdminHome[2018-05-23 06:00:02 UTC] [847d6] Will pre-process for website id = 1, period = day, date = last2
INFO CoreAdminHome[2018-05-23 06:00:02 UTC] [847d6] - pre-processing all visits
ERROR CoreAdminHome[2018-05-23 06:00:02 UTC] [847d6] Empty or invalid response '<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <html><head> <title>301 Moved Permanently</title> </head><body> <h1>Moved Permanently</h1> <p>The document has moved <a href="https://mydomain.com/matomo/?module=API&amp;method=API.get&amp;idSite=1&amp;period=day&amp;date=last2&amp;format=php&amp;trigger=archivephp&amp;token_auth=removed">here</a>.</p> </body></html>' for website id 1, Time elapsed: 0.123s, skipping
INFO CoreAdminHome[2018-05-23 06:00:02 UTC] [847d6] Done archiving!
INFO CoreAdminHome[2018-05-23 06:00:02 UTC] [847d6] ---------------------------
INFO CoreAdminHome[2018-05-23 06:00:02 UTC] [847d6] SUMMARY
INFO CoreAdminHome[2018-05-23 06:00:02 UTC] [847d6] Total visits for today across archived websites: 0
INFO CoreAdminHome[2018-05-23 06:00:02 UTC] [847d6] Archived today's reports for 0 websites
INFO CoreAdminHome[2018-05-23 06:00:02 UTC] [847d6] Archived week/month/year for 0 websites
INFO CoreAdminHome[2018-05-23 06:00:02 UTC] [847d6] Skipped 1 websites
INFO CoreAdminHome[2018-05-23 06:00:02 UTC] [847d6] - 0 skipped because no new visit since the last script execution
INFO CoreAdminHome[2018-05-23 06:00:02 UTC] [847d6] - 0 skipped because existing daily reports are less than 150 seconds old
INFO CoreAdminHome[2018-05-23 06:00:02 UTC] [847d6] - 0 skipped because existing week/month/year periods reports are less than 3600 seconds old
INFO CoreAdminHome[2018-05-23 06:00:02 UTC] [847d6] - 1 skipped because got an error while querying reporting API
INFO CoreAdminHome[2018-05-23 06:00:02 UTC] [847d6] Total API requests: 0
INFO CoreAdminHome[2018-05-23 06:00:02 UTC] [847d6] done: 0/1 0%, 0 vtoday, 0 wtoday, 0 wperiods, 0 req, 132 ms, 1 errors.
INFO CoreAdminHome[2018-05-23 06:00:02 UTC] [847d6] Time elapsed: 0.132s
INFO CoreAdminHome[2018-05-23 06:00:02 UTC] [847d6] ---------------------------
INFO CoreAdminHome[2018-05-23 06:00:02 UTC] [847d6] SCHEDULED TASKS
INFO CoreAdminHome[2018-05-23 06:00:02 UTC] [847d6] Starting Scheduled tasks...
INFO CoreAdminHome[2018-05-23 06:00:02 UTC] [847d6] Scheduler: executing task Piwik\Plugins\ExamplePlugin\Tasks.myTask...
INFO CoreAdminHome[2018-05-23 06:00:02 UTC] [847d6] Scheduler: finished. Time elapsed: 0.000s
INFO CoreAdminHome[2018-05-23 06:00:02 UTC] [847d6] Scheduler: executing task Piwik\Plugins\CustomPiwikJs\Tasks.updateTracker...
INFO CoreAdminHome[2018-05-23 06:00:02 UTC] [847d6] Scheduler: finished. Time elapsed: 0.008s
INFO CoreAdminHome[2018-05-23 06:00:02 UTC] [847d6] Scheduler: executing task Piwik\Plugins\PrivacyManager\Tasks.anonymizePastData...
INFO CoreAdminHome[2018-05-23 06:00:02 UTC] [847d6] Scheduler: finished. Time elapsed: 0.002s
INFO CoreAdminHome[2018-05-23 06:00:02 UTC] [847d6] done
INFO CoreAdminHome[2018-05-23 06:00:02 UTC] [847d6] ---------------------------
INFO CoreAdminHome[2018-05-23 06:00:02 UTC] [847d6] ---------------------------
INFO CoreAdminHome[2018-05-23 06:00:02 UTC] [847d6] SUMMARY OF ERRORS
INFO CoreAdminHome[2018-05-23 06:00:02 UTC] [847d6] Error: Empty or invalid response '<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <html><head> <title>301 Moved Permanently</title> </head><body> <h1>Moved Permanently</h1> <p>The document has moved <a href="https://mydomain.com/matomo/?module=API&amp;method=API.get&amp;idSite=1&amp;period=day&amp;date=last2&amp;format=php&amp;trigger=archivephp&amp;token_auth=removed">here</a>.</p> </body></html>' for website id 1, Time elapsed: 0.123s, skipping
ERROR CoreAdminHome[2018-05-23 06:00:02 UTC] [847d6] 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.

And these errors show up in my server log:

FastCGI: incomplete headers (0 bytes) received from server "/var/run/php71-cgi/php-cgi", referer: https://mydomain.com/matomo/index.php?module=CoreHome&action=index&idSite=1&period=day&date=yesterday

FastCGI: server "/var/run/php71-cgi/php-cgi" stderr: PHP message: PHP Fatal error: Unknown: PHP Configuration Error (CGROUP_MISSING) in Unknown on line 0, referer: https://mydomain.com/matomo/index.php?module=CoreHome&action=index&idSite=1&period=day&date=yesterday