GithubHelp home page GithubHelp logo

geoipupdate's Introduction

GeoIP Update

The GeoIP Update program performs automatic updates of GeoIP2 and GeoLite2 binary databases. CSV databases are not supported.

Installation

We provide releases for Linux, macOS (darwin), and Windows. Please see the Releases tab for the latest release.

After you install GeoIP Update, please refer to our documentation for information about configuration.

If you're upgrading from GeoIP Update 3.x, please see our upgrade guide.

Installing on Linux via the tarball

Download and extract the appropriate tarball for your system. You will end up with a directory named something like geoipupdate_5.0.0_linux_amd64 depending on the version and architecture.

Copy geoipupdate to where you want it to live. To install it to /usr/local/bin/geoipupdate, run the equivalent of sudo cp geoipupdate_5.0.0_linux_amd64/geoipupdate /usr/local/bin.

geoipupdate looks for the config file /usr/local/etc/GeoIP.conf by default.

Installing on Ubuntu via PPA

MaxMind provides a PPA for recent versions of Ubuntu. To add the PPA to your sources, run:

$ sudo add-apt-repository ppa:maxmind/ppa

Then install geoipupdate by running:

$ sudo apt update
$ sudo apt install geoipupdate

Installing on Ubuntu or Debian via the deb

You can also use the tarball.

Download the appropriate .deb for your system.

Run dpkg -i path/to/geoipupdate_5.0.0_linux_amd64.deb (replacing the version number and architecture as necessary). You will need to be root. For Ubuntu you can prefix the command with sudo. This will install geoipupdate to /usr/bin/geoipupdate.

geoipupdate looks for the config file /etc/GeoIP.conf by default.

Installing on RedHat or CentOS via the rpm

You can also use the tarball.

Download the appropriate .rpm for your system.

Run rpm -Uvhi path/to/geoipupdate_5.0.0_linux_amd64.rpm (replacing the version number and architecture as necessary). You will need to be root. This will install geoipupdate to /usr/bin/geoipupdate.

geoipupdate looks for the config file /etc/GeoIP.conf by default.

Installing on macOS (darwin) via the tarball

This is the same as installing on Linux via the tarball, except choose a tarball with "darwin" in the name.

Installing on macOS via Homebrew

If you are on macOS and you have Homebrew you can install geoipupdate via brew

$ brew install geoipupdate

Installing on Windows

Download and extract the appropriate zip for your system. You will end up with a directory named something like geoipupdate_5.0.0_windows_amd64 depending on the version and architecture.

Copy geoipupdate.exe to where you want it to live.

geoipupdate looks for the config file \ProgramData\MaxMind\GeoIPUpdate\GeoIP.conf on your system drive by default.

Installing via Docker

Please see our Docker documentation.

Installation from source or Git

You need the Go compiler (1.21+). You can get it at the Go website.

The easiest way is via go install:

$ go install github.com/maxmind/geoipupdate/v7/cmd/geoipupdate@latest

This installs geoipupdate to $GOPATH/bin/geoipupdate.

Configuring

Please see our online guide for directions on how to configure GeoIP Update.

Documentation

See our documentation for the geoipupdate program and the GeoIP.conf configuration file.

Default config file and database directory paths

We define default paths for the config file and database directory. If these defaults are not appropriate for you, you can change them at build time using flags:

go build -ldflags "-X main.defaultConfigFile=/etc/GeoIP.conf \
    -X main.defaultDatabaseDirectory=/usr/share/GeoIP"

Bug Reports

Please report bugs by filing an issue with our GitHub issue tracker.

Copyright and License

This software is Copyright (c) 2018 - 2024 by MaxMind, Inc.

This is free software, licensed under the Apache License, Version 2.0 or the MIT License, at your option.

geoipupdate's People

Contributors

aktasfatih avatar amzhughe avatar andyjack avatar apathor avatar dependabot-preview[bot] avatar dependabot[bot] avatar dlieou avatar faktas2 avatar gabenp avatar horgh avatar its-johnt avatar jthomperoo avatar kevcenteno avatar linutux42 avatar loganmarchione avatar marselester avatar mattkobayashi avatar mm-jpoole avatar momirjalili avatar najiobeid avatar nateinaction avatar nicholi avatar oschwald avatar patrickcronin avatar pghmcfc avatar rafl avatar samuelson avatar shadromani avatar ugexe avatar wesrice avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

geoipupdate's Issues

bad checksum on "geoipupdate_4.0.0_linux_amd64.deb", dpkg -i failed

Hello,

I try installing from the deb package. I'm getting it there : geoipupdate_4.0.0_linux_amd64.deb

The checksum given by the file checksums-dpkg-rpm.txt is :

c6b4c7c9b7477c9e18371129693e894fc573ed9138276b6da28c76c3bcbf3839 geoipupdate_4.0.0_linux_amd64.deb
And my sha256sum on package downloaded gave me :
b54ea433c1cd1ee1f8d22567bc2cf689ace6e9bc7d8f6796bee7a5327d4620e7 /tmp/geoipupdate_4.0.0_linux_amd64.deb

I can't install from the package so it seems something is broken. I get this error when trying installing it :
`
$ dpkg -i /tmp/geoipupdate_4.0.0_linux_amd64.deb

dpkg-deb: error: '/tmp/geoipupdate_4.0.0_linux_amd64.deb' is not a debian format archive
dpkg: error processing archive /tmp/geoipupdate_4.0.0_linux_amd64.deb (--install):
subprocess dpkg-deb --control returned error exit status 2
Errors were encountered while processing:
/tmp/geoipupdate_4.0.0_linux_amd64.deb

`

Docker setting for GEOIPUPDATE_FREQUENCY not working

Running geoipupdate in Docker with the config below (part of a larger compose file for Graylog).

  geoipupdate:
    container_name: geoipupdate
    image: maxmindinc/geoipupdate:v4
    restart: unless-stopped
    environment:
      - GEOIPUPDATE_ACCOUNT_ID=XXXXXX
      - GEOIPUPDATE_LICENSE_KEY=XXXXXXXXXXXXXXXX
      - 'GEOIPUPDATE_EDITION_IDS=GeoLite2-ASN GeoLite2-City GeoLite2-Country'
    networks:
      - graylog
    depends_on:
      - graylog
    volumes:
      - 'geoipupdate_data:/usr/share/GeoIP'

I did not specify a GEOIPUPDATE_FREQUENCY, and the README file says:

The number of hours between geoipupdate runs. If this is not set or is set to 0, geoipupdate will run once and exit.

However, I'm seeing this repeatedly over and over in the log every 30 seconds or so. Is there something wrong with the frequency logic?

When I setup GEOIPUPDATE_FREQUENCY=0, it does the same thing.

# STATE: Running geoipupdate
# STATE: Creating configuration file at /etc/GeoIP.conf
AccountID XXXXXX
LicenseKey XXXXXXXXXXXXXXXX
EditionIDs GeoLite2-ASN GeoLite2-City GeoLite2-Country
# STATE: Running geoipupdate
# STATE: Creating configuration file at /etc/GeoIP.conf
AccountID XXXXXX
LicenseKey XXXXXXXXXXXXXXXX
EditionIDs GeoLite2-ASN GeoLite2-City GeoLite2-Country
# STATE: Running geoipupdate
# STATE: Creating configuration file at /etc/GeoIP.conf
AccountID XXXXXX
LicenseKey XXXXXXXXXXXXXXXX
EditionIDs GeoLite2-ASN GeoLite2-City GeoLite2-Country
# STATE: Running geoipupdate
# STATE: Creating configuration file at /etc/GeoIP.conf
AccountID XXXXXX
LicenseKey XXXXXXXXXXXXXXXX
EditionIDs GeoLite2-ASN GeoLite2-City GeoLite2-Country
# STATE: Running geoipupdate
# STATE: Creating configuration file at /etc/GeoIP.conf
AccountID XXXXXX
LicenseKey XXXXXXXXXXXXXXXX
EditionIDs GeoLite2-ASN GeoLite2-City GeoLite2-Country

When I setup GEOIPUPDATE_FREQUENCY=8, it seems to work.

# STATE: Creating configuration file at /etc/GeoIP.conf
AccountID XXXXXX
LicenseKey XXXXXXXXXXXXXXXX
EditionIDs GeoLite2-ASN GeoLite2-City GeoLite2-Country
# STATE: Running geoipupdate
# STATE: Sleeping for 8 hours

generate arm version

is it possible to generate an ARM version for raspberry pi?
possibly use the pull request #62

Fix link for upgrade

Can you fix the link upgrade guide on the README that should point to:
https://dev.maxmind.com/geoip/geoipupdate/upgrading-to-geoip-update-4-x/
instead of:
https://dev.maxmind.com/geoip/geoipupdate/upgrading-to-geoipupdate-4-x/

Thanks.

EDIT: by the way I've mistakenly typed https://dev.maxmind.com/geoip/geoipupdate/upgrading-to-geoip+update-4-x/ and the url is valid too...

Documentation: how to build with non-default directories

The README.md file doesn't give enough information to let one build a copy of geoipupdate with non-default directories - at least, not if one is a go novice. It looks as if the correct approach is something like:

cd $HOME/go/src/github.com/maxmind/geoipupdate and do:
set CONFFILE=/some/path/myGeoIP.conf
set DATADIR=/some/path/to/data/dir
make

But this doesn't work. It would be nice if README.md could include the correct steps to achieve the desired results.

Reevaluate vendoring

The git repository right now has the vendor/ directory commited into git and shipped with the tarballs. This is a bit of nightmare for downstreams, as we need to strip these out and repackage the tarballs (the alternative would be to ship the same library dozens of times, and repeat a lot of the work required, such as documenting their copyright and license status, pushing security updates etc.).

Go's own FAQ has an entry about whether one should commit their vendor directory. They list some additional pros/cons there.

I am guessing this is deliberate and will understand if you reject this bug. As a downstream (Debian), I'd like to minimize the delta between my upstreams and avoid repackaging their tarballs, so I figured I'd ask here rather than make any assumptions that this is not something that you would ever consider :) Thanks!

I get an error message using volumes in docker-compose.yml on docker for windows

I get an error message when I use geoipupdate in docker container but I can get database file and I don't get the error message unless I use volumes setting in docker-compose.yml

  • error message
    Error retrieving updates: error updating GeoLite2-Country: error updating: error syncing database directory: sync /mnt/geoip: invalid argument

  • volumes settings is the following
    volumes:

    • .\geoip:/mnt/geoip

I can download mmdb file but got an error message

window 4.0.4 version does not make an error message
but linux amd64 4.0.4 made the error message on docker container.

Tue Sep 3 06:48:01 UTC 2019 Using config file /usr/local/etc/GeoIP.conf
Tue Sep 3 06:48:01 UTC 2019 Using database directory /mnt/geoip
Tue Sep 3 06:48:01 UTC 2019 Acquired lock file lock (/mnt/geoip/.geoipupdate.lock)
Tue Sep 3 06:48:01 UTC 2019 Performing get filename request to https://updates.maxmind.com/app/update_getfilename?product_id=GeoLite2-Country
Tue Sep 3 06:48:01 UTC 2019 Not calculating MD5 sum as file does not exist: /mnt/geoip/GeoLite2-Country.mmdb
Tue Sep 3 06:48:01 UTC 2019 Performing update request to https://updates.maxmind.com/geoip/databases/GeoLite2-Country/update?db_md5=00000000000000000000000000000000
Tue Sep 3 06:48:03 UTC 2019 Error retrieving updates: error updating GeoLite2-Country: error updating: error syncing database directory: sync /mnt/geoip: invalid argument

GeoLite2 db access, with license, fails at "error retrieving updates: error creating database writer: could not acquire lock "

after reading notice

https://blog.maxmind.com/2019/12/18/significant-changes-to-accessing-and-using-geolite2-databases/

i'm updating my local installs.

building clean, as usual, from git sources, with no errors,

	-rw-r--r-- 1 root root  507 Jan  9 10:28 /usr/local/include/maxminddb_config.h
	-rw-r--r-- 1 root root 8.4K Jan  9 10:28 /usr/local/include/maxminddb.h
	-rwxr-xr-x 1 root root  943 Jan  9 10:28 /usr/local/lib64/libmaxminddb.la*
	lrwxrwxrwx 1 root root   21 Jan  9 10:28 /usr/local/lib64/libmaxminddb.so -> libmaxminddb.so.0.0.7*
	lrwxrwxrwx 1 root root   21 Jan  9 10:28 /usr/local/lib64/libmaxminddb.so.0 -> libmaxminddb.so.0.0.7*
	-rwxr-xr-x 1 root root 121K Jan  9 10:28 /usr/local/lib64/libmaxminddb.so.0.0.7*
	-rw-r--r-- 1 root root  281 Jan  9 10:28 /usr/local/lib64/pkgconfig/libmaxminddb.pc

and

GOPATH=/usr/local/ go get -u github.com/maxmind/geoipupdate/cmd/geoipupdate
ls -al `which geoipupdate`
	-rwxr-xr-x 1 root root 7.4M Jan  9 10:31 /usr/local/bin/geoipupdate*

I've created an account, and gotten my acctID + license key; config file is

	cat /usr/local/etc/geoip/GeoIP.conf
		AccountID ######
		LicenseKey ################
		EditionIDs GeoLite2-City GeoLite2-Country GeoLite2-ASN

on exec of goeipupdate

	geoipupdate -v \
	 -f /usr/local/etc/geoip/GeoIP.conf \
	 -d /usr/local/share/GeoIP2

I get an error,

	Using config file /usr/local/etc/geoip/GeoIP.conf
	Using database directory /usr/local/share/GeoIP2
	Performing get filename request to https://updates.maxmind.com/app/update_getfilename?product_id=GeoLite2-City
	Acquired lock file lock (/usr/local/share/GeoIP2/.geoipupdate.lock)
	Performing update request to https://updates.maxmind.com/geoip/databases/GeoLite2-City/update?db_md5=00000000000000000000000000000000
	error closing temporary file: close /usr/local/share/GeoIP2/GeoLite2-City.mmdb.temporary: file already closed
	Performing get filename request to https://updates.maxmind.com/app/update_getfilename?product_id=GeoLite2-Country
	error retrieving updates: error creating database writer: could not acquire lock on /usr/local/share/GeoIP2/.geoipupdate.lock

Note, the first lock is acquired

here's with --stack-trace

Using config file /usr/local/etc/geoip/GeoIP.conf
Using database directory /usr/local/share/GeoIP2
Performing get filename request to https://updates.maxmind.com/app/update_getfilename?product_id=GeoLite2-ASN
Acquired lock file lock (/usr/local/share/GeoIP2/.geoipupdate.lock)
Performing update request to https://updates.maxmind.com/geoip/databases/GeoLite2-ASN/update?db_md5=00000000000000000000000000000000
error closing temporary file: close /usr/local/share/GeoIP2/GeoLite2-ASN.mmdb.temporary: file already closed
Performing get filename request to https://updates.maxmind.com/app/update_getfilename?product_id=GeoLite2-City
error retrieving updates: could not acquire lock on /usr/local/share/GeoIP2/.geoipupdate.lock
github.com/maxmind/geoipupdate/pkg/geoipupdate/database.CreateLockFile
        /usr/local/src/github.com/maxmind/geoipupdate/pkg/geoipupdate/database/writer.go:41
github.com/maxmind/geoipupdate/pkg/geoipupdate/database.NewLocalFileDatabaseWriter
        /usr/local/src/github.com/maxmind/geoipupdate/pkg/geoipupdate/database/local_file_writer.go:41
main.run
        /usr/local/src/github.com/maxmind/geoipupdate/cmd/geoipupdate/main.go:65
main.main
        /usr/local/src/github.com/maxmind/geoipupdate/cmd/geoipupdate/main.go:48
runtime.main
        /usr/lib64/go/1.13/src/runtime/proc.go:203
runtime.goexit
        /usr/lib64/go/1.13/src/runtime/asm_amd64.s:1357
error creating database writer
main.run
        /usr/local/src/github.com/maxmind/geoipupdate/cmd/geoipupdate/main.go:67
main.main
        /usr/local/src/github.com/maxmind/geoipupdate/cmd/geoipupdate/main.go:48
runtime.main
        /usr/lib64/go/1.13/src/runtime/proc.go:203
runtime.goexit
        /usr/lib64/go/1.13/src/runtime/asm_amd64.s:1357

Support for CSV file format following license change

Following recent license change, we can no longer simply download DB over HTTP.

We have generated new license key. As of now, geoipupdate explicitly does not support .csv file format and trying to use it will fail with HTTP 404 Error.

~$ tail -n 1 GeoIP.conf
EditionIDs GeoLite2-City-CSV
~$ geoipupdate -f GeoIP.conf -d "."
error retrieving updates: error retrieving filename: unexpected HTTP status code: 404 Not Found: Database edition not found

On the other hand, it is not clear how to use generated key and token to download DB over HTTP, skipping geoipupdate tool. Downloading from browser I will get url that look like that 'https://download.maxmind.com/app/geoip_download_by_token?edition_id=GeoLite2-City-CSV&date=20191231&token=v2.local.***&suffix=zip' . So we are using token (paseto?).

Is there either

  1. a documented way to convert AccountID + GeoLite2-City into a token=v2.local.***
  2. a plan to add CSV support for geoipdate

or do we need to migrate our scripts to mmdb format?

Best regards,

Majus Misiak

Manpage formatting issues

The manpages right now have a top-section of e.g. GEOIPUPDATE, and all of their sections being level-two headers (offset by 1). In groff, the headers are all .SS (e.g. .SS NAME), with a top-level .SH GEOIPUPDATE, rather than all of them being .SS. In Markdown, it's # GEOIPUPDATE, and ## NAME, rather than just # NAME.

Unfortunately I couldn't find a pandoc option to shift this by one, so perhaps this manipulation should be done in dev-bin/make-man-pages.pl. Essentially, this could do s/^# .*//;s/^##/#/.

Separately, the formatting of some of the options is very un-man-like. The argument descriptions are not in a separate, indented paragraph, there is little bolding etc. pandoc's own manpage employs some of that and could serve as inspiration here perhaps?

geoipupdate is not free anymore ?

Hello ,
When i run the geoipupdate command to update the database i got error : error retrieving updates: unexpected HTTP status code: 401 Unauthorized: An account ID and license key are required to use this service.

Is this service become paid or what ??

the content of /etc/GeoIP.conf file is :

# Please see https://dev.maxmind.com/geoip/geoipupdate/ for instructions
# on setting up geoipupdate, including information on how to download a
# pre-filled GeoIP.conf file.

# Enter your account ID and license key below. These are available from
# https://www.maxmind.com/en/my_license_key. If you are only using free
# GeoLite databases, you may leave the 0 values.
AccountID 0
LicenseKey 000000000000

# Enter the edition IDs of the databases you would like to update.
# Multiple edition IDs are separated by spaces.
EditionIDs GeoLite2-Country

# The remaining settings are OPTIONAL.

# The directory to store the database files. Defaults to /usr/share/GeoIP
# DatabaseDirectory /usr/share/GeoIP

# The server to use. Defaults to "updates.maxmind.com".
# Host updates.maxmind.com

# The proxy host name or IP address. You may optionally specify a
# port number, e.g., 127.0.0.1:8888. If no port number is specified, 1080
# will be used.
# Proxy 127.0.0.1:8888

# The user name and password to use with your proxy server.
# ProxyUserPassword username:password

# Whether to preserve modification times of files downloaded from the server.
# Defaults to "0".
# PreserveFileTimes 0

# The lock file to use. This ensures only one geoipupdate process can run at a
# time.
# Note: Once created, this lockfile is not removed from the filesystem.
# Defaults to ".geoipupdate.lock" under the DatabaseDirectory.
# LockFile /usr/share/GeoIP/.geoipupdate.lock

error creating database writer

hello,
when trying to run geoipupdate I get the error:
error retrieving updates: error creating database writer: database directory is not available: stat /usr/local/share/GeoIP: no such file or directory

the version I use is: geoipupdate 4.1.0 and I have an updated account

Thanks

GeoLite2 Automatic Update Questions

I have some question for GeoLite2 Automatic Update

  • Can GeoLite2 use for Automatic Update ?
  • If GeoLite2 can Automatic Update , when I type geoipupdate ,console printed
database_info  FAIL null
Received Error -21 (Sanity check database_info string failed) when attempting to update GeoIP Database

Now , could you answer these for me ,Thanks !
Waiting online.......

geoipupdate error 21

When I am executing the geoipupdate command, I am getting the below error-
Writing uncompressed data to /usr/share/GeoIP/GeoIP.dat ...Performing sanity checks ... database_info FAIL
Received Error -21 (Sanity check database_info string failed) when attempting to update GeoIP Database

Developer tests are dumped on end-users

The Makefile includes:

  go fmt ./...
  golangci-lint run
  go test ./...

Those are for you, the upstream developers, and belong in a test target. It's not useful for end-users to reformat or lint the source files, nor to expect that they have golangci-lint installed.

E: Unable to locate package geoipupdate

i run the apt-get install -y geoipupdate command in docker and received this error :

Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package geoipupdate

why this error happen?

centos 7 crash

linux_amd64 release totally crashes the centos 7 AMI on amazon. I couldn't manage to collect any logs since the server became unresposive and we couldnt even manage to restart the instance.

the server crashes within an hour after we add this repo.

we are building our server via ansible and we removed the yum install step of geoipupdate and the server crashes totally stopped.

Using geoipupdate pkg from another go application

I want to use https://github.com/maxmind/geoipupdate/tree/master/pkg/geoipupdate infrastructure in my application which is using MaxMind for geo IP detection. Since the latest changes, I need to integrate it with your authorization mechanism to be able to let users to use the application UX.

Is there a way to add geoipupdate as a go mod dependency to my project?

So far I have tried to execute:

go get -u github.com/maxmind/geoipupdate

But I get the following error during go run main.go:

build command-line-arguments: cannot load github.com/maxmind/geoipupdate/pkg/geoipupdate: module github.com/maxmind/geoipupdate@latest found (v4.0.2+incompatible), but does not contain package github.com/maxmind/geoipupdate/pkg/geoipupdate

After go get my go.mod file was added by the following line:

github.com/maxmind/geoipupdate v4.0.2+incompatible // indirect

Seems like geoipupdate application is not really ready to be used as a pkg. Can you please anble this for projects like mine?

ASN database not loading/updating

I am trying to install the ASN database listed here: https://dev.maxmind.com/geoip/geoip2/geolite2/

I have the following in my GeoIP.conf file:

AccountID 0
LicenseKey 000000000000
EditionIDs GeoLite2-City GeoLite2-Country GeoLite2-ASN

I then run sudo /usr/bin/geoipupdate but the ASN database does not get installed nor do i get any errors. The City and Country databases install fine. Am I missing something?

Old version was removed o_O

Why have you removed 3.1.1 version? There are a lot of Dockerfiles which has command that download this version of release and install it.
Please, don't do this in future. Old version must be existed at least 1 year after new major version.

How to upgrade it to myself dbs

i want to change some the ip source from the ASN, but i don't know the way to unzip the mmdb and add my items then press it to the style of mmdb .

as the short i said is that i want to add some my owning items, how can i do it ..help.thank you,

Docker: healthcheck

Hi, it would be nice to add a HEALTHCHECK statement or an endpoint API that returns 200 to the image. So that docker understands that the container is working.

lock file not being removed after geoipupdate

After successful run of geoipupdate the lock file .geoipupdate.lock remains at the configured location. IMHO it would be nicer to remove the lock file after successful update, to prevent cluttering the file system. Or is there any reason to keep the file?

from source doesn't work anymore :(

$ go get -u github.com/maxmind/geoipupdate/v4/cmd/geoipupdate
package github.com/maxmind/geoipupdate/v4/cmd/geoipupdate: cannot find package "github.com/maxmind/geoipupdate/v4/cmd/geoipupdate" in any of:
/usr/lib/go/src/github.com/maxmind/geoipupdate/v4/cmd/geoipupdate (from $GOROOT)
/home/admin/go/src/github.com/maxmind/geoipupdate/v4/cmd/geoipupdate (from $GOPATH)

but it's workin) 👍
$ go get -u github.com/maxmind/geoipupdate/cmd/geoipupdate

Documentation: adjust RPM command to autoupgrade and provide verbosity

Please adjust the RPM command on the Installation portion of the README.md file so that it uses the following flags which:

  1. upgrade if already installed
  2. provide some progress indicators while installing/upgrading
rpm -Uvhi https://github.com/maxmind/geoipupdate/releases/download/v4.2.2/geoipupdate_4.2.2_linux_amd64.rpm

CSV-files can not be updated using geoipupdate

It is not possible to use geoipupdate.exe for updating the CSV-files.

When entering the ID's for CSV-files in the config-file the execution of geoipupdate finishes with an error:

error retrieving updates: error retrieving filename: unexpected HTTP status code: 404 Not Found: Database edition not found

Below the execution of geoipupdate for the databases

PS D:\Eigene Dateien\_Downloads\Internet\Analyse\GeoIP\geoipupdate> .\geoipupdate.exe -v -f .\GeoIP.conf
Using config file .\GeoIP.conf
Using database directory ..\DATADIR
Performing get filename request to https://updates.maxmind.com/app/update_getfilename?product_id=GeoLite2-ASN-CSV
error retrieving updates: error retrieving filename: unexpected HTTP status code: 404 Not Found: Database edition not found
PS D:\Eigene Dateien\_Downloads\Internet\Analyse\GeoIP\geoipupdate>

using this GeoIP.conf file

# GeoIP.conf file for `geoipupdate` program, for versions >= 3.1.1.
# Used to update GeoIP databases from https://www.maxmind.com.
# For more information about this config file, visit the docs at
# https://dev.maxmind.com/geoip/geoipupdate/.

# `AccountID` is from your MaxMind account.
AccountID myPersonalID

# `LicenseKey` is from your MaxMind account
LicenseKey myLicenceKey

# `EditionIDs` is from your MaxMind account.
#EditionIDs GeoLite2-ASN GeoLite2-City GeoLite2-Country
EditionIDs GeoLite2-ASN-CSV GeoLite2-City-CSV GeoLite2-Country-CSV
# EditionIDs GeoLite2-ASN-CSV GeoLite2-City-CSV GeoLite2-Country-CSV

# Database Directory
DatabaseDirectory ..\DATADIR

# Preserver modification times of files
PreserveFileTimes 1

Then the same for the CSV-files

PS D:\Eigene Dateien\_Downloads\Internet\Analyse\GeoIP\geoipupdate> .\geoipupdate.exe -v -f .\GeoIP.conf
Using config file .\GeoIP.conf
Using database directory ..\DATADIR
Performing get filename request to https://updates.maxmind.com/app/update_getfilename?product_id=GeoLite2-ASN
Acquired lock file lock (..\DATADIR\.geoipupdate.lock)
Calculated MD5 sum for ..\DATADIR\GeoLite2-ASN.mmdb: 8b19690ec6c8091c9f7ae0bc3b739aa1
Performing update request to https://updates.maxmind.com/geoip/databases/GeoLite2-ASN/update?db_md5=8b19690ec6c8091c9f7ae0bc3b739aa1
No new updates available for GeoLite2-ASN
Performing get filename request to https://updates.maxmind.com/app/update_getfilename?product_id=GeoLite2-City
Acquired lock file lock (..\DATADIR\.geoipupdate.lock)
Calculated MD5 sum for ..\DATADIR\GeoLite2-City.mmdb: b8065014eaa7cc763da5cbf5c66a276b
Performing update request to https://updates.maxmind.com/geoip/databases/GeoLite2-City/update?db_md5=b8065014eaa7cc763da5cbf5c66a276b
No new updates available for GeoLite2-City
Performing get filename request to https://updates.maxmind.com/app/update_getfilename?product_id=GeoLite2-Country
Acquired lock file lock (..\DATADIR\.geoipupdate.lock)
Calculated MD5 sum for ..\DATADIR\GeoLite2-Country.mmdb: 99a0e26a26a11f29c90111702964f04f
Performing update request to https://updates.maxmind.com/geoip/databases/GeoLite2-Country/update?db_md5=99a0e26a26a11f29c90111702964f04f
No new updates available for GeoLite2-Country
PS D:\Eigene Dateien\_Downloads\Internet\Analyse\GeoIP\geoipupdate>

with this GeoIP.conf file

# GeoIP.conf file for `geoipupdate` program, for versions >= 3.1.1.
# Used to update GeoIP databases from https://www.maxmind.com.
# For more information about this config file, visit the docs at
# https://dev.maxmind.com/geoip/geoipupdate/.

# `AccountID` is from your MaxMind account.
AccountID myPersonalID

# `LicenseKey` is from your MaxMind account
LicenseKey myLicenceKey

# `EditionIDs` is from your MaxMind account.
EditionIDs GeoLite2-ASN GeoLite2-City GeoLite2-Country
#EditionIDs GeoLite2-ASN-CSV GeoLite2-City-CSV GeoLite2-Country-CSV
# EditionIDs GeoLite2-ASN-CSV GeoLite2-City-CSV GeoLite2-Country-CSV

# Database Directory
DatabaseDirectory ..\DATADIR

# Preserver modification times of files
PreserveFileTimes 1

NOTE: It's ok that there is no retrieval of data as I have executed the procedure during testing already several times!

When I used the update command, the program reported an error

Here is my configuration file:
`# 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 GeoLite2-Country`

When I execute the command: geoipupdate, the following error is prompted:
MD5 Digest of installed database is 2d2203d8938c35f4ea65e03ec15ad1f5
Received Error -21 (Sanity check database_info string failed) when attempting to update GeoIP Database

CentOS 7: geoipupdate conflicts GeoIP

It is not possible to install geoipupdate-4.1.5 on CentOS7 as it conflicts with GeoIP - which is a dependency of crucial core networking tools such as bind-utils:

Transaction check error:
  file /usr/share/GeoIP conflicts between attempted installs of GeoIP-1.5.0-14.el7.x86_64 and geoipupdate-4.1.5-1.x86_64

Cut a new release version

There have been substantial updates made to the code base since 4.0.6. A new version should be made to reflect this, possibly incrementing to version 4.1.0.

db update intermittently fails but works later

We are running a cronjob every day at 00:00 EST (-4) to update our geoip databases. Every so often (about once in a several weeks) the update fails. When we arrive in the office in the morning, we run the update again and it runs with no problem.

To discover what was happening we implemented logging for the cronjob and found the following error:

Performing get filename request to https://updates.maxmind.com/app/update_getfilename?product_id=GeoIP2-ISP
Calculated MD5 sum for /usr/share/GeoIP/GeoIP2-ISP.mmdb: c1db9ae9d1fecdec284046ff94486a02
Performing update request to https://updates.maxmind.com/geoip/databases/GeoIP2-ISP/update?db_md5=c1db9ae9d1fecdec284046ff94486a02
Error retrieving updates: stream error: stream ID 23; INTERNAL_ERROR
error reading/writing
main.writeAndCheck
	/go/src/github.com/maxmind/geoipupdate2/cmd/geoipupdate/main.go:373
main.maybeUpdate
	/go/src/github.com/maxmind/geoipupdate2/cmd/geoipupdate/main.go:322
main.updateEdition
	/go/src/github.com/maxmind/geoipupdate2/cmd/geoipupdate/main.go:161
main.run
	/go/src/github.com/maxmind/geoipupdate2/cmd/geoipupdate/main.go:139
main.main
	/go/src/github.com/maxmind/geoipupdate2/cmd/geoipupdate/main.go:49
runtime.main
	/usr/local/go/src/runtime/proc.go:198
runtime.goexit
	/usr/local/go/src/runtime/asm_amd64.s:2361
error updating
error updating GeoIP2-ISP

The relevant command being used is:
/usr/bin/geoipupdate --stack-trace --verbose >&2 2>/var/log/geoip_update.log

The full cronjob line is:
00 00 * * * root TS=$(/bin/date +\%s) && (/usr/bin/geoipupdate --stack-trace --verbose >&2 2>/var/log/geoip_update.log) && /bin/echo "$?|$(/bin/date +\%s)|$TS" | /usr/bin/tee /tmp/geoip_update.monitor

Executables are not statically linked

Not sure if this is on purpose but executables are dynamically linked so they are not working on some distribs like Alpine Linux for example (we also loose portability btw).

$ ldd geoipupdate
        /lib64/ld-linux-x86-64.so.2 (0x7fbc2a16c000)
        libpthread.so.0 => /lib64/ld-linux-x86-64.so.2 (0x7fbc2a16c000)
        libc.so.6 => /lib64/ld-linux-x86-64.so.2 (0x7fbc2a16c000)

Can you provide statically linked executables instead?

Thanks

geoupdate binary error

I'm trying run geoipupdate_4.0.6_linux_amd64 on the below given OS , Red Hat Enterprise Linux Server release 5.5 (Tikanga) ,getting the below error
Start- Update the geoIP maxmind Database file
Using config file /apps/xxx/geoipupdate_4.0.6_linux_amd64/GeoIP.conf
Using database directory /data/xxx/xxx/geoip
runtime: epollwait on fd 4 failed with 38
fatal error: runtime: netpoll failed

runtime stack:
runtime.throw(0x70682d, 0x17)
/usr/local/go/src/runtime/panic.go:617 +0x72
runtime.netpoll(0x15eb47f3e4d48d00, 0x0)
/usr/local/go/src/runtime/netpoll_epoll.go:75 +0x209
runtime.sysmon()
/usr/local/go/src/runtime/proc.go:4326 +0x374
runtime.mstart1()
/usr/local/go/src/runtime/proc.go:1206 +0xc4
runtime.mstart()
/usr/local/go/src/runtime/proc.go:1172 +0x6f

goroutine 1 [syscall]:
syscall.Syscall(0x49, 0x3, 0x6, 0x0, 0xc000092050, 0x0, 0x0)
/usr/local/go/src/syscall/asm_linux_amd64.s:18 +0x5
syscall.Flock(0x3, 0x6, 0x0, 0x666f53)
/usr/local/go/src/syscall/zsyscall_linux_amd64.go:439 +0x4b
github.com/gofrs/flock.(*Flock).try(0xc000096440, 0xc000096470, 0x2, 0xc0000b3f00, 0x0, 0x0)
/home/greg/MaxMind/go/pkg/mod/github.com/gofrs/[email protected]/flock_unix.go:149 +0xe5
github.com/gofrs/flock.(*Flock).TryLock(...)
/home/greg/MaxMind/go/pkg/mod/github.com/gofrs/[email protected]/flock_unix.go:118
main.setup(0xc0000f43f0, 0x1, 0xc0000b3f78, 0x1, 0x1) /home/greg/MaxMind/go/src/github.com/maxmind/geoipupdate/cmd/geoipupdate/main.go:78 +0xc5
main.main()
/home/greg/MaxMind/go/src/github.com/maxmind/geoipupdate/cmd/geoipupdate/main.go:39 +0xad
Null message body; hope that's ok....

Please advice am I missing something or is it a issue with OS

How to overwrite GeoIP DB

I don't know where I can ask this question. My company has been buying GeoIP Legacy Databases for our business. But we need to overwrite some subnet addresses at this time for our solution due to the changing business. So how to overwrite GeoIP DB? Or could you provide API for your customers can easier change GeoIP DB? thank you, guys!

Refactor the package to be a consumable library

My team is currently trying to use this package, but we need it to integrate with our existing Go packages. I recommend restructuring the package so it can be run as either a CLI tool or as a consumable library.

Error on update

When trying to update database:

/root/go/bin/geoipupdate   
Error loading configuration file: unknown option on line 2

My config file is a default:

# 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 GeoLite2-Country

Sync error running on Windows

It seems to actually be updating but at the end of every download there is the following error: "error syncing database directory". Running again and it will download the next DB with the same error. My guess is if there are any updates, the error will pop again.

First run

C:\Program Files\geoipupdate>geoipupdate.exe --stack-trace --verbose
Using config file C:\ProgramData\MaxMind\GeoIPUpdate\GeoIP.conf
Using database directory C:\ProgramData\MaxMind\GeoIPUpdate\GeoIp\
Acquired lock file lock (C:\ProgramData\MaxMind\GeoIPUpdate\GeoIp\.geoipupdate.lock)
Performing get filename request to https://updates.maxmind.com/app/update_getfilename?product_id=GeoLite2-Country
Not calculating MD5 sum as file does not exist: C:\ProgramData\MaxMind\GeoIPUpdate\GeoIp\GeoLite2-Country.mmdb
Performing update request to https://updates.maxmind.com/geoip/databases/GeoLite2-Country/update?db_md5=00000000000000000000000000000000
Error retrieving updates: sync C:\ProgramData\MaxMind\GeoIPUpdate\GeoIp\: The handle is invalid.
error syncing database directory
main.writeAndCheck
        /home/greg/MaxMind/go/src/github.com/maxmind/geoipupdate/cmd/geoipupdate/main.go:426
main.maybeUpdate
        /home/greg/MaxMind/go/src/github.com/maxmind/geoipupdate/cmd/geoipupdate/main.go:322
main.updateEdition
        /home/greg/MaxMind/go/src/github.com/maxmind/geoipupdate/cmd/geoipupdate/main.go:161
main.run
        /home/greg/MaxMind/go/src/github.com/maxmind/geoipupdate/cmd/geoipupdate/main.go:139
main.main
        /home/greg/MaxMind/go/src/github.com/maxmind/geoipupdate/cmd/geoipupdate/main.go:49
runtime.main
        /usr/local/go/src/runtime/proc.go:201
runtime.goexit
        /usr/local/go/src/runtime/asm_amd64.s:1333
error updating
error updating GeoLite2-Country

Second run

C:\Program Files\geoipupdate>geoipupdate.exe --stack-trace --verbose
Using config file C:\ProgramData\MaxMind\GeoIPUpdate\GeoIP.conf
Using database directory C:\ProgramData\MaxMind\GeoIPUpdate\GeoIp\
Acquired lock file lock (C:\ProgramData\MaxMind\GeoIPUpdate\GeoIp\.geoipupdate.lock)
Performing get filename request to https://updates.maxmind.com/app/update_getfilename?product_id=GeoLite2-Country
Calculated MD5 sum for C:\ProgramData\MaxMind\GeoIPUpdate\GeoIp\GeoLite2-Country.mmdb: ac629fd5389cd83d06006572b8bdb23f
Performing update request to https://updates.maxmind.com/geoip/databases/GeoLite2-Country/update?db_md5=ac629fd5389cd83d06006572b8bdb23f
No new updates available for GeoLite2-Country
Performing get filename request to https://updates.maxmind.com/app/update_getfilename?product_id=GeoLite2-City
Not calculating MD5 sum as file does not exist: C:\ProgramData\MaxMind\GeoIPUpdate\GeoIp\GeoLite2-City.mmdb
Performing update request to https://updates.maxmind.com/geoip/databases/GeoLite2-City/update?db_md5=00000000000000000000000000000000
Error retrieving updates: sync C:\ProgramData\MaxMind\GeoIPUpdate\GeoIp\: The handle is invalid.
error syncing database directory
main.writeAndCheck
        /home/greg/MaxMind/go/src/github.com/maxmind/geoipupdate/cmd/geoipupdate/main.go:426
main.maybeUpdate
        /home/greg/MaxMind/go/src/github.com/maxmind/geoipupdate/cmd/geoipupdate/main.go:322
main.updateEdition
        /home/greg/MaxMind/go/src/github.com/maxmind/geoipupdate/cmd/geoipupdate/main.go:161
main.run
        /home/greg/MaxMind/go/src/github.com/maxmind/geoipupdate/cmd/geoipupdate/main.go:139
main.main
        /home/greg/MaxMind/go/src/github.com/maxmind/geoipupdate/cmd/geoipupdate/main.go:49
runtime.main
        /usr/local/go/src/runtime/proc.go:201
runtime.goexit
        /usr/local/go/src/runtime/asm_amd64.s:1333
error updating
error updating GeoLite2-City

Third run

C:\Program Files\geoipupdate>geoipupdate.exe --stack-trace --verbose
Using config file C:\ProgramData\MaxMind\GeoIPUpdate\GeoIP.conf
Using database directory C:\ProgramData\MaxMind\GeoIPUpdate\GeoIp\
Acquired lock file lock (C:\ProgramData\MaxMind\GeoIPUpdate\GeoIp\.geoipupdate.lock)
Performing get filename request to https://updates.maxmind.com/app/update_getfilename?product_id=GeoLite2-Country
Calculated MD5 sum for C:\ProgramData\MaxMind\GeoIPUpdate\GeoIp\GeoLite2-Country.mmdb: ac629fd5389cd83d06006572b8bdb23f
Performing update request to https://updates.maxmind.com/geoip/databases/GeoLite2-Country/update?db_md5=ac629fd5389cd83d06006572b8bdb23f
No new updates available for GeoLite2-Country
Performing get filename request to https://updates.maxmind.com/app/update_getfilename?product_id=GeoLite2-City
Calculated MD5 sum for C:\ProgramData\MaxMind\GeoIPUpdate\GeoIp\GeoLite2-City.mmdb: 7d13975dea70fc9c13f8ce9d4acf6760
Performing update request to https://updates.maxmind.com/geoip/databases/GeoLite2-City/update?db_md5=7d13975dea70fc9c13f8ce9d4acf6760
No new updates available for GeoLite2-City

Running Windows 10 x64
geoipupdate 4.0.2

FreeBSD

Hi

how to install this on FreeBSD ?

update error

hi,dear
I paied for GeoIP2-Country update products. But it not work.

Question 1:

I create a new server (ubuntu)
and install geoipupdate with apt ppa

my conf file

GeoIP.conf file for geoipupdate program, for versions >= 3.1.1.

Used to update GeoIP databases from https://www.maxmind.com.

For more information about this config file, visit the docs at

https://dev.maxmind.com/geoip/geoipupdate/.

AccountID is from your MaxMind account.

AccountID 143***

Replace YOUR_LICENSE_KEY_HERE with an active license key associated

with your MaxMind account.

LicenseKey 2sI*******m95m5w

EditionIDs is from your MaxMind account.

EditionIDs GeoIP2-Country

I try to run:

geoipupdate -v -f /usr/local/etc/GeoIP.conf

ERRORS:

Using config file /usr/local/etc/GeoIP.conf
Using database directory /usr/share/GeoIP
Acquired lock file lock (/usr/share/GeoIP/.geoipupdate.lock)
Performing get filename request to https://updates.maxmind.com/app/update_getfilename?product_id=GeoIP2-Country
Not calculating MD5 sum as file does not exist: /usr/share/GeoIP/GeoIP2-Country.mmdb
Performing update request to https://updates.maxmind.com/geoip/databases/GeoIP2-Country/update?db_md5=00000000000000000000000000000000
Error retrieving updates: error updating GeoIP2-Country: error updating: unexpected HTTP status code: 403 Forbidden: You do not have permission to use this service interface

question2:

the same conf file
try to run:

geoipupdate -v -f /usr/local/etc/GeoIP.conf

ERRORS:

Opened License file /usr/local/etc/GeoIP.conf
Read in license key 4HqaPP****m0
number of product ids 0
%s can't be opened, proceeding to download database
/usr/local/share/GeoIP/GeoIP.datConnecting to MaxMind GeoIP Update server
via Host or Proxy Server: updates.maxmind.com:80
Downloading gzipped GeoIP Database...
Done
Saving gzip file to /usr/local/share/GeoIP/GeoIP.dat.gz ... Done
Uncompressing gzip file ... Done
Writing uncompressed data to /usr/local/share/GeoIP/GeoIP.dat ...Performing santity checks ... database_info FAIL
Received Error -21 (Sanity check database_info string failed) when attempting to update GeoIP Database

Thank U

Exit status code

This command doesn't appear to have a differing status code, depending on if it updated the database(s) or not. It would be good to return something different so a cron job statement could chain restarting services ONLY if the databases were updated.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.