Warning from geoIp2/Php.php

(Not sure how to tag this, I’m new to Matomo)

Hello! I’m evaluating Matomo for a business, and have installed it in a SWAG* environment with additional mariadb container. After creating some traffic, I saw no geographic data. When I go to Settings → System → Geolocation I get several instance of this error:

WARNING: /plugins/GeoIp2/LocationProvider/GeoIp2/Php.php(318): Warning - iconv(): Wrong encoding, conversion from "UTF-8" to "ASCII//TRANSLIT" is not allowed - Matomo 5.0.3 - Please report this message in the Matomo forums: {LINK REDACTED SO THE FORUM WILL LET ME POST} (please do a search first as it might have been reported already) (Module: UserCountry, Action: adminIndex, In CLI mode: false)

I’m following instructions by posting here, after searching and not finding a report of this issue.

* I tried to link to the project for context, but the forum denied me. SWAG is a LinuxServer dot io project that bundles Nginx and PHP, along with certbot and other nicities.

Friends, if I’ve done something wrong, committed some faux pas for this forum that disqualifies me from interaction, please let me know. If this is a PEBCAK error I’d be super please, because those are the easiest to solve.

Hi @Aximilli
Do you have some warnings or errors in :gear: > Diagnostic > System Check?
Is there any other errors in the Matomo error log file?

Hi @heurteph-ei, thanks for responding!

The system check dings me for crontab, max packet size, and forced SSL. I wasn’t worried about them for the purposes of this evaluation deployment, but if perhaps the packet size is related please let me know.

Following this FAQ page, I enabled a log file (which wasn’t on by default), and it moved the errors off of the page and into the file:

$ tail matomo.log 
WARNING GeoIp2[2024-03-19 17:31:04 UTC] [8cc4b] 
/config/www/matomo/plugins/GeoIp2/LocationProvider/GeoIp2/Php.php(318):
 Warning - iconv(): Wrong encoding, conversion from "UTF-8" to "ASCII//TRANSLIT" is not allowed
 - Matomo 5.0.3 - Please report this message in the Matomo forums: {LINK REDACTED} (please do a search first as it might have been reported already) [internal function]:
 Piwik\ErrorHandler::errorHandler(),
#1/plugins/GeoIp2/LocationProvider/GeoIp2/Php.php(318),
#2/plugins/GeoIp2/LocationProvider/GeoIp2/Php.php(295),
#3/plugins/GeoIp2/LocationProvider/GeoIp2/Php.php(274),
#4/plugins/GeoIp2/LocationProvider/GeoIp2/Php.php(137),
#5/plugins/UserCountry/LocationProvider.php(301),
#6/plugins/UserCountry/Controller.php(42),
[internal function]: Piwik\Plugins\UserCountry\Controller->adminIndex(),#8/core/FrontController.php(637),
#9/core/FrontController.php(169)
...

(edited with line breaks for easy forum viewing, and removed the link so the forum will let me post)

No additional errors are reported.

P.S. I updated max_packet_allowed just in case, with no change.

Hi @Aximilli
I found this:

Then something seems to be not installed on your server…

Hi @heurteph-ei

Thanks, but I also found that SE post while troubleshooting, and confirmed that the required PHP plugins are installed:

# php -m | grep mbstring
mbstring
# php -m | grep xml
libxml
xml
xmlreader
xmlwriter
# php -m | grep iconv
iconv

Hi @Aximilli

Can you maybe check on the phpinfo page if it is well installed?

Confirmed:

[Second image removed because the forum won’t let me post it. It’s just more examples of the (possibly) required PHP plugins present in the info page.]

I also added some options to my php.ini file:

[mbstring]
mbstring.language = Neutral
mbstring.encoding_translation = On
mbstring.http_input = pass
mbstring.http_input = auto
mbstring.http_input = UTF-8

With no result.

Hi @Aximilli
I am not expert in PHP installation, but it seems the issue comes from versionof iconv or PHP.
Is it possible for you to upgrade PHP? (which is you PHP version?)

Hello again,

The docker container is running PHP 8.3.3, which is the almost-latest version as of a few days ago, so I don’t think it’s “outdated”. Perhaps it’s the case that Matomo isn’t updated for newer versions of iconv?

In any case, I’m less concerned about this issue than I was when I opened the thread. It’s not actually blocking geoIP tracking, I was just a Matomo noob (and was testing through an exit node with no geo location :smile: )

Now that the warnings are being logged to a file (and not flooding the UI by default), my need to fix this warning has gone from a necessity to a “nice to have”.

1 Like