Skip to content
This repository has been archived by the owner on Jan 26, 2019. It is now read-only.

geoipupdate-pureperl.pl fails to work with freebie accounts. #81

Open
zzqzzqzzq opened this issue Nov 8, 2017 · 0 comments
Open

geoipupdate-pureperl.pl fails to work with freebie accounts. #81

zzqzzqzzq opened this issue Nov 8, 2017 · 0 comments

Comments

@zzqzzqzzq
Copy link

geoip.conf:

$ cat geoip.conf
# The following AccountID and LicenseKey are required placeholders.
# For geoipupdate versions earlier than 2.5.0, use UserId here instead of AccountID.
AccountID 0
LicenseKey 000000000000

# Include one or more of the following edition IDs:
# * GeoLite2-City - GeoLite 2 City
# * GeoLite2-Country - GeoLite2 Country
# For geoipupdate versions earlier than 2.5.0, use ProductIds here instead of EditionIDs.
EditionIDs GeoLite2-City 

Error output:

$ ./geoipupdate-pureperl.pl -v -f geoip.conf -d .
Opened License file geoip.conf
Read in license key 000000000000
Edition IDs GeoLite2-City
MD5 sum of database ./GeoIP.dat is 00000000000000000000000000000000
Send request http://updates.maxmind.com/app/update?license_key=000000000000&md5=00000000000000000000000000000000
401 Unauthorized at ./geoipupdate-pureperl.pl line 229, <$fh> line 11.

Pretty certain its due to line 123:

if ($account_id) {

Unsurprisingly $account_id is zero with a freebie account, so GeoIP_update_database_general never gets called. GeoIP_update_database, is called instead, and I suspect that routine may also be old & broken. If I dummy up the test on line 123 eg ($account_id == 0), I'll at least get to the point where I'm missing the PerlIO::Gzip library. (Which is an entirely separate issue on my end.)

$ ./geoipupdate-pureperl.pl -v -f geoip.conf -d .
Opened License file geoip.conf
Read in license key 000000000000
Edition IDs GeoLite2-City
Send request http://updates.maxmind.com/app/update_getfilename?product_id=GeoLite2-City
MD5 sum of database ./GeoLite2-City.mmdb is 00000000000000000000000000000000
Send request http://updates.maxmind.com/app/update_getfilename?product_id=GeoLite2-City
client ip address: X.Y.Z.16
md5sum of ip address and license key is XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Send request http://updates.maxmind.com/app/update_secure?db_md5=00000000000000000000000000000000&challenge_md5=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX&user_id=0&edition_id=GeoLite2-City
Downloading gzipped GeoIP Database...
Unknown PerlIO layer "gzip" at ./geoipupdate-pureperl.pl line 260, <$fh> line 11.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

1 participant