matomo-org / matomo-for-wordpress

Get a fully functioning Matomo Analytics for your WordPress. Star us on Github? +1. Matomo is the leading open alternative to Google Analytics that gives you full control over your data. Privacy is built-in. 100% data ownership, no one else can see your data. We love Pull Requests!
https://matomo.org
GNU General Public License v3.0
120 stars 25 forks source link

Archiving Cron-Job fails #1160

Open Doems opened 5 months ago

Doems commented 5 months ago

Reporting is working, i have data in real-time visitor data, although there seems to be an issue with the archiving.
Could it be related to my plugin advanced-custom-fields?

Here is the info from the logs:

archive_main | 2024-06-20 11:40:10 | 8 total errors during this script execution, please investigate and try and fix these errors. => CronArchive.php:473; CronArchive.php:468; CronArchive.php:226; Access.php:567; CronArchive.php:230; ScheduledTasks.php:361; class-wp-hook.php:322; class-wp-hook.php:348; plugin.php:565; wp-cron.php:191; -- | -- | -- archive_errors | 2024-06-20 11:40:10 | 'Got invalid response from API request: ?module=API&method=CoreAdminHome.archiveReports&idSite=1&period=day&date=2024-06-20&format=json&trigger=archivephp. Response was \'PHP Parse error: syntax error, unexpected \'string\' (T_STRING), expecting function (T_FUNCTION) or const (T_CONST) in $abs_path/wp-content/plugins/advanced-custom-fields/includes/class-acf-site-health.php on line 23 WordPress › Error

There has been a critical error on this website.

Learn more about troubleshooting WordPress.

\'' 'Error unserializing the following response from ?module=API&method=CoreAdminHome.archiveReports&idSite=1&period=day&date=2024-06-20&format=json&trigger=archivephp: \'PHP Parse error: syntax error, unexpected \'string\' (T_STRING), expecting function (T_FUNCTION) or const (T_CONST) in $abs_path/wp-content/plugins/advanced-custom-fields/includes/class-acf-site-health.php on line 23 WordPress › Error

There has been a critical error on this website.

Learn more about troubleshooting WordPress.

\'' 'Got invalid response from API request: ?module=API&method=CoreAdminHome.archiveReports&idSite=1&period=week&date=2024-06-17&format=json&trigger=archivephp. Response was \'PHP Parse error: syntax error, unexpected \'string\' (T_STRING), expecting function (T_FUNCTION) or const (T_CONST) in $abs_path/wp-content/plugins/advanced-custom-fields/includes/class-acf-site-health.php on line 23 WordPress › Error

There has been a critical error on this website.

Learn more about troubleshooting WordPress.

\'' 'Error unserializing the following response from ?module=API&method=CoreAdminHome.archiveReports&idSite=1&period=week&date=2024-06-17&format=json&trigger=archivephp: \'PHP Parse error: syntax error, unexpected \'string\' (T_STRING), expecting function (T_FUNCTION) or const (T_CONST) in $abs_path/wp-content/plugins/advanced-custom-fields/includes/class-acf-site-health.php on line 23 WordPress › Error

There has been a critical error on this website.

Learn more about troubleshooting WordPress.

\'' 'Got invalid response from API request: ?module=API&method=CoreAdminHome.archiveReports&idSite=1&period=month&date=2024-06-01&format=json&trigger=archivephp. Response was \'PHP Parse error: syntax error, unexpected \'string\' (T_STRING), expecting function (T_FUNCTION) or const (T_CONST) in $abs_path/wp-content/plugins/advanced-custom-fields/includes/class-acf-site-health.php on line 23 WordPress › Error

There has been a critical error on this website.

Learn more about troubleshooting WordPress.

\'' 'Error unserializing the following response from ?module=API&method=CoreAdminHome.archiveReports&idSite=1&period=month&date=2024-06-01&format=json&trigger=archivephp: \'PHP Parse error: syntax error, unexpected \'string\' (T_STRING), expecting function (T_FUNCTION) or const (T_CONST) in $abs_path/wp-content/plugins/advanced-custom-fields/includes/class-acf-site-health.php on line 23 WordPress › Error

There has been a critical error on this website.

Learn more about troubleshooting WordPress.

\'' 'Got invalid response from API request: ?module=API&method=CoreAdminHome.archiveReports&idSite=1&period=year&date=2024-01-01&format=json&trigger=archivephp. Response was \'PHP Parse error: syntax error, unexpected \'string\' (T_STRING), expecting function (T_FUNCTION) or const (T_CONST) in $abs_path/wp-content/plugins/advanced-custom-fields/includes/class-acf-site-health.php on line 23 WordPress › Error

There has been a critical error on this website.

Learn more about troubleshooting WordPress.

\'' 'Error unserializing the following response from ?module=API&method=CoreAdminHome.archiveReports&idSite=1&period=year&date=2024-01-01&format=json&trigger=archivephp: \'PHP Parse error: syntax error, unexpected \'string\' (T_STRING), expecting function (T_FUNCTION) or const (T_CONST) in $abs_path/wp-content/plugins/advanced-custom-fields/includes/class-acf-site-health.php on line 23 WordPress › Error

There has been a critical error on this website.

Learn more about troubleshooting WordPress.

\'' '8 total errors during this script execution, please investigate and try and fix these errors.' => ScheduledTasks.php:375; class-wp-hook.php:322; class-wp-hook.php:348; plugin.php:565; wp-cron.php:191;
diosmosis commented 5 months ago

Hi @Doems, it sounds like the version of the PHP CLI executable Matomo detected does not match the version that is serving web requests. The simplest way to fix this is to enable the “Enable archiving via HTTP requests” setting in Matomo Analytics > Settings > Advanced.

If you want to keep CLI archiving enabled (mostly only worthwhile if you expect a lot of web traffic), you will need to find the path to the proper PHP executable on your web server and set it manually in Matomo's config. See https://matomo.org/faq/how-to-solve-the-error-message-your-php-cli-version-is-not-compatible-with-the-matomo-requirements/ for more details.