MaxMind-DB-Reader-java icon indicating copy to clipboard operation
MaxMind-DB-Reader-java copied to clipboard

Enable basic sanity check for new database files

Open DimitriHautot opened this issue 8 years ago • 3 comments

Hello,

A couple of days ago, I encountered an exception on every get(InetAddress) method call on a GeoIP2 City database file, dated from June 11, 2017: capture d ecran 2017-06-18 a 00 00 28

For now, I don't see any (public) method that could allow some sanity check on a database file.

The MD5 hash computed on the downloaded file was matching the one available on your web site.

Appart from testing a new database file with some values, how could we ensure that we can safely switch to a valid database? For production systems, this is very important.

Thanks,

Dimitri

DimitriHautot avatar Jun 23 '17 09:06 DimitriHautot

If you want to verify a database, I would suggest using mmdbverify. If you just want a basic sanity check and you have already checked the MD5 of the download, I would suggest just opening the database and reading an IP address from it.

For Java users, the most frequent source of "invalid" database is not disabling binary filtering when deploying with Maven.

oschwald avatar Jun 23 '17 22:06 oschwald

Thanks for the suggestions @oschwald .

  1. mmdbverify is nice, but difficult to integrate in our automatic, all Java-based setup.
  2. Using a "probation" mode where both old & new database files are used is easier in our case.
  3. The Maven deployment is not relevant to us, but glad to hear about it.

We will probably go for suggestion n°2.

By any chance, do you foresee porting mmdbverify to Java ?

DimitriHautot avatar Jun 26 '17 11:06 DimitriHautot

I am not sure if we will port mmdbverify to Java. We primarily use it internally and have not seen much customer interest in such a tool.

oschwald avatar Jun 26 '17 14:06 oschwald