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

Received an unexpected HTTP status code of 401 while using free GeoLite2 Databases #95

Open
pabloab opened this issue Mar 9, 2018 · 7 comments

Comments

@pabloab
Copy link

pabloab commented Mar 9, 2018

Steps to reproduce the bug:

  1. Install geoipupdate package
  2. Using provided GeoIP.conf file for free GeoLite2 Databases.

This return

Received an unexpected HTTP status code of 401 from https://updates.maxmind.com/app/update?license_key=000000000000&md5=00000000000000000000000000000000

Using geoipupdate 2.2.1 over Ubuntu 16.04.4 LTS.

@oschwald
Copy link
Member

I am unable to reproduce this on 2.5.0. Would you be able to update and try again? If it still happens, please attach the full GeoIP.conf you used along with the output of geoipupdate -v.

@pabloab
Copy link
Author

pabloab commented Mar 12, 2018

Now I'm using sudo geoipupdate (without sudo Can't open /var/lib/GeoIP/GeoIP.dat.gz, sounds fair).

sudo geoipupdate -v
geoipupdate 2.2.1
Opened License file /etc/GeoIP.conf
Skip unknown directive: AccountID
LicenseKey 000000000000
Skip unknown directive: EditionIDs
Read in license key /etc/GeoIP.conf
Number of product ids 0
md5hex_digest: 00000000000000000000000000000000
url: https://updates.maxmind.com/app/update?license_key=000000000000&md5=00000000000000000000000000000000
Received an unexpected HTTP status code of 401 from https://updates.maxmind.com/app/update?license_key=000000000000&md5=00000000000000000000000000000000

Since I don't have an account I'm using the provided GeoIP.conf.

I upgrade with PPA. On the process dpkg warn me about a change on GeoIP.conf. I choose install the package maintainer's version. Now everything seems to work fine. I compare both uncommented lines and the only difference I've found was EditionIDs GeoLite2-Country GeoLite2-City on the old vs EditionIDs GeoLite2-City GeoLite2-Country on the new version. Now:

sudo geoipupdate -v                                                                                                                                                                                                                                                                                            
geoipupdate 2.5.0
Opened License file /etc/GeoIP.conf
AccountID 0
LicenseKey 000000000000
Insert edition_id GeoLite2-Country
Insert edition_id GeoLite2-City
Read in license key /etc/GeoIP.conf
Number of edition IDs 2
url: https://updates.maxmind.com/app/update_getfilename?product_id=GeoLite2-Country
md5hex_digest: 00000000000000000000000000000000
url: https://updates.maxmind.com/app/update_getipaddr
Client IP address: 172.217.30.174
md5hex_digest2 (challenge): eb875c33d7038b9709cbc31d82aaaeef
url: https://updates.maxmind.com/app/update_secure?db_md5=00000000000000000000000000000000&challenge_md5=eb875c33d7038b9709cbc31d82aaaeef&user_id=0&edition_id=GeoLite2-Country
Uncompress file /usr/share/GeoIP/GeoLite2-Country.mmdb.gz to /usr/share/GeoIP/GeoLite2-Country.mmdb.test
Rename /usr/share/GeoIP/GeoLite2-Country.mmdb.test to /usr/share/GeoIP/GeoLite2-Country.mmdb
url: https://updates.maxmind.com/app/update_getfilename?product_id=GeoLite2-City
md5hex_digest: 00000000000000000000000000000000
url: https://updates.maxmind.com/app/update_getipaddr
Client IP address: 172.217.30.174
md5hex_digest2 (challenge): eb875c33d7038b9709cbc31d82aaaeef
url: https://updates.maxmind.com/app/update_secure?db_md5=00000000000000000000000000000000&challenge_md5=eb875c33d7038b9709cbc31d82aaaeef&user_id=0&edition_id=GeoLite2-City
Uncompress file /usr/share/GeoIP/GeoLite2-City.mmdb.gz to /usr/share/GeoIP/GeoLite2-City.mmdb.test
Rename /usr/share/GeoIP/GeoLite2-City.mmdb.test to /usr/share/GeoIP/GeoLite2-City.mmdb

I then remove PPA and downgrade to 2.2.1 (without touching GeoIP.conf) and have same http 401 error.

@oschwald
Copy link
Member

If you read the comment on the document, it says:

# For geoipupdate versions earlier than 2.5.0, use ProductIds here instead of EditionIDs.

You need to do this to use the configuration file you linked to in 2.2.1

@pabloab
Copy link
Author

pabloab commented Mar 12, 2018

Sorry, I didn't see that. I suggest to add this warning on the above paragraph. Maybe the server could handle this particular case.

@rajcz
Copy link

rajcz commented Apr 3, 2018

Hello, i have this same problem, I cant see where is error. It is geoipupdate from Centos repo.

Can you hint me, please? Thank you

`

geoipupdate -v
geoipupdate 2.2.1
Opened License file /etc/GeoIP.conf
UserId 0
LicenseKey 000000000000
Insert product_id 506
Insert product_id 517
Insert product_id 533
Read in license key /etc/GeoIP.conf
Number of product ids 3
url: https://updates.maxmind.com/app/update_getfilename?product_id=506
md5hex_digest: a1bdbc9d6db9077ffe7e314007b86057
url: https://updates.maxmind.com/app/update_getipaddr
Client IP address: 85.118.
md5hex_digest2: 767b8b28ec22ce6279c6312a87c3b4bb
url: https://updates.maxmind.com/app/update_secure?db_md5=a1bdbc9d6db9077ffe7e314007b86057&challenge_md5=767b8b28ec22ce6279c6312a87c3b4bb&user_id=0&edition_id=506
Received an unexpected HTTP status code of 401 from https://updates.maxmind.com/app/update_secure?db_md5=a1bdbc9d6db9077ffe7e314007b86057&challenge_md5=767b8b28ec22ce6279c6312a87c3b4bb&user_id=0&edition_id=506

`

@root360-AndreasUlm
Copy link

@rajcz you have to remove the legacy databases from your list as those aren't supported and provided anymore.
Found that solution after chatting with maxmind.

@oschwald
Copy link
Member

oschwald commented Apr 3, 2018

@root360-AndreasUlm is correct. The GeoLite Legacy databases are no longer available from geoipupdate unless you have a redistribution license. We have stopped updating the free version of GeoLite Legacy. Please see our support site for more information. Old versions will continue to be available on our dev site until January 2, 2019.

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

4 participants