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

Attempt to handle incorrectly prefixed region codes #19323

Closed
nbari opened this issue Jun 8, 2022 · 4 comments · Fixed by #19327
Closed

Attempt to handle incorrectly prefixed region codes #19323

nbari opened this issue Jun 8, 2022 · 4 comments · Fixed by #19327
Assignees
Labels
Bug For errors / faults / flaws / inconsistencies etc.
Milestone

Comments

@nbari
Copy link

nbari commented Jun 8, 2022

I am getting logs with:

Error in Matomo (tracker): Error query: SQLSTATE[22001]: String data, right truncated:

This is the query:

UPDATE matomo_log_visit SET profilable = ?, visit_last_action_time = ?, visitor_seconds_since_order = ?, visit_entry_idaction_url = ?, visit_exit_idaction_url = ?,  visit_total_actions = visit_total_actions + 1 ,  visit_total_interactions = visit_total_interactions + 1 , visit_total_time = ?, location_city = ?, location_country = ?, location_latitude = ?, location_longitude = ?, location_region = ?, last_idlink_va = ? WHERE idsite = ? AND idvisit = ? Parameters: array (   0 => 1,   1 => '2022-06-08 11:34:26',   2 => NULL,   3 => 12,   4 => 12,   5 => 2,   6 => 'Dubai',   7 => 'ae',   8 => '25.2633',   9 => '55.3087',   10 => 'AE-DU',   11 => '485553664',   12 => 1,   13 => '190492860',...

Using as a workaround:

ALTER table matomo_log_visit modify column location_region CHAR(6);

The incoming location_region is AE-DU but the default field is CHAR(3).

Any better alternatives?

@nbari nbari added the Potential Bug Something that might be a bug, but needs validation and confirmation it can be reproduced. label Jun 8, 2022
@bx80 bx80 added this to the For Prioritization milestone Jun 8, 2022
@bx80 bx80 added Bug For errors / faults / flaws / inconsistencies etc. and removed Potential Bug Something that might be a bug, but needs validation and confirmation it can be reproduced. labels Jun 8, 2022
@bx80
Copy link
Contributor

bx80 commented Jun 8, 2022

Hi @nbari, thanks for reporting this, it's very similar to issue #19319 and #15715 and could be included in any fix for those issues.

@sgiehl
Copy link
Member

sgiehl commented Jun 9, 2022

@nbari Which geolocation plugin and/or provider are you using?

@nbari
Copy link
Author

nbari commented Jun 9, 2022

I am using DBIP/GeoIP 2(Php)

In the Download URL: https://download.maxmind.com/app/geoip_download?edition_id=GeoLite2-City

@sgiehl
Copy link
Member

sgiehl commented Jun 9, 2022

Hm. In that case I would assume that maxmind, another time, might have broken records in their database. It's actually not the first time, that they return invalid data for some records. Region codes should normally be returned without the country code prefixed. e.g. only DU and not AE-DU. I'll prepare a small PR so we removed the prefixed country if that happens.

@sgiehl sgiehl modified the milestones: For Prioritization, 4.12.0 Jun 9, 2022
@sgiehl sgiehl self-assigned this Jun 9, 2022
@justinvelluppillai justinvelluppillai changed the title Data too long for column 'location_region' Attempt to handle incorrectly prefixed region codes Sep 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For errors / faults / flaws / inconsistencies etc.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants