PHP Fatal error: Uncaught Exception
-
I see such an entry in my PHP error log ~once a day. Should I be concerned?
[28-Mar-2021 16:45:16 UTC] PHP Fatal error: Uncaught Exception: 2 total errors during this script execution, please investigate and try and fix these errors. in /usr/local/lsws/wordpress/wp-content/plugins/matomo/app/core/CronArchive.php:605
Stack trace:
#0 /usr/local/lsws/wordpress/wp-content/plugins/matomo/app/core/CronArchive.php(598): Piwik\CronArchive->logFatalError()
#1 /usr/local/lsws/wordpress/wp-content/plugins/matomo/app/core/CronArchive.php(264): Piwik\CronArchive->end()
#2 /usr/local/lsws/wordpress/wp-content/plugins/matomo/app/core/Access.php(673): Piwik\CronArchive->Piwik\{closure}()
#3 /usr/local/lsws/wordpress/wp-content/plugins/matomo/app/core/CronArchive.php(268): Piwik\Access::doAsSuperUser()
#4 /usr/local/lsws/wordpress/wp-content/plugins/matomo/classes/WpMatomo/ScheduledTasks.php(288): Piwik\CronArchive->main()
#5 /usr/local/lsws/wordpress/wp-includes/class-wp-hook.php(290): WpMatomo\ScheduledTasks->archive()
#6 /usr/local/lsws/wordpress/wp-includes/class-wp-hook.php(316): WP_Hook->apply_filters()
#7 /usr/local/lsws/wordpress/wp-in in /usr/local/lsws/wordpress/wp-content/plugins/matomo/app/core/CronArchive.php on line 605
-
Hi @saowp sorry about that problem.
It seems the actual error message is missing. Is there maybe any chance you can go to “WP Admin Dashboard -> Matomo Analytics -> Diagnostics -> Troubleshooting” and click on this page on the first button which says “Archive reports”?
Does it maybe show a different error message?
If you could otherwise also post the output of the system report (see https://matomo.org/faq/wordpress/how-do-i-find-and-copy-the-system-report-in-matomo-for-wordpress/ ) here that be great as this might contain a more detailed error message too.
Thanks for this @saowp
Hullo @tsteur ! I went and clicked “Archive reports” as you requested, after clicking there was error showed by the dashboard nor any addition to the PHP log file. System report pasted below
# Matomo
* Matomo Plugin Version: 4.2.0
* Config exists and is writable.: Yes (“$ABSPATH/wp-content/uploads/matomo/config/config.ini.php” )
* JS Tracker exists and is writable.: Yes (“$ABSPATH/wp-content/uploads/matomo/matomo.js” )
* Plugin directories: Yes ([{“pluginsPathAbsolute”:”$ABSPATH\/wp-content\/plugins\/matomo\/plugins”,”webrootDirRelativeToMatomo”:”..\/”}])
* Tmp directory writable: Yes ($ABSPATH/wp-content/cache/matomo)
* Matomo Version: 4.2.1
* Matomo Blog idSite: 1
* Matomo Install Version: No
* Upgrades outstanding: No
* Upgrade in progress: No## Endpoints
* Matomo JavaScript Tracker URL: ($site_url/wp-content/uploads/matomo/matomo.js)
* Matomo JavaScript Tracker – WP Rest API: ($site_url/wp-json/matomo/v1/hit/)
* Matomo HTTP Tracking API: ($site_url/wp-content/plugins/matomo/app/matomo.php)
* Matomo HTTP Tracking API – WP Rest API: ($site_url/wp-json/matomo/v1/hit/)## Crons
* Server time: 2021-03-30 03:44:07
* Blog time: 2021-03-30 09:14:07 (Below dates are shown in blog timezone)
* Sync users & sites: Next run: 2021-03-30 18:14:35 (9 hours 0 min) ( Last started: 2021-03-29 18:16:50 (-14 hours 57 min). Last ended: 2021-03-29 18:16:50 (-14 hours 57 min). Interval: daily)
* Archive: Next run: 2021-03-30 09:14:35 (28s) ( Last started: 2021-03-30 08:14:39 (-59 min 28s). Last ended: 2021-03-30 08:14:43 (-59 min 24s). Interval: hourly)
* Update GeoIP DB: Next run: 2021-04-02 18:14:35 (3 days 9 hours) ( Last started: 2021-03-03 18:16:38 (-26 days 14 hours). Last ended: 2021-03-03 18:16:40 (-26 days 14 hours). Interval: matomo_monthly)## Mandatory checks
* PHP version >= : ok
* PDO extension: ok
* PDO\MYSQL extension: ok
* MYSQLI extension: ok
* Other required extensions: ok
* Required functions: ok
* Required PHP configuration (php.ini): ok
* Directories with write access: ok
* Directories with write access for Tag Manager: ok## Optional checks
* Tracker status: ok
* Memory limit: ok
* Time zone: ok
* Open URL: ok
* PageSpeed disabled: ok
* GD > 2.x + Freetype (graphics): ok
* Other extensions: ok
* Other functions: ok
* Filesystem: ok
* Last Successful Archiving Completion: ok
* Database abilities: ok
* Warning Max Packet Size: warning (It is recommended to configure a ‘max_allowed_packet’ size in your MySQL database of at least 64MB. Configured is currently 16MB. )
* Geolocation: ok
* Update over HTTPS: ok
* Writable JavaScript Tracker (“/matomo.js”): ok
* Supports Async Archiving: Yes
* Location provider ID: geoip2php
* Location provider available: Yes
* Location provider working: Yes
* Warning Proxy header: HTTP_X_FORWARDED_FOR (A proxy header is set which means you maybe need to configure a proxy header in the Advanced settings to make location reporting work. If the location in your reports is detected correctly, you can ignore this warning. Learn more: https://matomo.org/faq/$DB_NAME/how-do-i-fix-the-proxy-header-warning-in-the-matomo-for-$DB_NAME-system-report/)
* Warning Proxy header: HTTP_CF_CONNECTING_IP (A proxy header is set which means you maybe need to configure a proxy header in the Advanced settings to make location reporting work. If the location in your reports is detected correctly, you can ignore this warning. Learn more: https://matomo.org/faq/$DB_NAME/how-do-i-fix-the-proxy-header-warning-in-the-matomo-for-$DB_NAME-system-report/)
* Had visit in last 5 days: Yes## Matomo Settings
* Track mode: default
* Track codeposition: footer
* Track api endpoint: default
* Track js endpoint: default
* Last settings update: 1607417644
* Last tracking settings update: 1607417644
* Track noscript: Yes
* Track across alias: Yes
* Track heartbeat: 15
* Show get started page: 0
* Core version: 4.2.1
* Version history: 4.2.0, 4.1.3, 4.1.2, 4.1.1, 4.1.0## Logs
* Warning archive_main: 2021-03-28 15:14:58 (2 total errors during this script execution, please investigate and try and fix these errors. => CronArchive.php:605; CronArchive.php:598; CronArchive.php:264; Access.php:673; CronArchive.php:268; ScheduledTasks.php:288; class-wp-hook.php:290; class-wp-hook.php:316; plugin.php:551; wp-cron.php:138;)
* Warning archive_errors: 2021-03-28 15:14:58 (‘Got invalid response from API request: ?module=API&method=CoreAdminHome.archiveReports&idSite=1&period=month&date=2021-03-01&format=json&trigger=archivephp. The response was empty. This usually means a server error. A solution to this error is generally to increase the value of \’memory_limit\’ in your php.ini file. For more information and the error message please check in your PHP CLI error log file. As this core:archive command triggers PHP processes over the CLI, you can find where PHP CLI logs are stored by running this command: php -i | grep error_log’ ‘Error unserializing the following response from ?module=API&method=CoreAdminHome.archiveReports&idSite=1&period=month&date=2021-03-01&format=json&trigger=archivephp: \’\” ‘2 total errors during this script execution, please investigate and try and fix these errors.’ => ScheduledTasks.php:301; class-wp-hook.php:290; class-wp-hook.php:316; plugin.php:551; wp-cron.php:138;)
* Warning archive_main: 2021-03-28 22:15:16 (2 total errors during this script execution, please investigate and try and fix these errors. => CronArchive.php:605; CronArchive.php:598; CronArchive.php:264; Access.php:673; CronArchive.php:268; ScheduledTasks.php:288; class-wp-hook.php:290; class-wp-hook.php:316; plugin.php:551; wp-cron.php:138;)
* Warning archive_errors: 2021-03-28 22:15:16 (‘Got invalid response from API request: ?module=API&method=CoreAdminHome.archiveReports&idSite=1&period=day&date=2021-03-28&format=json&trigger=archivephp. The response was empty. This usually means a server error. A solution to this error is generally to increase the value of \’memory_limit\’ in your php.ini file. For more information and the error message please check in your PHP CLI error log file. As this core:archive command triggers PHP processes over the CLI, you can find where PHP CLI logs are stored by running this command: php -i | grep error_log’ ‘Error unserializing the following response from ?module=API&method=CoreAdminHome.archiveReports&idSite=1&period=day&date=2021-03-28&format=json&trigger=archivephp: \’\” ‘2 total errors during this script execution, please investigate and try and fix these errors.’ => ScheduledTasks.php:301; class-wp-hook.php:290; class-wp-hook.php:316; plugin.php:551; wp-cron.php:138;)
* Warning archive_main: 2021-03-29 16:14:56 (2 total errors during this script execution, please investigate and try and fix these errors. => CronArchive.php:605; CronArchive.php:598; CronArchive.php:264; Access.php:673; CronArchive.php:268; ScheduledTasks.php:288; class-wp-hook.php:290; class-wp-hook.php:316; plugin.php:551; wp-cron.php:138;)
* Warning archive_errors: 2021-03-29 16:14:56 (‘Got invalid response from API request: ?module=API&method=CoreAdminHome.archiveReports&idSite=1&period=day&date=2021-03-29&format=json&trigger=archivephp. The response was empty. This usually means a server error. A solution to this error is generally to increase the value of \’memory_limit\’ in your php.ini file. For more information and the error message please check in your PHP CLI error log file. As this core:archive command triggers PHP processes over the CLI, you can find where PHP CLI logs are stored by running this command: php -i | grep error_log’ ‘Error unserializing the following response from ?module=API&method=CoreAdminHome.archiveReports&idSite=1&period=day&date=2021-03-29&format=json&trigger=archivephp: \’\” ‘2 total errors during this script execution, please investigate and try and fix these errors.’ => ScheduledTasks.php:301; class-wp-hook.php:290; class-wp-hook.php:316; plugin.php:551; wp-cron.php:138;)# WordPress
* Home URL: $site_url
* Site URL: $site_url
* WordPress Version: 5.7
* Number of blogs: 1
* Multisite Enabled: No
* Network Enabled: No
* WP_DEBUG: No
* WP_DEBUG_DISPLAY: No
* WP_DEBUG_LOG: No
* DISABLE_WP_CRON: –
* FORCE_SSL_ADMIN: Yes
* WP_CACHE: Yes
* CONCATENATE_SCRIPTS: –
* COMPRESS_SCRIPTS: –
* COMPRESS_CSS: –
* ENFORCE_GZIP: –
* WP_LOCAL_DEV: –
* DIEONDBERROR: –
* WPLANG: –
* ALTERNATE_WP_CRON: –
* WP_CRON_LOCK_TIMEOUT: 60
* WP_DISABLE_FATAL_ERROR_HANDLER: –
* MATOMO_SUPPORT_ASYNC_ARCHIVING: –
* MATOMO_TRIGGER_BROWSER_ARCHIVING: –
* MATOMO_ENABLE_TAG_MANAGER: –
* MATOMO_SUPPRESS_DB_ERRORS: –
* MATOMO_ENABLE_AUTO_UPGRADE: –
* MATOMO_DEBUG: –
* MATOMO_SAFE_MODE: –
* MATOMO_GLOBAL_UPLOAD_DIR: –
* MATOMO_LOGIN_REDIRECT: –
* Permalink Structure: /%postname%/
* Possibly uses symlink: No
* Compatible content directory: Yes# WordPress Plugins
* Akismet Anti-Spam: 4.1.9
* Disable Cart Fragments: 1.21
* Ecommerce Order Tracking and Shipment Notifications – AfterShip: 1.10.5
* Error Log Monitor: 1.7
* Facebook for WooCommerce: 2.3.3
* Ghost Kit: 2.18.1
* Kadence WooCommerce Email Designer: 1.4.7
* LiteSpeed Cache: 3.6.4
* Matomo Analytics – Ethical Stats. Powerful Insights.: 4.2.0
* Post SMTP: 2.0.22
* Razorpay for WooCommerce: 2.6.0
* Simple History: 2.41.2
* Storefront Powerpack: 1.5.0
* The SEO Framework: 4.1.3
* UpdraftPlus – Backup/Restore: 1.16.50
* User Switching: 1.5.6 (Network enabled)
* WooCommerce: 5.1.0
* WooCommerce PayPal Checkout Gateway: 2.1.1
* WooCommerce PDF Invoices & Packing Slips: 2.8.2
* WooCommerce Stripe Gateway: 5.0.0
* WOOCS – WooCommerce Currency Switcher: 2.3.4.1
* Wordfence Security: 7.5.2 (Network enabled)
* WP Offload Media Lite: 2.5.3 (Network enabled)
* Yoast Duplicate Post: 4.1.2
* Active Plugins: 23 (error-log-monitor aftership-woocommerce-tracking akismet amazon-s3-and-cloudfront autodescription disable-cart-fragments facebook-for-woocommerce ghostkit kadence-woocommerce-email-designer litespeed-cache matomo post-smtp simple-history storefront-powerpack updraftplus user-switching woo-razorpay woocommerce-currency-switcher woocommerce-gateway-paypal-express-checkout woocommerce-gateway-stripe woocommerce-pdf-invoices-packing-slips woocommerce wordfence)
* Theme: storefront (storefront-child-theme-master)# Server
* Server Info: LiteSpeed
* PHP OS: Linux
* PHP Version: 7.4.15
* PHP SAPI: litespeed
* PHP Error Reporting: 0 After bootstrap: 0
* PHP Found Binary: php -q
* Timezone: UTC
* WP timezone: Asia/Kolkata
* Locale: en_US
* User Locale: en_US
* Memory Limit: 256M (At least 128MB recommended. Depending on your traffic 256MB or more may be needed.)
* WP Memory Limit: 40M
* WP Max Memory Limit: 256M
* Timezone version: 2020.4
* Time: 1617075847
* Max Execution Time: 120
* Max Post Size: 40M
* Max Upload Size: 41943040
* Max Input Vars: 1000
* Disabled PHP functions: Yes (pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,)
* zlib.output_compression is off: Yes
* Curl Version: 7.64.0, OpenSSL/1.1.1d
* Suhosin installed: No# Database
* MySQL Version: 5.5.5
* Mysqli Connect: Yes
* Force MySQL over Mysqli: No
* DB Prefix: wp_
* DB CHARSET: utf8
* DB COLLATE:
* SHOW ERRORS: No
* SUPPRESS ERRORS: No
* Uses Socket: No
* Uses IPv6: No
* Matomo tables found: 164
* Matomo users found: 1
* Matomo sites found: 1
* Required permissions: OK# Browser
* Browser: (Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:87.0) Gecko/20100101 Firefox/87.0)
* Language: en-us,enThanks for the system report @saowp
Any chance you could try adding below line to your
wp-config.php
and see if works then maybe?define( 'MATOMO_SUPPORT_ASYNC_ARCHIVING', false );
so far I haven’t been able to reproduce it unfortunately. Could you maybe test this and let me know if it works?
Thanks, @tsteur . It has been a week since I made the change you suggested, and I have not seen the issue recur. Marking this thread as resolved.
Great @saowp glad this worked.
- The topic ‘PHP Fatal error: Uncaught Exception’ is closed to new replies.