The Visits in Real-time dashboard widget, Visits in Real-time page and Real Time Visitor Count dashboard widget are all failing.
There is an error on the page of:
Oops… there was a problem during the request. Maybe the server had a temporary issue, or maybe you requested a report with too much data. Please try again. If this error occurs repeatedly please contact your Matomo administrator for assistance.
There is a error in the PHP error log of:
Error in Matomo: SQLSTATE[HY093]: Invalid parameter number: number of bound variables does not match number of tokens
Error on the following URLs:
Hi @ericimprint, thanks for contacting us with this issue. I've not been able to recreate it locally so it might be specific to your installation/upgrade. From the error message it seems like the database query to get real time visit data isn't being generated correctly.
One possibility is that there are existing data table options set which are somehow affecting the query generation.
If possible, could you provide the results of the following query?
SELECT * FROM option WHERE option_name LIKE 'viewDataTableParameters_root_Live.%';
This will show any customizations for the real time visitor data tables. Resetting these options might resolve the issue.
Thanks for replying. That query (with my table prefix) returned no results. I have cleared the tmp folder as well with no change. I am happy to send a database dump or anything else if it will help.
@ericimprint Does the log file contain some more details in which file the error/exception raises?
The php error log didn't show anything else. Is there other logging I can turn on to help?
I did a clean install in another directory with a new database and fresh data from another site, and got the exact same error. So it is a server issue, not a historical setting or data issue. I updated the directory to use PHP 8.1 and PHP 7.4 and got the same error.
force_ssl = 1
to the General
section in your Matomo config/config.ini.php file.
#### Geolocation:
✔ geoip2php (continent_code, continent_name, country_code, country_name, region_code, region_name, city_name, postal_code, lat, long)
#### Update over HTTPS:
✔
#### Writable JavaScript Tracker ("/matomo.js"):
✔
### Informational results
#### Matomo Version:
4.9.0
#### Matomo Update History:
4.9.0,
#### Matomo Install Version:
4.9.0
#### Latest Available Version:
4.9.0
#### Is Git Deployment:
0
#### PHP_OS:
Linux
#### PHP_BINARY:
/opt/cpanel/ea-php81/root/usr/bin/php-cgi
#### PHP SAPI:
cgi-fcgi
#### Timezone Version:
0.system
#### PHP Timezone:
UTC
#### PHP Time:
1650904232
#### PHP Datetime:
2022-04-25 16:30:32
#### PHP INI max_execution_time:
30
#### PHP INI post_max_size:
8M
#### PHP INI max_input_vars:
1000
#### PHP INI zlib.output_compression:
#### Curl Version:
7.81.0, OpenSSL/1.1.1n
#### Suhosin Installed:
0
#### DB Prefix:
matomo_
#### DB Charset:
utf8mb4
#### DB Adapter:
PDO\MYSQL
#### MySQL Version:
10.2.43-MariaDB
#### Num Tables:
34
#### Browser Segment Archiving Enabled:
1
#### Development Mode Enabled:
0
#### Internet Enabled:
1
#### Multi Server Environment:
0
#### Auto Update Enabled:
1
#### Custom User Path:
0
#### Custom Include Path:
0
#### Release Channel:
latest_stable
#### Plugins Activated:
API, Actions, Annotations, BulkTracking, Contents, CoreAdminHome, CoreConsole, CoreHome, CorePluginsAdmin, CoreUpdater, CoreVisualizations, CoreVue, CustomDimensions, CustomJsTracker, Dashboard, DevicePlugins, DevicesDetection, Diagnostics, Ecommerce, Events, Feedback, GeoIp2, Goals, Heartbeat, ImageGraph, Insights, Installation, Intl, IntranetMeasurable, LanguagesManager, Live, Login, Marketplace, MobileMessaging, Monolog, Morpheus, MultiSites, Overlay, PagePerformance, PrivacyManager, ProfessionalServices, Proxy, Referrers, Resolution, RssWidget, SEO, ScheduledReports, SegmentEditor, SitesManager, Tour, Transitions, TwoFactorAuth, UserCountry, UserCountryMap, UserId, UserLanguage, UsersManager, VisitFrequency, VisitTime, VisitorInterest, VisitsSummary, WebsiteMeasurable, Widgetize
#### Plugins Deactivated:
DBStats, MobileAppMeasurable, TagManager
#### Plugins Invalid:
#### Server Info:
Apache
#### Had visits in last 1 day:
1
#### Had visits in last 3 days:
1
#### Had visits in last 5 days:
1
#### Archive Time Last Started:
0
#### Archive Time Last Finished:
0
#### User Agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36
#### Browser Language:
en-us,en
#### Total Invalidation Count:
0
#### In Progress Invalidation Count:
0
#### Scheduled Invalidation Count:
0
#### Earliest invalidation ts_started:
#### Latest invalidation ts_started:
#### Earliest invalidation ts_invalidated:
#### Latest invalidation ts_invalidated:
#### Number of segment invalidations:
0
#### Number of plugin invalidations:
0
#### List of plugins being invalidated:
#### Anonymize Referrer:
#### Do Not Track enabled:
0
@ericimprint sorry for the delay. Did you also check the matomo log file in tmp/logs/matomo.log
?
4.9.1 didn't change anything.
@sgiehl I turned on logging and got:
ERROR Live[2022-04-29 14:59:13 UTC] [b504c] Uncaught exception in API: /home/imprint/stats.imprintitems.com/matomo/libs/Zend/Db/Statement/Pdo.php(236): SQLSTATE[HY093]: Invalid parameter number: number of bound variables does not match number of tokens [Query: ?date=yesterday&module=Live&action=widget&disableLink=0&widget=1&idSite=1&period=day, CLI mode: 0]
ERROR Piwik\ExceptionHandler[2022-04-29 14:59:13 UTC] [b504c] Uncaught exception: /home/imprint/stats.imprintitems.com/matomo/libs/Zend/Db/Statement/Pdo.php(236): SQLSTATE[HY093]: Invalid parameter number: number of bound variables does not match number of tokens [Query: ?date=yesterday&module=Live&action=widget&disableLink=0&widget=1&idSite=1&period=day, CLI mode: 0]
@ericimprint Would you mind sharing your system check results?
@sgiehl I have 2 sets of system check results above (old install and fresh install on the same system).
I switched to the MYSQLi adaptor and got the same problem. Error:
ERROR Live[2022-04-29 15:20:26 UTC] [8b581] Uncaught exception in API: /home/imprint/stats.imprintitems.com/matomo/libs/Zend/Db/Statement/Mysqli.php(70): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '' at line 1 [Query: ?date=yesterday&module=Live&action=widget&disableLink=0&widget=1&idSite=1&period=day, CLI mode: 0]
ERROR Piwik\ExceptionHandler[2022-04-29 15:20:26 UTC] [8b581] Uncaught exception: /home/imprint/stats.imprintitems.com/matomo/libs/Zend/Db/Statement/Mysqli.php(70): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '' at line 1 [Query: ?date=yesterday&module=Live&action=widget&disableLink=0&widget=1&idSite=1&period=day, CLI mode: 0]