-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Upgraded from 3.x to 4.2.1: Not receiving data due to SQL error #17484
Comments
Hi @YamasakiRhys, sorry you're experiencing this issue. Do you know which columns are missing in the table that are also in the query (the error message does not say which columns it can't find)? Can you also describe how you updated your Matomo? Did you follow the manual update process or use the one click update feature? |
Hi @diosmosis. Thank you for your response. We did a manual update at first for Matomo and were receiving an issue that sql wasn't completing this query because it was missing columns. It doesn't specifically state which columns are missing but from our table structure compared to the select statement, it seems that there are quite a few missing. This is our table structure as it is currently in our new db instance. After having received that error we completely removed all Matomo files and created a new db instance and did a fresh install of 4.2.1 to see if that would resolve our issue but we're still receiving the same sql issue that we saw when we upgraded. |
@YamasakiRhys It looks like no dimensions that aren't listed in the initial table definitions are added except CustomDimensions. I would say the mysql user doesn't have the privilege to alter tables, but in that case the custom_dimension_* columns wouldn't be added. Can you run the following query and post the results:
? |
Hi @diosmosis. We added the missing permissions but still seem to be getting an error. mysql> SELECT * FROM We also ran these commands to grant permission: |
@YamasakiRhys can you try to run this SQL:
? Then update Matomo again (via the update command or via the one click updater). Matomo will try to add the columns again. (Note: if you're doing this on the new install it should work unless the problems is not w/ the mysql user privileges. If you're doing this on the upgraded install, you may need to set version_core to the 3.x version to run the updates again with the required privileges (though if you are missing as many columns there that would also mean you lost a lot of data, and I'd recommend redoing the update w/ a backup).) |
@diosmosis |
Having an issue after upgrading from 3.x that is using a query to grab columns that are not existent with 4.x db.
Receiving an error with a query with a select statement in the db causing a sql error.
Expected Behavior
Should query expected columns within the table.
Current Behavior
Getting a error with select query:
ERROR Piwik\Tracker\Handler[2021-04-07 18:16:19 UTC] [e58b4] Exception: /opt/rh/httpd24/root/var/www/html/matomo/core/Tracker/Db/Pdo/Mysql.php(238): Error query: SQLSTATE[42S22]: Column not found: 1054 Unknown error 1054 In query: SELECT visit_last_action_time, visit_first_action_time, idvisitor, idvisit, user_id, visit_exit_idaction_url, visit_exit_idaction_name, visitor_returning, visitor_seconds_since_first, visitor_seconds_since_order, visitor_count_visits, visit_goal_buyer, location_country, location_region, location_city, location_latitude, location_longitude, referer_name, referer_keyword, referer_type, idsite, profilable, visit_entry_idaction_url, visit_total_actions, visit_total_interactions, visit_total_searches, referer_url, config_browser_name, config_client_type, config_device_brand, config_device_model, config_device_type, visit_total_events, visit_total_time, location_ip, location_browser_lang, last_idlink_va, custom_dimension_1, custom_dimension_2, custom_dimension_3, custom_dimension_4, custom_dimension_5 FROM matomo_log_visit FORCE INDEX (index_idsite_idvisitor) WHERE idsite = ? AND visit_last_action_time <= ? AND idvisitor = ?
ERROR Piwik\Tracker\Handler[2021-04-07 18:16:19 UTC] [e58b4] ORDER BY visit_last_action_time DESC
ERROR Piwik\Tracker\Handler[2021-04-07 18:16:19 UTC] [e58b4] LIMIT 1 Parameters: array (
ERROR Piwik\Tracker\Handler[2021-04-07 18:16:19 UTC] [e58b4] 0 => 1,
ERROR Piwik\Tracker\Handler[2021-04-07 18:16:19 UTC] [e58b4] 1 => '2021-04-07 18:46:19',
ERROR Piwik\Tracker\Handler[2021-04-07 18:16:19 UTC] [e58b4] 2 => '�ÍR>‡
•£',
ERROR Piwik\Tracker\Handler[2021-04-07 18:16:19 UTC] [e58b4] )
When using the tracker on our site, matomo.php is failing and we're receiving this error in the logs.
ERROR Piwik\Tracker\Handler[2021-04-07 18:17:15 UTC] [172f7] #0 /opt/rh/httpd24/root/var/www/html/dbuser/core/Tracker/Db/Pdo/Mysql.php(197): Piwik\Tracker\Db\Pdo\Mysql->query('SELECT visit_la...', Array)
ERROR Piwik\Tracker\Handler[2021-04-07 18:17:15 UTC] [172f7] #1 /opt/rh/httpd24/root/var/www/html/dbuser/core/Tracker/Model.php(458): Piwik\Tracker\Db\Pdo\Mysql->fetch('SELECT visit_la...', Array)
ERROR Piwik\Tracker\Handler[2021-04-07 18:17:15 UTC] [172f7] #2 /opt/rh/httpd24/root/var/www/html/dbuser/core/Tracker/Model.php(440): Piwik\Tracker\Model->fetchVisitor('SELECT visit_la...', 'FROM dbuser_log...', 'idsite = ? AND ...', Array)
ERROR Piwik\Tracker\Handler[2021-04-07 18:17:15 UTC] [172f7] #3 /opt/rh/httpd24/root/var/www/html/dbuser/core/Tracker/Model.php(401): Piwik\Tracker\Model->findVisitorByVisitorId('\x0F\xCDR>\x87\r\x95\xA3', 'SELECT visit_la...', 'FROM dbuser_log...', 'idsite = ? AND ...', Array)
ERROR Piwik\Tracker\Handler[2021-04-07 18:17:15 UTC] [172f7] #4 /opt/rh/httpd24/root/var/www/html/dbuser/core/Tracker/VisitorRecognizer.php(109): Piwik\Tracker\Model->findVisitor(1, ':\xA4mQ\x1F\x8B\xFD', '\x0F\xCDR>\x87\r\x95\xA3', false, Array, false, true, '2021-04-07 17:4...', '2021-04-07 18:4...')
ERROR Piwik\Tracker\Handler[2021-04-07 18:17:15 UTC] [172f7] #5 /opt/rh/httpd24/root/var/www/html/dbuser/plugins/CoreHome/Tracker/VisitRequestProcessor.php(118): Piwik\Tracker\VisitorRecognizer->findKnownVisitor(':\xA4mQ\x1F\x8B\xFD', Object(Piwik\Tracker\Visit\VisitProperties), Object(Piwik\Tracker\Request))
ERROR Piwik\Tracker\Handler[2021-04-07 18:17:15 UTC] [172f7] #6 /opt/rh/httpd24/root/var/www/html/dbuser/core/Tracker/Visit.php(163): Piwik\Plugins\CoreHome\Tracker\VisitRequestProcessor->processRequestParams(Object(Piwik\Tracker\Visit\VisitProperties), Object(Piwik\Tracker\Request))
ERROR Piwik\Tracker\Handler[2021-04-07 18:17:15 UTC] [172f7] #7 /opt/rh/httpd24/root/var/www/html/dbuser/core/Tracker.php(160): Piwik\Tracker\Visit->handle()
ERROR Piwik\Tracker\Handler[2021-04-07 18:17:15 UTC] [172f7] #8 /opt/rh/httpd24/root/var/www/html/dbuser/core/Tracker/Handler.php(55): Piwik\Tracker->trackRequest(Object(Piwik\Tracker\Request))
ERROR Piwik\Tracker\Handler[2021-04-07 18:17:15 UTC] [172f7] #9 /opt/rh/httpd24/root/var/www/html/dbuser/core/Tracker.php(140): Piwik\Tracker\Handler->process(Object(Piwik\Tracker), Object(Piwik\Tracker\RequestSet))
ERROR Piwik\Tracker\Handler[2021-04-07 18:17:15 UTC] [172f7] #10 /opt/rh/httpd24/root/var/www/html/dbuser/core/Tracker.php(115): Piwik\Tracker->track(Object(Piwik\Tracker\Handler), Object(Piwik\Tracker\RequestSet))
ERROR Piwik\Tracker\Handler[2021-04-07 18:17:15 UTC] [172f7] #11 /opt/rh/httpd24/root/var/www/html/dbuser/piwik.php(73): Piwik\Tracker->main(Object(Piwik\Tracker\Handler), Object(Piwik\Tracker\RequestSet))
ERROR Piwik\Tracker\Handler[2021-04-07 18:17:15 UTC] [172f7] #12 /opt/rh/httpd24/root/var/www/html/dbuser/dbuser.php(13): include('/opt/rh/httpd24...')
This isn't allowing us to receive any data since this is stopping the process.
Originally we upgraded and used a db instance with that upgrade, but were receiving this error.
Current DB is a new instance when we tried to do a fresh install of 4.2.1
Your Environment
API, Actions, Annotations, BulkTracking, Contents, CoreAdminHome, CoreConsole, CoreHome, CorePluginsAdmin, CoreUpdater, CoreVisualizations, CustomDimensions, CustomJsTracker, CustomVariables, Dashboard, DevicePlugins, DevicesDetection, Diagnostics, Ecommerce, Events, Feedback, Goals, Heartbeat, ImageGraph, Insights, Installation, Intl, IntranetMeasurable, LanguagesManager, Live, Login, Monolog, Morpheus, MultiSites, Overlay, PagePerformance, PrivacyManager, ProfessionalServices, Proxy, Referrers, Resolution, RssWidget, SEO, ScheduledReports, SegmentEditor, SitesManager, TagManager, Tour, Transitions, TwoFactorAuth, UserCountry, UserCountryMap, UserId, UserLanguage, UsersManager, VisitFrequency, VisitTime, VisitorInterest, VisitsSummary, WebsiteMeasurable, Widgetize,
Installed but deactivated:
DBStats, GeoIp2, Marketplace, MobileAppMeasurable, MobileMessaging, Provider
The text was updated successfully, but these errors were encountered: