Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Realtime visits error (see #19129) #20906

Closed
AdamSGit opened this issue Jun 16, 2023 · 4 comments
Closed

Realtime visits error (see #19129) #20906

AdamSGit opened this issue Jun 16, 2023 · 4 comments
Labels
worksforme The issue cannot be reproduced and things work as intended.

Comments

@AdamSGit
Copy link

AdamSGit commented Jun 16, 2023

I got exactly the same error that is described in issue #19129 after migrating my matomo installation from php 7.4 to 8.1 in a docker container. The original issue also seemed to be related to php >= 8. The issue was closed without any solution or further investigation a year ago.

Environment

  • Matomo Version: 4.14.2
  • PHP Version: 8.1.20
  • PHP modules: Core, ctype, curl, date, dom, filter, gd, hash, json, libxml, mysqlnd, openssl, pcre, PDO, pdo_mysql, readline, Reflection, session, SimpleXML, SPL, standard, xml, Zend OPcache, zlib
  • Mariadb version: 11.0.2
  • Server Operating System: Alpine linux in a docker container
  • Additionally installed plugins: AbTesting, Actions, Annotations, Contents, CustomAlerts, CustomDimensions, CustomJsTracker, CustomVariables, DBStats, Dashboard, DeviceDetectorCache, DeviceNetworkInformation, DevicePixelRatio, DevicePlugins, DevicesDetection, Diagnostics, DiagnosticsExtended, Ecommerce, Events, FacebookPageWidgetByAmperage, Feedback, GeoIp2, Goals, Heartbeat, HeatmapSessionRecording, ImageGraph, Insights, IntranetMeasurable, KPIWidgets, Live, Login, MarketingCampaignsReporting, Marketplace, MobileAppMeasurable, MobileMessaging, Monolog, MultiSites, Overlay, PagePerformance, PrivacyManager, ProfessionalServices, Provider, QueuedTracking, Referrers, ReferrersManager, Resolution, RssWidget, SEO, ScheduledReports, SecurityInfo, SegmentEditor, ShortcodeTracker, Sms77, TagManager, Tour, Transitions, TreemapVisualization, TwoFactorAuth, UserCountry, UserCountryMap, UserId, UserLanguage, VisitFrequency, VisitTime, VisitorInterest, VisitsSummary, Widgetize
@AdamSGit AdamSGit added Potential Bug Something that might be a bug, but needs validation and confirmation it can be reproduced. To Triage An issue awaiting triage by a Matomo core team member labels Jun 16, 2023
@sgiehl
Copy link
Member

sgiehl commented Jun 16, 2023

Hey @AdamSGit, sorry to hear you have the same problem.
Unfortunatelly we were not able to reproduce it back than, nor am I having the problem right now.

Are you maybe able to provide some further details? It looks like you and the other one having that issue are both using MariaDB. As I'm currently testing with MySQL, maybe that could be the reason.
Do you have some logging in MariaDB? Could you check if you are able to look up the query that produces the error?

@sgiehl sgiehl added Waiting for user feedback Indicates the Matomo team is waiting for feedback from the author or other users. and removed To Triage An issue awaiting triage by a Matomo core team member labels Jun 16, 2023
@AdamSGit
Copy link
Author

AdamSGit commented Jun 19, 2023

Ok, found the cause. Mbstring module was missing in php installation.

The error location is in plugins/Live/Model.php on line 427. This is this part of the code :

    if (0 === stripos($query['sql'], 'SELECT')) {
        $query['sql'] = 'SELECT /* Live.getCounters */' . mb_substr($query['sql'], strlen('SELECT'));
    }

Which, without mbstring module installed, would result to the following query : SELECT /* Live.getCounters */

Don't know if this is an exception, or if others parts of the code use the same logic, but it would need either :

  • To throw an error with helpful message in case of use of mbstring module if not installed
  • Detecting the availability of mb_functions, with a fallback to standard functions if not
  • Or, at least, list mbstring in the Other required extensions section of system checks

@sgiehl
Copy link
Member

sgiehl commented Jun 19, 2023

Thanks for the update @AdamSGit
That's quite interesting as we actually have the mbstring polyfill from symfony included, so that method shouldn't cause issues.
So guess we might need to check if the polyfill works as expected...

@sgiehl
Copy link
Member

sgiehl commented Oct 10, 2023

I've now checked that locally again. Matomo works smoothly with mbstring disabled. mbstring methods are actually even used all across Matomo so it would be weird if that only fails in the reatime reports, but work everywhere else.
I'll close this one, as it's most likely related to some server configuration issue.

@sgiehl sgiehl removed the Waiting for user feedback Indicates the Matomo team is waiting for feedback from the author or other users. label Oct 10, 2023
@sgiehl sgiehl closed this as completed Oct 10, 2023
@sgiehl sgiehl added worksforme The issue cannot be reproduced and things work as intended. and removed Potential Bug Something that might be a bug, but needs validation and confirmation it can be reproduced. labels Oct 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
worksforme The issue cannot be reproduced and things work as intended.
Projects
None yet
Development

No branches or pull requests

2 participants