4.0.5 issue with GeoIP2 Core plugin

If I enable the GeoIP2 core plugin on Matomo 4.0.5 and try to access the system check page on backend afterwards, I get the following error:

A fatal error occurred

The following error just broke Matomo (v4.0.5):

Call to undefined method MaxMind\Db\Reader::getWithPrefixLen() in /stats/vendor/geoip2/geoip2/src/Database/Reader.php line 232

Any help on how to fix this would be much appreciated!
thx

Hi,

It seems like some files are missing. Maybe the update got interrupted before all files could be unpacked.

I’d recommend you to replace all files with the ones from the latest matomo.zip (https://matomo.org/docs/update/#the-manual-three-step-update)

I re-uploaded the files via SCP, unfortunately with no change - still the same error message (webserver has also been restarted, no effect)

Hi,

This is really weird. I just checked in the latest Matomo.zip and for me in vendor/maxmind-db/reader/src/MaxMind/Db/Reader.php in Line 149 the function getWithPrefixLen is defined.

I also checked the file on our server - getWithPrefixLen is defined on line 149 in /stats/vendor/maxmind-db/reader/src/MaxMind/Db/Reader.php - very strange

Hi,

A guess by @SteveG:
Do you have by chance the libmaxminddb installed? If so, Matomo uses it instead and as the library was updated in Matomo 4 you would also need to update the C module.

After fixing the issue 4.0.5 issues with Actions and Goal plugins (unknown columns) this error was also fixed. Short version: database schema was not updated correctly due to old MariaDB 10.1

1 Like