GeoIP2 Plugin causes dashboard login issues in Matomo 5.6.2

Hello,

since updating to Matomo 5.6.2, I am unable to log in to the dashboard when the GeoIP2 plugin is enabled. It took me quite a while to figure this out. The login either shows an “invalid token” message or eventually times out.

It seems that something in the plugin takes too much time or is broken. I enabled and disabled the plugin via the config.ini.php file. When the plugin is disabled, I can log in normally. Afterwards, I am able to re-enable the plugin, and everything seems to work fine. However, if I log out with the plugin enabled, I am unable to log in again until the plugin is disabled.

The plugin is configured to use DBIP / GeoIP2 (PHP) and correctly shows locations when I check it under System Settings.

I did not see anything obvious in the logs except for max-execution timeouts after 180 seconds.

Does anyone else experience a similar issue? I could not find any reports of these symptoms. If you need additional information, please ask.

Thank you!

Thanks for sharing the details, this is a useful find.
This does sound like a performance or timeout issue triggered during the login process when GeoIP2 initializes. Since login works immediately after disabling the plugin, it’s likely that the GeoIP lookup is slowing down authentication, especially if the DBIP/GeoIP database is large or stored on slower I/O.
A few things that may be worth checking or testing:
PHP max_execution_time and memory_limit, as the 180s timeout suggests the process is hitting limits during login.
Whether GeoIP lookups are happening synchronously on every login request.
Testing with a smaller or updated GeoIP database to rule out file size or corruption issues.
Enabling debug logging specifically around authentication and plugin initialization to see exactly where the delay occurs.
It might also help to test the same setup on a staging instance to confirm whether this behavior is specific to the current environment or reproducible more generally. Hopefully this narrows it down for others seeing similar symptoms.

I am using PHP 8.4.15 with a memory limit of 128 MB. I think it is using dbip-city-lite as the Geo-IP-Dataset; at least this is what it shows. I am currently not able to test this (quickly) on another system, since the MySQL is not reachable from outside.