PHP Error with Vn 4.1.2
-
My error log on the server is filling up with messages like this – only since the latest update was installed:
NOTICE: PHP message: WordPress-Datenbank-Fehler Table ‘teoDB.teo_matomo_logtmpsegmentc95a3716a3f18b25879e049ccdb2c937’
doesn’t exist für Abfrage
SELECT /*+ MAX_EXECUTION_TIME(7200000) */ 1
FROM teo_matomo_logtmpsegmentc95a3716a3f18b25879e049ccdb2c937 LIMIT 1
von do_action_ref_array(‘matomo_scheduled_archive’), WP_Hook->do_action, WP_Hook->apply_filters, WpMatomo\ScheduledTasks->archive,
Piwik\CronArchive->main, Piwik\Access::doAsSuperUser, Piwik\CronArchive->Piwik\{closure}, Piwik\CronArchive->run,
Piwik\CronArchive->launchArchivingFor, Piwik\CliMulti->request, Piwik\CliMulti->requestUrls, Piwik\CliMulti->start,
Piwik\CliMulti->executeUrlCommand, Piwik\CliMulti->executeNotAsyncHttp, Piwik\Http::sendHttpRequestBy, Piwik\Piwik::postEvent,
Piwik\EventDispatcher->postEvent, call_user_func_array, Piwik\Plugins\WordPress\WordPress->onSendHttpRequestBy,
Piwik\Access::doAsSuperUser, Piwik\Plugins\WordPress\WordPress->Piwik\Plu”Looks like nothing I myself could fix – hope you can help!
Apart from that: Great Plugin, thanks!
Tim
-
Hi @tim-reeves sorry about this. AFAIK we haven’t changed anything that could cause this but it might depend from which version you updated. Any chance you could paste the output of your system report here (it should be automatically anonymised, or you can email us at [email protected])? See https://matomo.org/faq/wordpress/how-do-i-find-and-copy-the-system-report-in-matomo-for-wordpress/
Have you maybe also updated any other plugins or made any other changes to your hosting/server (if you know)?
Hi @tsteur,
thanks for your reply.
I completely deinstalled Matomo, including data removal (well I checked the box but did not look in the DB afterwards). Then a completely fresh install of Matomo, with pretty standard setup – and to my great surprise I’m still getting exactly the same error:
NOTICE: PHP message: WordPress-Datenbank-Fehler Table 'teoDB.teo_matomo_logtmpsegmentc95a3716a3f18b25879e049ccdb2c937' doesn't exist für Abfrage SELECT / *+ MAX_EXECUTION_TIME(7200000) */ 1 FROM teo_matomo_logtmpsegmentc95a3716a3f18b25879e049ccdb2c937 LIMIT 1 von do_action _ref_array('matomo_scheduled_archive'), WP_Hook->do_action, WP_Hook->apply_filters, WpMatomo\ScheduledTasks->archive, Piwik\CronArchive->main, Piwik\Access::doAsSuperUser, Piwik\CronArchive->Piwik\{closure}, Piwik\CronArchive->run, Piwik\CronArchive->launchArchivingFor, Piwik\CliMulti->request, Piwik\CliMulti->requestUrls, Piwik\CliMulti->start, Piwik\CliMulti->executeUrlCommand, Piwik\CliMulti->executeNotAsyncHttp, Piwik\Http::sendHttpRequestBy, Piwik\Piwik::postEvent, Piwik\EventDispatcher->postEvent, call_user_func_array, Piwik\Plugins\WordPress\WordPress->onSendHttpRequestBy, Piwik\Access::doAsSuperUser, Piwik\Plugins\WordPress\WordPress->Piwik\Plug
Here is my system report:
# Matomo
* Matomo-Plugin-Version: 4.1.2 * Config existiert und ist schreibbar.: Ja ("$ABSPATH/wp-content/uploads/matomo/config/config.ini.php" ) * JS Tracker existiert und ist schreibbar.: Ja ("$ABSPATH/wp-content/uploads/matomo/matomo.js" ) * Plugin-Verzeichnisse: Yes ([{"pluginsPathAbsolute":"$ABSPATH\/wp-content\/plugins\/matomo\/plugins","webrootDirRelativeToMatomo":"..\/"}]) * Tmp-Verzeichnis schreibbar: Yes ($ABSPATH/wp-content/cache/matomo) * Matomo-Version: 4.1.1 * Matomo Blog idSite: 1 * Installierte Matomo-Version: 4.1.2 (Install date: 2021-01-24 12:05:18) * 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-Zeit: 2021-01-25 09:42:57 * Blog-Zeit: 2021-01-25 10:42:57 (Die nachfolgenden Daten werden in der Blog-Zeitzone angezeigt) * Sync users & sites: Next run: 2021-01-25 12:05:17 (1 Stunden 22 Minuten) ( Last started: 2021-01-24 12:06:08 (-22 Stunden 36 Minuten). Last ended: 2021-01-24 12:06:08 (-22 Stunden 36 Minuten). Interval: daily) * Archive: Next run: 2021-01-25 11:05:17 (22 Minuten 20s) ( Last started: 2021-01-25 10:05:20 (-37 Minuten 37s). Last ended: 2021-01-25 10:05:22 (-37 Minuten 35s). Interval: hourly) * Update GeoIP DB: Next run: 2021-02-23 12:05:17 (29 Tage 1 Stunden) ( Last started: 2021-01-24 12:09:21 (-22 Stunden 33 Minuten). Last ended: 2021-01-24 12:09:22 (-22 Stunden 33 Minuten). Interval: matomo_monthly) ## Vorgeschriebene Prüfungen * PHP-Version >= : ok * PDO Erweiterung: ok * PDO\MYSQL Erweiterung: ok * MYSQLI Erweiterung: ok * Weitere erforderliche Anforderungen: ok * Erforderliche Funktionen: ok * Ben?tigte PHP Konfiguration (php.ini): ok * Verzeichnisse mit Schreibzugriff: ok * Verzeichnisse mit Schreibzugriff auf Tag Manager: ok ## Optionale Prüfungen * Tracker-Status: ok * Speicherlimit: ok * Zeitzone: ok * ?ffnen einer URL: ok * PageSpeed deaktiviert: ok * GD > 2.x + Freetype (graphics): ok * Andere Erweiterungen: ok * Andere Funktionen: ok * Dateisystem: ok * Letzter erfolgreicher Abschluss der Archivierung: ok * Datenbankf?higkeiten: ok * Maximale Packetgr??e: ok * Standorterkennung: ok * Update über HTTPS: ok * Schreibbarer JavaScript-Tracker ("/matomo.js"): ok * Supports Async Archiving: No * Location provider ID: geoip2php * Location provider available: Yes * Location provider working: Yes * Had visit in last 5 days: Yes ## Matomo Settings * Track mode: default * Track codeposition: footer * Track api endpoint: default * Track js endpoint: default * Version history: 4.1.2 * Core version: 4.1.1 * Last tracking settings update: 1611486384 * Last settings update: 1611486551 * Track ecommerce: No * Disable cookies: Yes * Limit cookies: Yes ## Logs * Keine: # WordPress * Home URL: $site_url * Site URL: $site_url * WordPress Version: 5.6 * Number of blogs: 1 * Multisite Enabled: No * Network Enabled: No * WP_DEBUG: No * WP_DEBUG_DISPLAY: Yes * 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: /%category%/%postname%/ * Possibly uses symlink: No * Compatible content directory: Yes # WordPress Plugins * Add-on Contact Form 7 - Mailpoet 3: 1.3.15 * Artbees Themes Captcha: 1.0 * Bounce Handler Mailpoet: 1.3.21 * Chris Email Return Path: 1.0.0 * Classic Editor: 1.6 * Contact Form 7: 5.3.2 * Contact Form 7 Image Captcha: 3.2.1 * Debug Objects: 2.5.0 * Email Encoder - Protect Email Addresses: 2.1.0 * iThemes Security: 7.9.0 (Network enabled) * Jupiter Core: 1.0.2 * Jupiter Donut: 1.1.0 * MailPoet 3 (New): 3.58.0 * MailPoet 3 Premium (New): 3.58.0 * Maintenance: 3.99 * Matomo Analytics - Ethical Stats. Powerful Insights.: 4.1.2 * Mobilize: 3.0.1 * Optimize Database after Deleting Revisions: 5.0.3 (Network enabled) * PHPEnkoder: 1.14.1 * Query Monitor: 3.6.7 * Rank Math SEO: 1.0.56.1 * Thrive Architect: 2.6.5.1 * Thrive Leads: 2.3.7.1 * Thrive Product Manager: 1.2.4 * User Role Editor: 4.58.2 * W3 Total Cache: 2.1.0 (Network enabled) * Webcraftic Clearfy – WordPress optimization plugin: 1.8.2 * WPBakery Page Builder (Modified Version): 6.5.0 * WP Edit: 4.0.4 * WP Mail SMTP: 2.5.1 * Yoast Duplicate Post: 4.0.2 * Active Plugins: 27 (add-on-contact-form-7-mailpoet artbees-captcha better-wp-security bounce-handler-mailpoet chris_email_return_path classic-editor clearfy contact-form-7-image-captcha contact-form-7 duplicate-post js_composer_theme jupiter-core jupiter-donut mailpoet-premium mailpoet maintenance matomo php-enkoder rvg-optimize-database seo-by-rank-math thrive-leads thrive-product-manager thrive-visual-editor user-role-editor w3-total-cache wp-edit wp-mail-smtp) * Theme: jupiter (jupiter) # Server * Server Info: nginx/1.18.0 * PHP OS: Linux * PHP Version: 7.3.26 * PHP SAPI: fpm-fcgi * PHP Binary Name: php-fpm * Timezone: UTC * WP timezone: Europe/Berlin * Locale: de_DE * User Locale: de_DE * Memory Limit: 512M (At least 128MB recommended. Depending on your traffic 256MB or more may be needed.) * WP Memory Limit: 256M * WP Max Memory Limit: 512M * Timezone version: 0.system * Time: 1611567777 * Max Execution Time: 14400 * Max Post Size: 1G * Max Upload Size: 1073741824 * Max Input Vars: 4000 * Disabled PHP functions: No * 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: teo_ * DB CHARSET: utf8mb4 * DB COLLATE: * SHOW ERRORS: No * SUPPRESS ERRORS: No * Uses Socket: No * Uses IPv6: No * Matomo tables found: 42 * Matomo users found: 8 * Matomo sites found: 1 * Erforderliche Berechtigungen: OK # Browser * Browser: (Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:84.0) Gecko/20100101 Firefox/84.0) * Language: en,de,en-gb,en-us
I will soon have to disable Matomo on that site if this can’t be resolved – but I sure hope it can. Thanks for your support!
Tim
Hi again,
I have now installed Matomo on a further website on the same server, same PHP version – on a website where Matomo was never installed before. To my great disappointment I’m also getting exactly the same type of error there:
[25-Jan-2021 18:00:04] WARNING: [pool weltengeschwister-gesandtschaft.org] child 2885 said into stderr: "NOTICE: PHP message: WordPress-Datenbank-Fehler Table 'wgoDB.wgo_matomo_logtmpsegment9b005b137fbbfa9e2cfbc120610b8cc4' doesn't exist für Abfrage SELECT /*+ MAX_EXECUTION_TIME(7200000) */ 1 FROM wgo_matomo_logtmpsegment9b005b137fbbfa9e2cfbc120610b8cc4 LIMIT 1 von do_action_ref_array('matomo_scheduled_archive'), WP_Hook->do_action, WP_Hook->apply_filters, WpMatomo\ScheduledTasks->archive, Piwik\CronArchive->main, Piwik\Access::doAsSuperUser, Piwik\CronArchive->Piwik\{closure}, Piwik\CronArchive->run, Piwik\CronArchive->launchArchivingFor, Piwik\CliMulti->request, Piwik\CliMulti->requestUrls, Piwik\CliMulti->start, Piwik\CliMulti->executeUrlCommand, Piwik\CliMulti->executeNotAsyncHttp, Piwik\Http::sendHttpRequestBy, Piwik\Piwik::postEvent, Piwik\EventDispatcher->postEvent, call_user_func_array, Piwik\Plugins\WordPress\WordPress->onSendHttpRequestBy, Piwik\Access::doAsSuperUser, Piwik\Plugins\WordPress\Wo
What I just noticed is that the call is coming from CronArchive. I’m using Linux cron for MailPoet, but on those two websites it’s just the usual WordPress cron, there is no DISABLE_WP_CRON in wp-config.php. So still, I don’t see anything that I could do, or do differently. Except for trying Linux cron on the problematical websites.
Looking at the error message, an SQL statement is being mangled, a log segment name is being used as a table name. Could you please have a look at exactly where that statement is, and reply to me? Then I would look at the code there, and debug if no error is obvious. Because somehow, we need to move on…
If it helps I can email you my php.ini for PHP 7.3, and add a list of the active modules.
Cheers, thanks,
Tim
Hi @tim-reeves thanks for detailed analysis so far.
The table is generated in https://github.com/matomo-org/wp-matomo/blob/develop/app/core/DataAccess/LogAggregator.php#L292 (this seems to succeed). It’s a temporary table. From the error message I can unfortunately not tell where the query is being executed as the query is not fully visible and different plugins within the Matomo plugin may execute such a query. If I had to guess I would say that it looks like some plugin or somehow the WP DB connection is closed at some point and then reconnected or so. That be so far the only way I could explain this. That’s because it looks like the temporary table is created, but doesn’t exist later. Temporary tables only exists for one specific DB connection. Meaning if a new DB connection is created at some point, the table will be no longer there.
There would be a workaround to disable using this table. You could edit the file
wp-content/uploads/matomo/config/config.ini.php
and as part of the[General]
section add a new line sayingenable_segments_cache = 0
. The next time it should work if you could try this?The system report looks otherwise all good and couldn’t find anything yet that could cause this otherwise. Sorry about all the trouble @tim-reeves
Hi @tsteur
many thanks for your suggestion with the config workaround – it works. So the question remains, howcome my DB Connections are getting lost? I’ve once more tuned my general DB config and upped a few limits, but that’s not the solution.
I did hope that config values, recently added by myself in an attempt to reduce load on the DB might be to blame:
wait_timeout = 3600
interactive_timeout = 3600I commented those out, but it did not help. At first I thought it had, but later I noticed not – one has to wait some time until the error messages appear in the PHP log file.
So we have narrowed it down – but I still have no idea what the real cause is. How “bad” is the fix you noted, does it have any nasty repercussions?
Thanks again,
Tim
Hi @tim-reeves thanks for your patience and your help. We were finally able to reproduce this and are releasing an update with a fix soon. You can then remove the added setting again. Basically, it looked like there was an error but it was basically expected that this query might sometimes fail as we’re trying to detect if the table exists or not. WordPress would then “falsely” log the query failed even when we expected it to fail. We’ve now applied a fix again that will detect this particular query and it should be all good in the future. Thanks for your help again and be great to let us know in case it still happens after the update. All the best, Thomas
- The topic ‘PHP Error with Vn 4.1.2’ is closed to new replies.