Search code examples
dockergeolocationgeoipmaxmind

Maxmind geoipupdate gets http 403 on docker run


I am using maxmind GeoLite2 binary database for geolocation services and I want to update this periodically.

It works fine on updating through geoipupdate program installed via brew. However Maxmind provides a docker image to update db periodically. When I try to run docker command below,

 docker run --env-file IdeaProjects/ip-geolocation-service/src/main/resources/application.properties  -v /Users/me/GeoIp maxmindinc/geoipupdate

With the environment file refers to application.properties,

GEOIPUPDATE_ACCOUNT_ID=12345
GEOIPUPDATE_LICENSE_KEY=aaaaaaaaaa
GEOIPUPDATE_EDITION_IDS=GeoIP2-Country

I gets the following error:

# STATE: Creating configuration file at /etc/GeoIP.conf
# STATE: Running geoipupdate
error retrieving updates: error while getting database for GeoIP2-Country: unexpected HTTP status code: received HTTP status code: 403: Invalid product ID or subscription expired for GeoIP2-Country

Since my credentials is working on manual trigger, I wonder why it has not working on docker run? Any idea for spotting problem or anyone has faced with it?


Solution

  • You write that you want to use the free GeoLite2 database but the ID you use looks like the commercial/paid one. Try the following instead:

    GEOIPUPDATE_EDITION_IDS=GeoLite2-Country
    

    Source: https://github.com/maxmind/geoipupdate/blob/main/doc/docker.md