@orlitzky opened this Issue on October 7th 2019

I upgraded from GeoIP (discontinued) to GeoIP2 last night, and this morning I see that the log import from last night failed. The root cause is this error message,

Oct  7 09:50:21 http2 php: Error in Matomo (tracker): Error query: SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column 'location_region' at row 1 In query: INSERT INTO log_visit (idvisitor, config_id, location_ip, idsite, visit_first_action_time, visit_goal_buyer, visit_goal_converted, visit_last_action_time, visitor_days_since_first, visitor_days_since_order, visitor_returning, visitor_count_visits, visit_entry_idaction_name, visit_entry_idaction_url, visit_exit_idaction_name, visit_exit_idaction_url, visit_total_actions, visit_total_interactions, visit_total_searches, referer_keyword, referer_name, referer_type, referer_url, location_browser_lang, config_browser_engine, config_browser_name, config_browser_version, config_device_brand, config_device_model, config_device_type, config_os, config_os_version, visit_total_events, visitor_localtime, visitor_days_since_last, config_resolution, config_cookie, config_director, config_flash, config_gears, config_java, config_pdf, config_quicktime, config_realplayer, config_silverlight, config_windowsmedia, visit_total_time, location_city, location_country, location_latitude, location_longitude, location_region) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) Parameters: array (   0 => '�\x0b�k\x03\x1d��',   1 => '��k~�3\x1b�',   2 => 'qąq',   3 => 126,   4 => '2019-10-06 15:31:18',   5 => 0,   6 => 0,   7 => '2019-10-06 15:31:18',   8 => 0,   9 => 0,   10 => 0,   11 => 1,   12 => 5,   13 => 6,   14 => 5,   15 => 6,   16 => 1,   17 => 1,   18 => 0,   19 => NULL,   20 => NULL,   21 => 1,   22 => '',   23 => '',   24 => 'Gecko',   25 => 'FF',   26 => '62.0',   27 => '',   28 => 'generic desktop',   29 => 0,   30 => 'UBT',   31 => '',   32 => 0,   33 => '15:31:18',   34 => 0,   35 => 'unknown',   36 => 0,   37 => 0,   38 => 0,   39 => 0,   40 => 0,   41 => 0,   42 => 0,   43 => 0,   44 => 0,   45 => 0,   46 => 0,   47 => 'Taipei',   48 => 'tw',   49 => '25.048',   50 => '121.532',   51 => 'TPE', )

I believe this is due to the region "TPE" (Taipei?) being inserted into the location_region column which has length 2.

@sgiehl commented on October 7th 2019 Member

Actually Matomo should trigger an update for that column to CHAR(3) when GeoIP2 plugin is enabled

@orlitzky commented on October 7th 2019

I'm in the process of running that ALTER TABLE... statement right now, and it looks like it's going to take about an hour to run (if it does finish). Could something have gone wrong in the automated update due to the length of the query? I didn't do anything weird when enabling the plugin -- I just clicked "Activate" and it looked like everything was fine.

@sgiehl commented on October 7th 2019 Member

You should have been prompted with an update screen to run that query in UI on the next request after the plugin was activated. Not sure why that didn't work in your case...

@orlitzky commented on October 7th 2019

Widening the column did indeed fix the problem.

I'm pretty sure I didn't see a notice in the UI, either last night when I enabled the plugin or this morning when I logged in to Matomo to investigate the error. I'm running matomo-3.11.0.

@tsteur commented on October 7th 2019 Member

Glad it works now. BTW you aren't prompted for an update eg if enable_auto_update is disabled

This Issue was closed on October 7th 2019
Powered by GitHub Issue Mirror