Strategic IT Consulting and Implementation Services

Fixing nextCloud GeoBlocker MaxMind “GeoIp2\Database\Reader” does not exist error

It seems the Geoblocker app with Nextcloud can get out of whack on Nextcloud updates or if you are doing geoipupdates to leverage your Maxmind geoip database for other applications. I noticed this recently and there seems to be some various solutions out on the web to handle this.

I had this working for many months and all of a sudden noticed errors in Nextcloud on this where the Geoblocker app couldn’t check on incoming ips and validate access rules against my preferences and properly scan the Maxmind country IP database.

GeoBlocker errors in Nextcloud Logging

You want to, of course, make sure geoipupdate is working and everything is okay with your Maxmind account, monthly database pulls if you are doing the free option, etc. You also want to make sure you have the db file and the path for that properly set in the GeoBlocker app settings in Nextcloud.

GeoBlocker settings in Nextcloud

I happen to be parking this in /var/lib/GeoIP/ and that hasn’t changed for a long time even through various Nextcloud, LAMP, and other updates. That has been working just fine. But, what I noticed was the recent error could be related to the missing geoip2.phar file neccesary to read/parse the file for GeoBlocker.

Doing a find / -name for it, I could only find it in backups so somehow it got lost!

You can download it here >>

Grab the file and go ahead and place it in the same directory as the location of the database file.

When I did, that cleared-up the error and everything was happy again.

geoip2.phar and maxmind country.mmdb together again and happy

If you run into this issue, I hope just getting the phar back and next to the mmdb is the fix for you. It was for me.

About the author

Jonathan Mergy

Add comment

Strategic IT Consulting and Implementation Services