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

log_visit.location_region: column too short with GeoIP2? #14967

Closed
orlitzky opened this issue Oct 7, 2019 · 5 comments
Closed

log_visit.location_region: column too short with GeoIP2? #14967

orlitzky opened this issue Oct 7, 2019 · 5 comments
Labels
answered For when a question was asked and we referred to forum or answered it.
Milestone

Comments

@orlitzky
Copy link

orlitzky commented Oct 7, 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
Copy link
Member

sgiehl commented Oct 7, 2019

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

@orlitzky
Copy link
Author

orlitzky commented Oct 7, 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
Copy link
Member

sgiehl commented Oct 7, 2019

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
Copy link
Author

orlitzky commented Oct 7, 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 tsteur added the answered For when a question was asked and we referred to forum or answered it. label Oct 7, 2019
@tsteur
Copy link
Member

tsteur commented Oct 7, 2019

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

@tsteur tsteur closed this as completed Oct 7, 2019
@mattab mattab added this to the 3.12.0 milestone Oct 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
answered For when a question was asked and we referred to forum or answered it.
Projects
None yet
Development

No branches or pull requests

4 participants