GeoIp

getting The address IP_NUMBER is not in the database

1 year 7 months ago #68400

Marcel Gemme's Avatar Marcel Gemme

I'm getting that message locally when trying to access the site trough an IP instead of domain "The address IP_NUMBER is not in the database"
The message is sent by geoip extension

1 year 7 months ago #68404

Peter van Westen's Avatar Peter van Westen Admin

You cannot use/test IP geolocation on a local host.
The IP will always be 127.0.0.1. Or in your case some weird constant name IP_NUMBER.

1 year 2 months ago #72781

Christian Zanardi's Avatar Christian Zanardi

Hello,

Some of our customers are from institution behind what is apparently a proxy (both in Africa and Switzerland). We have the exact same problem, for them. They all have a 404 error with "The address 192.168.xx.xx is not in the database" and the site crashes completely for them.

The thing is, I do not use geotargeting at all! I have noticed however that some module have : "has_geoip_library":"1" even if the module is not using geoip. Funny thing, the parameters goes to 1 if you select geotargeting and then go back to not using it. I have tried replacing all value by "has_geoip_library":"0" for the few modules concerned.

I have also altered the code in the Reader.php (/libraries/geoip/vendor/geoip2/geoip2/src/Database/Reader.php:224)

if ($record === null) {
            throw new AddressNotFoundException(
                "The address $ipAddress is not in the database."
            );
        }

Frankly I do not know if it will work (I cannot reproduce the error as the site does not run on local very well even on WAMP and thus I depend on the kindness of my clients (glurps...) ) but if you have an idea for a workaround or an ability to debug it would be great.

Thanks.

1 year 2 months ago #72789

Peter van Westen's Avatar Peter van Westen Admin

Ok, found the problem.
Please try the latest development version from:
www.regularlabs.com/development-releases

1 year 2 months ago #72804

Christian Zanardi's Avatar Christian Zanardi

it seems to be working. Thank your for your fast response and solution.
B)