goaccess icon indicating copy to clipboard operation
goaccess copied to clipboard

GeoIP2 - Error Traversing Database

Open Aaron-Spence opened this issue 6 months ago • 4 comments

Using:

  • GoAccess 1.9.4
  • GeoLite2-City.mmdb and GeoLite2-ASN.mmdb from MaxMind.com
  • Nginx logs (standard)
  • Run command sudo goaccess --ignore-crawlers --unknowns-as-crawlers nginx.log -o /myapp/goaccess.html --log-format=COMBINED
  • Configured in goaccess.conf: geoip-database GeoLite2-City.mmdb, geoip-database/GeoLite2-ASN.mmdb

Receiving the following (and the Geolocating in the .html report is empty):

Error Traversing Database for ipnum = 176526339 - Perhaps the database is corrupt?

The error is repeated hundreds of times (with different numbers). I have tried different versions of GeoLite2. The report generated is otherwise fine.

Aaron-Spence avatar Jun 23 '25 02:06 Aaron-Spence

Have you tried any of the mmdb from https://db-ip.com/db/lite.php?

allinurl avatar Jun 23 '25 02:06 allinurl

Exact same outcome unfortunately.

On a related side-note, I was confused by the GoAccess documentation (https://goaccess.io/man), as it says:

If using GeoIP2, you will need to download the City/Country database from MaxMind and use the option --geoip-database to specify the database. Currently cities are only shown in the hosts panel (per host).

This made it sound like the MaxMind maps were mandatory.

Aaron-Spence avatar Jun 23 '25 03:06 Aaron-Spence

Just to clarify:

  1. In your config you’ve listed them as two separate entries, right?

    geoip-database /path/GeoLite2-City.mmdb
    geoip-database /path/GeoLite2-ASN.mmdb
    
  2. Can you confirm you built GoAccess with --enable-geoip=mmdb?

  3. Finally, could you comment out those lines in your config and instead pass the GeoIP option on the command line? For example:

    $ sudo goaccess nginx.log --ignore-crawlers --unknowns-as-crawlers --log-format=COMBINED --geoip-database=/path/GeoLite2-City.mmdb -o /myapp/goaccess.html
    

allinurl avatar Jun 23 '25 14:06 allinurl

Appreciate your assistance allinurl. Your step #2 was the answer - I had inadvertently built with --enable-geoip=legacy instead...

Maybe the error message could be updated to something like:

Error Traversing Database for ipnum = 176526339 - Perhaps the database is corrupt or goaccess was not built with the right --enable-geoip<legacy|mmdb> configuration?

Aaron-Spence avatar Jun 24 '25 00:06 Aaron-Spence