Support

Admin Tools

#27143 Fatal Error with the akgeoip Maxmind reader. "" not a valid IP

Posted in ‘Admin Tools for Joomla! 4 & 5’
This is a public ticket

Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.

Environment Information

Joomla! version
n/a
PHP version
n/a
Admin Tools version
n/a

Latest post by on Saturday, 18 March 2017 18:17 CDT

erixis
 I have an isolated problem with just one user who is viewing this installation from a U.S. Military base. I think this has something to do with this error as I'm unable to replicate it, but I thought I'd post it here to see if there's anything to be done about.

I preface this support request with the fact that I know that this site is a) an unsupported Joomla version. b) an old version of Admintools, and c) an old unsupported PHP version. These may also be playing a role here. I'm working on upgrading sites for a number of installs and haven't got to this one yet.

I have never seen this error before.

So when my client tries to access the site from his browser, from inside a U.S. Military base, but otherwise, no other known security issues, instead of the site coming up, he gets this code error:

Fatal error: Uncaught exception 'InvalidArgumentException' with message 'The value "" is not a valid IP address.' in /plugins/system/akgeoip/lib/vendor/maxmind-db/reader/src/MaxMind/Db/Reader.php:98 Stack trace: #0 /plugins/system/akgeoip/lib/vendor/geoip2/geoip2/src/GeoIp2/Database/Reader.php(130): MaxMind\Db\Reader->get('') #1 /plugins/system/akgeoip/lib/vendor/geoip2/geoip2/src/GeoIp2/Database/Reader.php(91): GeoIp2\Database\Reader->modelFor('Country', '') #2 /plugins/system/akgeoip/lib/akgeoip.php(49): GeoIp2\Database\Reader->country('') #3 /plugins/system/akgeoip/lib/akgeoip.php(73): AkeebaGeoipProvider->getCountryRecord('') #4 /plugins/system/admintools/admintools/pro.php(2484): AkeebaGeoipProvider->getCountryCode('') #5 /plugins/system/admintools/admintools/pro.php(143): plgSystemAdmintoolsPro->geoBlocking() #6 [internal function]: plgS in /plugins/system/akgeoip/lib/vendor/maxmind-db/reader/src/MaxMind/Db/Reader.php on line 98

It looks like his browser is not providing accurate IP info, but I don't know why that's breaking the script. It might qualify as a security fault, but I would think Admintools would just block him.

He can access whatismyipaddress.com and it will show a valid IP for him, although the domain of the server suggests it is a proxy server.

I tried disabling the Geo IP plug in and re-enabling it, but neither solved the issue.

Are there any ideas on what's causing this fatal error?

tampe125
Akeeba Staff
Hello Eric,

in later version of the GeoIP plugin we added the code to handle such edge cases. Exceptions are caught and the user won't suffer any issue.
Looking at the details you provided, first of all you should update your Admin Tools version, take a look at the compatibility page to find the link to the correct version.
You'll have to update the GeoIP plugin, too. There aren't any special requirements, so it should work, just take a backup before updating it (better be safe than sorry).

Davide Tampellini

Developer and Support Staff

🇮🇹Italian: native 🇬🇧English: good • 🕐 My time zone is Europe / Rome (UTC +1)
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

System Task
system
This ticket has been automatically closed. All tickets which have been inactive for a long time are automatically closed. If you believe that this ticket was closed in error, please contact us.

Support Information

Working hours: We are open Monday to Friday, 9am to 7pm Cyprus timezone (EET / EEST). Support is provided by the same developers writing the software, all of which live in Europe. You can still file tickets outside of our working hours, but we cannot respond to them until we're back at the office.

Support policy: We would like to kindly inform you that when using our support you have already agreed to the Support Policy which is part of our Terms of Service. Thank you for your understanding and for helping us help you!