Inconsistent / missing results from Region database
GBH opened this issue · 6 comments
This is using latest db dump from maxmind: GeoIPRegion-115_20141021
It generally works as seen here:
Ruby:
pry(main)> GEOIP_DB.region('96.45.202.230')
=> #<struct GeoIP::Region
request="96.45.202.230",
ip="96.45.202.230",
country_code2="CA",
country_code3="CAN",
country_name="Canada",
continent_code="NA",
region_code="ON",
region_name="Ontario",
timezone="America/Rainy_River">
Python:
>>> print gi.region_by_addr('96.45.202.230')
{'region_code': 'ON', 'country_code': 'CA'}
But then I started to notice a lot of IPs that are not matched to anything in pygeoip. For example:
Ruby:
pry(main)> GEOIP_DB.region('46.22.192.1')
=> #<struct GeoIP::Region
request="46.22.192.1",
ip="46.22.192.1",
country_code2="FR",
country_code3="FRA",
country_name="France",
continent_code="EU",
region_code="",
region_name=nil,
timezone="Europe/Paris">
Python:
print gi.region_by_addr('46.22.192.1')
{'region_code': None, 'country_code': None}
Any idea what migth be the problem?
Since nobody seems to be using this library I switched to https://github.com/maxmind/geoip-api-python
Gotta install C lib but at least it works.
Sorry, haven't had time to look into this since I just had a baby. This is really weird and I've never seen it before, pygeoip
is widely used in production and will receive a fix as soon I understand the issue.
Awesome, thanks! I'll switch back because I don't really want to mess with installing C lib on production server.
It works! Thanks again.