maxmind / geoipupdate-legacy Goto Github PK
View Code? Open in Web Editor NEWGeoIP update client code
License: GNU General Public License v2.0
GeoIP update client code
License: GNU General Public License v2.0
I have a cron running as root that's supposed to check for updates everyday however all the new downloads are available but the actual renaming fails with the error
geoipupdate 2.5.0
Opened License file /tmp/GeoIP.conf
AccountID 0
LicenseKey 000000000000
Insert edition_id GeoLite2-City
Insert edition_id GeoLite2-ASN
Read in license key /tmp/GeoIP.conf
Number of edition IDs 2
Uncompress file /data/GeoLite2-City.mmdb.gz to /data/GeoLite2-City.mmdb.test
Rename /data/GeoLite2-City.mmdb.test to /data/GeoLite2-City.mmdb
Rename /data/GeoLite2-City.mmdb.test to /data/GeoLite2-City.mmdb failed
I couldn't find a better place to post this issue. When using the perl version of GeoIP, there's the handy geolite-mirror-simple.pl script that keeps the database files up-to-date in a bandwidth efficient way. Good for me, and good for your server.
Now I use node.js and a couple different GeoIP modules and needed something to keep the local databases updated, so I made a node.js port of the perl script called maxmind-geolite-mirror. It's on npm now, and you're welcome to link to, share, or even take ownership of it.
A direct link to the script. It uses only node.js built-ins so there's no dependencies.
I noticed this in production, and it seem like this behavior doesn't match the intended behavior of releasing the lockfile after geoipupdate
finishes.
> docker run -i -t ubuntu /bin/bash
root@dd7e263d706c:/# apt-get update && apt-get install aptitude software-properties-common python-software-properties && add-apt-repository ppa:maxmind/ppa && aptitude update && aptitude install geoipupdate
root@dd7e263d706c:/# geoipupdate
root@dd7e263d706c:/# echo $?
0
root@dd7e263d706c:/# ls -al /usr/share/GeoIP/
total 53344
drwxr-xr-x 2 root root 4096 Nov 1 19:53 .
drwxr-xr-x 1 root root 4096 Nov 1 19:53 ..
-rw------- 1 root root 0 Nov 1 19:53 .geoipupdate.lock
-rw-r--r-- 1 root root 51469823 Nov 1 19:53 GeoLite2-City.mmdb
-rw-r--r-- 1 root root 3143664 Nov 1 19:53 GeoLite2-Country.mmdb
Based on the PR that introduced this behavior (maxmind/geoipupdate#55), it seems that the lockfile should be automatically cleaned up upon a successful exit. That is not the behavior I'm seeing.
Since strnlen() is still a youngster (2008 POSIX) it is not implemented in some operating systems which are in active use (MacOS X 10.6, Solaris 10, FreeBSD 8, etc.) so the recent addition of one use of it (bin/geoipupdate.c line 593) makes the current version of geoipupdate unbuildable on such systems. See bash or ghostscript for examples of how to deal with strlen() being unavailable.
We would like to use "geoipupdate-2.4.0/bin/geoipupdate-pureperl.pl" for automatic updates
The Perl script depends on PerlIO::gzip and when I run on RHEL 6.9 fails with:
Can't locate PerlIO/gzip.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at /usr/local/bin/geoipupdate.pl line 52. BEGIN failed--compilation aborted at /usr/local/bin/geoipupdate.pl line 52.
However, the gzip module is installed:
$ find /usr/ -iname gzip.pm
/usr/lib64/perl5/IO/Compress/Gzip.pm
and
$ sudo yum whatprovides 'perl(IO::Uncompress::Gunzip)'
Loaded plugins: product-id, rhnplugin, search-disabled-repos, security, subscription-manager
This system is receiving updates from RHN Classic or RHN Satellite.
rhel-x86_64-server-6
...
perl-IO-Compress-Zlib-2.021-144.el6.x86_64 : Perl interface to allow reading and writing of gzip and zip data
Repo : installed
Matched from:
Other : Provides-match: perl(IO::Uncompress::Gunzip)
Changing the use statement in the Perl script from PerlIO::gzip to use IO::Uncompress::Gunzip;
appears to fix the issue.
I ran ./bootstrap and I am getting following issue.
autoreconf: Entering directory `.'
autoreconf: configure.ac: not using Gettext
autoreconf: running: aclocal --force
autoreconf: configure.ac: tracing
autoreconf: configure.ac: not using Libtool
autoreconf: running: /usr/local/Cellar/autoconf/2.69/bin/autoconf --force
configure.ac:12: error: possibly undefined macro: AC_PROG_LIBTOOL
If this token and others are legitimate, please use m4_pattern_allow.
See the Autoconf documentation.
autoreconf: /usr/local/Cellar/autoconf/2.69/bin/autoconf failed with exit status: 1
Hi,
I am getting the following error:
I am using the latest version from the GIT on centos.
Please let me know how to fix it. Thanks
Just a quick question about the .dat files that the updater downloaded...
Output:
MD5 Digest of installed database is 1e43a1a5c531cc8e11fb4f83a1c0ec7a
/usr/share/GeoIP/GeoLiteCountry.dat is up to date, no updates required
GeoIP Database up to date
MD5 Digest of installed database is 0637ec47d9b4d8107d32e94c35f7f311
/usr/share/GeoIP/GeoLiteCity.dat is up to date, no updates required
GeoIP Database up to date
The .dat file that was downloaded/updated... is that the same format as the "mmdb" file?
on CentOS 6.6
downloaded and extracted the latest bootstrapped source, then
#./configure
#make
#make install
execute
$/usr/local/bin/geoipupdate
but prompts
/usr/local/share/GeoIP does not exist
a simple
$mkdir /usr/local/share/GeoIP
fixes the problem, perhaps it can be automatically created to avoid such issues?
thanks.
For packaging purposes it's considered an example and therefore documentation, not a config file. Some distro packaging guidelines require README_, LICENSE_, ChangeLog, Examples/, etc. to be installed into $(docdir) instead.
OS X 10.6 and older do not provide the "getline" function which is used in geoipupdate.c.
The usual approach is to detect this at configure time and provide some kind of fallback implementation.
I don't use this software myself, but a Homebrew user on 10.6 reported the issue: Homebrew/legacy-homebrew#25865
Please consider supporting GeoLite2-ASN.tar.gz as it is available:
https://dev.maxmind.com/geoip/geoip2/geolite2/
Thanks.
Trying to run ./configure and I get the following error
bash: ./configure: No such file or directory
I've installed all the relevant dependencies. I can't seem to find the ./configure file in the root of the repo.
Any ideas?
At least the geoipupdate-2.1.0.tar.gz file doesn't:
$ tar ztvf ../geoipupdate-2.1.0.tar.gz | sort
drwxrwxr-x 1000/1000 0 2014-11-06 14:50 geoipupdate-2.1.0/
drwxrwxr-x 1000/1000 0 2014-11-06 14:50 geoipupdate-2.1.0/bin/
drwxrwxr-x 1000/1000 0 2014-11-06 14:50 geoipupdate-2.1.0/conf/
drwxrwxr-x 1000/1000 0 2014-11-06 14:50 geoipupdate-2.1.0/man/
-rw-r--r-- 1000/1000 1063 2014-02-07 08:09 geoipupdate-2.1.0/bin/product_s.c
-rw-r--r-- 1000/1000 1204 2014-02-07 08:09 geoipupdate-2.1.0/conf/GeoIP.conf.default
-rw-r--r-- 1000/1000 1208 2014-05-02 09:28 geoipupdate-2.1.0/README.md
-rw-r--r-- 1000/1000 1426 2014-11-06 14:48 geoipupdate-2.1.0/configure.ac
-rw-r--r-- 1000/1000 152 2014-05-02 09:13 geoipupdate-2.1.0/Makefile.am
-rw-r--r-- 1000/1000 1716 2014-06-02 10:32 geoipupdate-2.1.0/man/GeoIP.conf.5.in
-rw-r--r-- 1000/1000 283686 2014-11-06 14:49 geoipupdate-2.1.0/ltmain.sh
-rw-r--r-- 1000/1000 327 2014-05-02 09:17 geoipupdate-2.1.0/bin/Makefile.am
-rw-r--r-- 1000/1000 561 2014-05-02 09:19 geoipupdate-2.1.0/conf/Makefile.am
-rw-r--r-- 1000/1000 781 2014-05-02 09:19 geoipupdate-2.1.0/man/Makefile.am
-rw-rw-r-- 1000/1000 1264 2014-10-21 08:06 geoipupdate-2.1.0/bin/geoipupdate.h
-rw-rw-r-- 1000/1000 1265 2014-10-21 08:06 geoipupdate-2.1.0/bin/md5.h
-rw-rw-r-- 1000/1000 14565 2014-11-06 14:49 geoipupdate-2.1.0/conf/Makefile.in
-rw-rw-r-- 1000/1000 1487 2014-11-06 14:47 geoipupdate-2.1.0/ChangeLog.md
-rw-rw-r-- 1000/1000 17267 2014-11-06 14:49 geoipupdate-2.1.0/man/Makefile.in
-rw-rw-r-- 1000/1000 17813 2014-11-06 14:48 geoipupdate-2.1.0/bin/geoipupdate.c
-rw-rw-r-- 1000/1000 18211 2014-10-21 08:06 geoipupdate-2.1.0/bin/base64.c
-rw-rw-r-- 1000/1000 19655 2014-11-06 14:49 geoipupdate-2.1.0/bin/Makefile.in
-rw-rw-r-- 1000/1000 2094 2014-10-21 08:06 geoipupdate-2.1.0/bin/base64.h
-rw-rw-r-- 1000/1000 2098 2014-04-14 16:11 geoipupdate-2.1.0/man/geoipupdate.1.in
-rw-rw-r-- 1000/1000 24444 2014-11-06 14:49 geoipupdate-2.1.0/Makefile.in
-rw-rw-r-- 1000/1000 351030 2014-11-06 14:49 geoipupdate-2.1.0/aclocal.m4
-rw-rw-r-- 1000/1000 3631 2014-10-21 08:06 geoipupdate-2.1.0/bin/types.h
-rw-rw-r-- 1000/1000 8258 2014-07-22 09:51 geoipupdate-2.1.0/bin/geoipupdate-pureperl.pl
-rw-rw-r-- 1000/1000 9731 2014-10-21 08:06 geoipupdate-2.1.0/bin/md5.c
-rw-rw-r-- 1000/1000 987 2014-10-21 08:06 geoipupdate-2.1.0/bin/geoipupdate_s.c
-rwxrwxr-x 1000/1000 432601 2014-11-06 14:49 geoipupdate-2.1.0/configure
-rwxr-xr-x 1000/1000 13997 2014-11-06 14:49 geoipupdate-2.1.0/install-sh
-rwxr-xr-x 1000/1000 23566 2014-11-06 14:49 geoipupdate-2.1.0/depcomp
-rwxr-xr-x 1000/1000 35837 2014-11-06 14:49 geoipupdate-2.1.0/config.sub
-rwxr-xr-x 1000/1000 42856 2014-11-06 14:49 geoipupdate-2.1.0/config.guess
-rwxr-xr-x 1000/1000 429 2014-02-07 08:09 geoipupdate-2.1.0/bootstrap
-rwxr-xr-x 1000/1000 6872 2014-11-06 14:49 geoipupdate-2.1.0/missing
-rwxr-xr-x 1000/1000 7333 2014-11-06 14:49 geoipupdate-2.1.0/compile
Is this a known issue? It's required for distro packaging.
My program will be reading GeoLite2-Country.mmdb from the location where automatic update has been set, So my question is Will automatic update work and update the file at the same time when my program is reading GeoLite2-Country.mmdb ??
@PostConstruct
public void init()
{
try
{
LOG.info("Trying to load maxmind GeoLite2-Country database...");
final Resource resource = resourceLoader.getResource(FILE + Config.getParameter(DATABASE_PATH));
final File db = resource.getFile();
reader = new DatabaseReader.Builder(db).build();
LOG.info("Maxmind database was loaded successfully.");
}
catch (IOException | NullPointerException e)
{
LOG.error("Error maxmind database reader cound not be initialized. ", e);
}
}
Hi,
Have received below error on geoipupdate while checking ProductIds GEO-134.
Received an unexpected HTTP status code of 404 from https://updates.maxmind.com/app/update_getfilename?product_id=GEO-134
Since updates.maxmind.com does not support HTTP/1.1, curl is unable to use http keepalive and re-use a single TCP connection.
This means a new TCP connection per http request, which breaks the md5 authentication since source ips can change between connections when behind a NAT.
If you ask for databases in the config file that you're not entitled to, the error goes to stdout instead of stderr, so if you've got the update script running in cron and outputting stdout to /dev/null, you don't know that there's a problem.
Hi,
I am on RHEL 7.4 (Maipo). My conf file looks like
AccountID 0
LicenseKey 000000000000
#EditionIDs GeoLite2-Country GeoLite2-City
ProductIds GeoLite2-Country GeoLite2-City
I get following error when i run geoipupdate :
Downloading gzipped GeoIP Database...
Done
Updating /usr/share/GeoIP/GeoLite2-City.mmdb
Saving gzip file to /usr/share/GeoIP/GeoLite2-City.mmdb.gz ... download data to a gz file named /usr/share/GeoIP/GeoLite2-City.mmdb.gz
Done
Uncompressing gzip file ... Done
Performing sanity checks ... Database type is 1
database_info FAIL null
Received Error -21 (Sanity check database_info string failed) when attempting to update GeoIP Database
Reading from other errors people faced while running geoipupdate, i have tried with all version of geoipupdate available on my machine. I tried
"which -a geoipupdate"
and received
/bin/geoipupdate
/usr/bin/geoipupdate
I tried with both of them but still get the specified error.
when my "GeoIP.conf" contains productids , it could download .dat files but never downloaded .mmdb files.
I have spent two days rectifying this problem but failed to do so. Can you please help.
FYI, i have downloaded geoipupdate from (2.5) :
https://github.com/maxmind/geoipupdate/releases/tag/v2.5.0
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.
You seems to have no Windows users since compiling bin/geoipupdate.c
on TDM-gcc 5.1 (Win 8.1), I get:
In file included from f:/MingW32/TDM-gcc/x86_64-w64-mingw32/include/windows.h:71:0,
from f:/MingW32/TDM-gcc/x86_64-w64-mingw32/include/winsock2.h:23,
from f:/Mingw32/src/inet/curl/include/curl/curl.h:62,
from bin/geoipupdate.h:6,
from bin/geoipupdate.c:2:
bin/geoipupdate.c:17:18: error: expected identifier or '(' before numeric constant
static const int ERROR = 1;
^
The fix is easy enough.
Ubuntu 14.04 system clean build
Behind proxy, with http_proxy and https_proxy variables set and tested.
/etc/apt/apt.conf
Acquire::http::Proxy "http://proxy.foo.com:80";
Acquire::https::Proxy "https://proxy.foo.com:80";
Refreshed CA's
$ sudo -E bash
# apt-get install --reinstall ca-certificates
Time to add PPA
# add-apt-repository ppa:maxmind/ppa
Cannot add PPA: 'ppa:maxmind/ppa'.
Please check that the PPA name or format is correct.
I've exhausted the suggestions from various google searches on similar problems.
Also tried:
# add-apt-repository "deb http://ppa.launchpad.net/maxmind/ppa/ubuntu trusty main"
apt-get update
...
Reading package lists... Done
W: GPG error: http://ppa.launchpad.net trusty InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY DE1997DCDE742AFA
Hello,
if using 2.1.0-0+maxmind2trusty from ppa:maxmind/ppa I'm able to get the binaries for geoipupdate without problems in Ubuntu 14.04. Now, if using the latest package (2.2.0-0+maxmind1trusty) I'm only getting the man page and not binaries.
Hi,
I've been trying to download GEO-108 (GeoIP Legacy Country) and GEO-124 (GeoIP Legacy ISP) through geoipupdate.
Here's what my product ids in GeoIP.conf look like :
ProductIds 108 124
However, when I run geoipupdate, I get the following error :
Received an unexpected HTTP status code of 404 from https://updates.maxmind.com/app/update_getfilename?product_id=108
Can you please suggest what I am missing here or if these files are not available via geoipupdate at all?
Thanks and Regards
Added 113 and 124 Ids on the config file but it didnt download
I'm using, GeoIP version 1.5.0-11.el7
from centos 7 base repo, but this may be true for other versions.
[user@my_instance]# /bin/geoipupdate
MD5 Digest of installed database is 9bd9e09797f062ad1b2c6d7bb304141c
/usr/share/GeoIP/GeoLiteCountry.dat is up to date, no updates required
GeoIP Database up to date
MD5 Digest of installed database is 4a9ee59d8621705acb0be340a01b8cf6
/usr/share/GeoIP/GeoLiteCity.dat is up to date, no updates required
GeoIP Database up to date
[user@my_instance]# echo $?
1
The man page mentions:
RETURN CODES
geoipupdate returns 0 on success, 1 on error.
This sort of hurts our attempts to get notified in case geoipupdate fails abnormally. Normally, successful execution, even if nothing was modified, should return 0. Alternatively, we can return a custom code (e.g 2) which will allow users to check for an "unmodified db" or actual errors.
deploy@ip---:~/code/libs$ git clone https://github.com/maxmind/geoipupdate
Cloning into 'geoipupdate'...
deploy@ip---:~/code/libs$ cd geoipupdate/
deploy@ip---:~/code/libs/geoipupdate$ ./bootstrap
./bootstrap: 5: ./bootstrap: autoreconf: not found
In GeoIP.conf
https://github.com/maxmind/geoipupdate/blob/master/conf/GeoIP.conf.default#L19 it says:
# The desired protocol either "https" (default) or "https".
It is saying https twice. So it is not clear whether http
or https
is actually the default. Presumably one of those should not include the s but even reading the source code does not make it clear which s should be removed to me.
Hi.
geoipupdate returns the following when attempting to update the dbs:
MD5 Digest of installed database is ea848ced394c49b704d56b8fe2ace9a3
Updating /usr/share/GeoIP/GeoLite2-City.mmdb
Received Error -21 (Sanity check database_info string failed) when attempting to update GeoIP Database
MD5 Digest of installed database is 5dbabefea1a4789adae4d94e0d9e0835
Updating /usr/share/GeoIP/GeoLite2-Country.mmdb
Received Error -21 (Sanity check database_info string failed) when attempting to update GeoIP Database
MD5 Digest of installed database is ae64717432abaae5545b915c262725f6
/usr/share/GeoIP/GeoLiteCountry.dat is up to date, no updates required
GeoIP Database up to date
MD5 Digest of installed database is 84bc1d643ffbb413df03a12a8e5cd321
/usr/share/GeoIP/GeoLiteASNum.dat is up to date, no updates required
GeoIP Database up to date
MD5 Digest of installed database is 546ed4fbcc42326f02f96fda8be1d8e8
/usr/share/GeoIP/GeoLiteCity.dat is up to date, no updates required
GeoIP Database up to date
Here is my /etc/GeoIP.conf
file:
# The following UserId and LicenseKey are required placeholders:
UserId 999999
LicenseKey 000000000000
# Include one or more of the following ProductIds:
# * GeoLite2-City - GeoLite 2 City
# * GeoLite2-Country - GeoLite2 Country
# * 506 - GeoLite Legacy Country
# * 517 - GeoLite Legacy ASN
# * 533 - GeoLite Legacy City
ProductIds GeoLite2-City GeoLite2-Country 506 517 533
For use with cron it'd be great if geoipupdate exited with a non-zero status if a DB changed so relevant services could be reloaded.
hi,
we're trying to use GeoIP.x86_64, version 1.4.8-1.5.amzn1
it comes as a standard rpm package with latest Amazon Linux AMI (https://aws.amazon.com/amazon-linux-ami/)
config file looks like that:
UserId 999999
LicenseKey 000000000000
ProductIds GeoLite2-City
when trying to do geoipupdate we receive next error (see full command output):
geoipupdate -v
Opened License file /etc/GeoIP.conf
Read in license key 000000000000
number of product ids 1
Connecting to MaxMind GeoIP server
via Host or Proxy Server: api.maxmind.com:80
sending request GET /app/update_getfilename?product_id=GeoLite2-City HTTP/1.0
Host: updates.maxmind.com
database product id GeoLite2-City database file name /usr/share/GeoIP/GeoLite2-City.mmdb
/usr/share/GeoIP/GeoLite2-City.mmdb can't be opened, proceeding to download database
MD5 sum of database /usr/share/GeoIP/GeoLite2-City.mmdb is 0000000000000000000000000000000
Connecting to MaxMind GeoIP Update server
sending request GET /app/update_getipaddr HTTP/1.0
Host: updates.maxmind.com
client ip address: 52.13.23.6
md5sum of ip address and license key is 293bc8034681624265d4d6b9d917ddda
sending request GET /app/update_secure?db_md5=0000000000000000000000000000000&challenge_md5=293bc8034681624265d4d6b9d917ddda&user_id=999999&edition_id=GeoLite2-City HTTP/1.0
Host: updates.maxmind.com
Downloading gzipped GeoIP Database...
Done
Updating /usr/share/GeoIP/GeoLite2-City.mmdb
Saving gzip file to /usr/share/GeoIP/GeoLite2-City.mmdb.gz ... download data to a gz file named /usr/share/GeoIP/GeoLite2-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
what is wrong, and how it can be fixed?
thx
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.
Hello,
the geoipupdate
script only generate .mmdb files. But using the MaxMind perl module Geo::IP, this format does not seems to be recognized (the API looks for .dat file).
Am I missing something, or is it a bug?
When I perform a geoipupdate
into an empty data directory, with a valid subscription:
$ geoipupdate -v -f /etc/GeoIP.conf -d /usr/local/share/GeoIP/
geoipupdate 2.5.0
Opened License file /etc/GeoIP.conf
AccountID xxxxxx
LicenseKey xxxxxxxxxxxxxxxxxxxxxxxxx
Insert edition_id GeoIP2-Country
Read in license key /etc/GeoIP.conf
Number of edition IDs 1
url: https://updates.maxmind.com/app/update_getfilename?product_id=GeoIP2-Country
md5hex_digest: 00000000000000000000000000000000
url: https://updates.maxmind.com/app/update_getipaddr
Client IP address: xxx.xxx.xxx.xxx
md5hex_digest2 (challenge): xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
url: https://updates.maxmind.com/app/update_secure?db_md5=00000000000000000000000000000000&challenge_md5=xxxxxxxxxxxxxx&user_id=xxxxx&edition_id=GeoIP2-Country
Uncompress file /usr/local/share/GeoIP//GeoIP2-Country.mmdb.gz to /usr/local/share/GeoIP//GeoIP2-Country.mmdb.test
Rename /usr/local/share/GeoIP//GeoIP2-Country.mmdb.test to /usr/local/share/GeoIP//GeoIP2-Country.mmdb
I get:
$ ls -Al /usr/local/share/GeoIP/
total 3432
-rw-r--r-- 1 root staff 3513166 nov. 10 13:15 GeoIP2-Country.mmdb
-rw------- 1 root staff 0 nov. 10 13:15 .geoipupdate.lock
If I want to force using the .mmdb file instead of .dat in Perl:
$ cat test.pl
#!/usr/bin/perl -w
use strict;
use Geo::IP;
my $geoIP = Geo::IP->open("/usr/local/share/GeoIP/GeoIP2-Country.mmdb", GEOIP_STANDARD);
my $country = $geoIP->country_code_by_addr("8.8.8.8");
I get:
$ perl test.pl
Use of uninitialized value $x0 in numeric ge (>=) at (eval 4) line 5176.
Use of uninitialized value $offset in multiplication (*) at (eval 4) line 5155.
Use of uninitialized value $x0 in numeric ge (>=) at (eval 4) line 5176.
Use of uninitialized value $offset in multiplication (*) at (eval 4) line 5155.
Use of uninitialized value $x0 in numeric ge (>=) at (eval 4) line 5176.
Use of uninitialized value $offset in multiplication (*) at (eval 4) line 5155.
Use of uninitialized value $x0 in numeric ge (>=) at (eval 4) line 5176.
Use of uninitialized value $offset in multiplication (*) at (eval 4) line 5155.
Use of uninitialized value $x0 in numeric ge (>=) at (eval 4) line 5176.
Use of uninitialized value $offset in multiplication (*) at (eval 4) line 5155.
Use of uninitialized value $x0 in numeric ge (>=) at (eval 4) line 5176.
Use of uninitialized value $offset in multiplication (*) at (eval 4) line 5155.
Use of uninitialized value $x0 in numeric ge (>=) at (eval 4) line 5176.
Use of uninitialized value $offset in multiplication (*) at (eval 4) line 5155.
Use of uninitialized value $x0 in numeric ge (>=) at (eval 4) line 5176.
Use of uninitialized value $offset in multiplication (*) at (eval 4) line 5155.
Error Traversing Database for ipnum = 134744072 - Perhaps database is corrupt?
Request to get geoipupdate packaged for RedHat / Fedora / Amazon Linux style distributions and into the RPM repositories.
We use GeoIP2 in our Amazon Linux images, it must be installed as a standalone binary during our deployment processes. Would be great to have the latest geoipupdate as a maintained RPM package we could install through Yum instead.
Currently 1.6.5 is the latest version that is out there: http://rpm.pbone.net/index.php3?stat=3&search=GeoIP&srodzaj=3&dist[]=74
Kinda relevant to the "can we have binary packages for Ubuntu please?" ticket, but if we need to build this package ourselves you might want to advertise the build dependencies :)
From what I can see, on Ubuntu you need at least build-essentials
, one of libcurl4-{gnutls,openssl,nss}-dev
, and zlib1g-dev
, although there may be more.
Hello
Is an up-to-date version of this tool available anywhere as an Ubuntu package? If not, any chance you guys could create binary packages for Ubuntu and release in a PPA? Having to configure and build it on the server in order to install isn't exactly ideal as it requires having a build toolchain installed, and it also makes it fiddly to update it to the latest version when new releases are made.
Previously I've been able to use a geoipupdate
installed via an existing Ubuntu package (geoip-bin), but this doesn't seem to work any more for me after signing up for the GeoIP2 City, I'm guessing they're no longer maintained by you guys?
Cheers
-Matt
bin/Makefile.am
and man/Makefile.am
refer to $(datadir)/GeoIP"
, e.g.
AM_CPPFLAGS = -I$(top_srcdir)/src -DSYSCONFDIR=\"$(sysconfdir)\" -DDATADIR=\"$(datadir)/GeoIP\" \
-std=c99 -Wall -Wextra
but Makefile.am
uses $(datarootdir)/GeoIP
:
$(MKDIR_P) "$(DESTDIR)$(datarootdir)/GeoIP"
These two directories may or may not be the same, depending on autoconf defaults and ./configure
arguments. (FWIW, in the Debian package, I've been passing --datadir=/var/lib
to configure, as I want the files to end up in /var/lib/GeoIP
rather than somewhere /usr, which is for read-only data)
Just started using the geoipupdate
tool and realized that it does not download the CSV version of the tool, which is a non-starter for us.
How can I get an updated version of the CSV?
Hello,
installed on Lubuntu 16.04LTS
sudo add-apt-repository ppa:maxmind/ppa
sudo apt-get update
sudo apt-get install geoipupdate
geoipupdate
but...
/usr/share/GeoIP is not writable
;)
edit: found geoipupdate => sudo geoipupdate
Thanks for this niece little tool, saves a fair bit of time.
I have got one question that I don't see addressed anyway: do I have to restart Apache after having updated the GeoIP database - in my case it's the country one (#106)
how to check update file was integrity
Is this package for update only? Or it can be used for initial downloadng too?
I got this:
artpolikarpov@geo-02:~$ sudo geoipupdate -v
geoipupdate 2.2.2
Opened License file /etc/GeoIP.conf
UserId 999999
LicenseKey 000000000000
Insert product_id GeoLite2-City
Read in license key /etc/GeoIP.conf
Number of product ids 1
url: https://updates.maxmind.com/app/update_getfilename?product_id=GeoLite2-City
md5hex_digest: 60795d760ce4aac0ff36d76969f79f8e
url: https://updates.maxmind.com/app/update_getipaddr
Client IP address: 104.196.185.183
md5hex_digest2: ac1d3600e9de012252c01a0144ed8ca9
url: https://updates.maxmind.com/app/update_secure?db_md5=60795d760ce4aac0ff36d76969f79f8e&challenge_md5=ac1d3600e9de012252c01a0144ed8ca9&user_id=999999&edition_id=GeoLite2-City
No new updates available
It says “No new updates available”, but /usr/local/share/GeoIP
(default one) is empty.
I am using CentOs (uname: 2.6.32-042stab094.8 #1 SMP Tue Dec 16 20:36:56 MSK 2014 x86_64 x86_64 x86_64 GNU/Linux) and compiled GeoIP update from sources.
For now, I am trying to use free version of MaxMind to test this tool, but it ultimately fails with cryptic error:
[ GeoIP]$ sudo geoipupdate
MD5 Digest of installed database is fcdae7627066bce46902c0d1e331a3ed
Updating /usr/share/GeoIP/GeoIP.dat
Received Error -21 (Sanity check database_info string failed) when attempting to update GeoIP Database
I tried both with default config and config, proposed here - http://dev.maxmind.com/geoip/geoipupdate/
It's missing the recent new option LockFile
. See man/GeoIP.conf.5.in
.
There does not appear to be a product definition for GeoIPASNum2v6, so this database cannot be updated
It is still listed here: http://dev.maxmind.com/geoip/legacy/geolite/
I can't find a mention other than in the source code for the DatabaseDirectory.
We access the database from a rails project where the database is located relative to it.
Is it correct that I can just put a full path in the conf file for DatabaseDirectory?
Is there a predefined dates, or periods of time when new updates are released, so we can run the geoipupdate
the same or the day after. Currently I'm running it everyday.
The 'online guide' only includes ProductCodes for 5 of the 6 free Geolite legacy databases.Please, what's the ProductCode for the free, legacy GeoLite ASN IPv6 database ?
When running geoipupdate I'm getting next output:
coral:~ # geoipupdate
/usr/share/GeoIP/GeoIPv6.dat can't be opened, proceeding to download database
Updating /usr/share/GeoIP/GeoIPv6.dat
Received Error -21 (Sanity check database_info string failed) when attempting to update GeoIP Database
MD5 Digest of installed database is fa3e1cc9440d44ecfa5c583abe172620
/usr/share/GeoIP/GeoLiteCityv6.dat is up to date, no updates required
GeoIP Database up to date
MD5 Digest of installed database is 059b96d5bb4539e5d56e3a01038eefa9
/usr/share/GeoIP/GeoLiteCountry.dat is up to date, no updates required
GeoIP Database up to date
MD5 Digest of installed database is a2fdc5f314766bbe95710276c41ac6a7
/usr/share/GeoIP/GeoLiteCity.dat is up to date, no updates required
GeoIP Database up to date
My GeoIP.conf
coral:~ # cat /etc/GeoIP.conf
LicenseKey 999999
UserId 000000000000
ProductIds GeoLite-Legacy-IPv6-Country GeoLite-Legacy-IPv6-City 506 533
Debian 7, amd64, man 2.6.2
While I was preparing personal deb package of geoipupdate I run lintian check upon package and it threw the following warning:
W: geoipupdate: manpage-has-errors-from-man usr/share/man/man5/GeoIP.conf.5.gz 32: warning: macro
Bl' not defined`
I just removed that string and seems it's fine. No visual differences noticed.
More details about check are at http://lintian.debian.org/tags/manpage-has-errors-from-man.html
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.