maxmind / GeoIP2-perl

Perl API for MaxMind's GeoIP2 web services and databases
https://metacpan.org/release/GeoIP2/
Other
18 stars 11 forks source link

Certain ip addresses cause the module to do a stack trace #74

Closed davidholoshka closed 4 years ago

davidholoshka commented 4 years ago

The IP address you provided (172.20.22.2) is not a public IP address when calling GeoIP2::Database::Reader::country on GeoIP2::Database::Reader

Trace begun at /usr/local/share/perl/5.26.1/GeoIP2/Database/Reader.pm line 81 GeoIP2::Database::Reader::_model_for_address('GeoIP2::Database::Reader=HASH(0x55715fd610d8)', 'Country', 'type_check', 'Regexp=REGEXP(0x55715fd7df58)', 'ip', 172.20.22.2) called at /usr/local/share/perl/5.26.1/GeoIP2/Database/Reader.pm line 133 GeoIP2::Database::Reader::country('GeoIP2::Database::Reader=HASH(0x55715fd610d8)', 'ip', 172.20.22.2) called at stats/t/GeoIP2-test.pl line 17

I am using Debian and Ubuntu with the libmaxminddb XS module.

oschwald commented 4 years ago

This is the expected behavior. An exception will be thrown if the IP is not in the database. Please see the documentation.