maxmind / geoipupdate-legacy

GeoIP update client code
GNU General Public License v2.0
258 stars 63 forks source link

Can't update GeoIP2-City.mmdb and GeoIP2-Country.mmdb files #39

Closed jrots closed 8 years ago

jrots commented 8 years ago

Hi, I'm using the following productids in the geoip.conf file :

ProductIds 106 133 GeoIP2-City GeoIP2-Country

But when running /usr/bin/geoipupdate -v -f geoip.conf -d data/ It does update the old legacy files, but can't seem to update the other ones :

Downloading gzipped GeoIP Database...
Done
Updating data/GeoIP2-City.mmdb
Saving gzip file to %s ... data/GeoIP2-City.mmdb.gzdownload data to a gz file named data/GeoIP2-City.mmdb.gz 
Done
Uncompressing gzip file ... Done
Performing santity checks ... Database type is 1
database_info  FAIL null
Received Error -21 (Sanity check database_info string failed) when attempting to update GeoIP Database
Connecting to MaxMind GeoIP server
via Host or Proxy Server: api.maxmind.com:80
sending request GET /app/update_getfilename?product_id=GeoIP2-Country HTTP/1.0
Host: updates.maxmind.com

with an empty data directory :

data/GeoIP.dat can't be opened, proceeding to download database
Updating data/GeoIP.dat
Updated database
data/GeoIPCity.dat can't be opened, proceeding to download database
Updating data/GeoIPCity.dat
Updated database
data/GeoIP2-City.mmdb can't be opened, proceeding to download database
Updating data/GeoIP2-City.mmdb
Received Error -21 (Sanity check database_info string failed) when attempting to update GeoIP Database
data/GeoIP2-Country.mmdb can't be opened, proceeding to download database
Updating data/GeoIP2-Country.mmdb
Received Error -21 (Sanity check database_info string failed) when attempting to update GeoIP Database

using

geoipupdate -V
geoipupdate 2.2.1
gzip --version
gzip 1.6

Please assist.

oschwald commented 8 years ago

It sounds like you have two versions of geoipupdate installed. One at /usr/bin/geoipupdate and the other likely at /usr/local/bin/geoipupdate. The "sanity check" error message you are receiving from /usr/bin/geoipupdate is returned by the 1.x versions of the program, not the 2.x versions.

You could confirm this by typing which -a geoipupdate.

jrots commented 8 years ago

Oh damn, that was indeed the issue, fixed now.. thanks for the help! :)