Onpremise: GEOIP_PATH_MMDB support

Created on 19 Dec 2019  路  8Comments  路  Source: getsentry/onpremise

How should one configure GEOIP_PATH_MMDB for the docker image?

Enhancement

Most helpful comment

You just need to add this to x-sentry-defaults volumes section in docker-compose.yml:
- '/path/to/geoip/on/host:/path/to/geoip/in/sentry/conf'

All 8 comments

We were planning to add support for this in the on-premise repo but the very recent account/license requirements may make it harder than we want it to.

Still, https://dev.maxmind.com/geoip/geoipupdate/#Direct_Downloads may help you get started. What you need to do is download this file, put/copy it into a volume and then mount that volume to Sentry containers.

Sure, but can I point to that file with an environment variable?

As long as the file is in a volume that is mounted to the containers, you can set GEOIP_PATH_MMDB either through the .env file or in docker-compose.yaml or by creating a docker-compose.overrides.yaml and doing it there.

Ah scratch what I said above, sorry. You'd need to set it in your sentry.conf.py file. You can make it come from an environment variable in there too.

Right, so would you consider adding that as a default so that one doesn't need to customize it?

Yes, it can be a part of the automation work we intend to do around this. It won't happen very soon though. If you are interested, I can assist you creating a pull request and getting it merged rather than waiting for us.

@BYK I just tried to create a volume and add it to the installation, but I'm getting this:

cron_1                    | 17:07:31 [WARNING] sentry.utils.geo: Error opening GeoIP database: /geoip/GeoLite2-City.mmdb
worker_1                  | 17:07:31 [WARNING] sentry.utils.geo: Error opening GeoIP database: /geoip/GeoLite2-City.mmdb
post-process-forwarder_1  | 17:07:31 [WARNING] sentry.utils.geo: Error opening GeoIP database: /geoip/GeoLite2-City.mmdb
web_1                     | 17:07:31 [WARNING] sentry.utils.geo: Error opening GeoIP database: /geoip/GeoLite2-City.mmdb
worker_1                  | 17:07:32 [WARNING] sentry.utils.geo: Error opening GeoIP database in Rust: /geoip/GeoLite2-City.mmdb
post-process-forwarder_1  | 17:07:32 [WARNING] sentry.utils.geo: Error opening GeoIP database in Rust: /geoip/GeoLite2-City.mmdb
cron_1                    | 17:07:32 [WARNING] sentry.utils.geo: Error opening GeoIP database in Rust: /geoip/GeoLite2-City.mmdb
web_1                     | 17:07:32 [WARNING] sentry.utils.geo: Error opening GeoIP database in Rust: /geoip/GeoLite2-City.mmdb

I'm attaching the volume with - 'sentry-geoip:/geoip' in the config and added GEOIP_PATH_MMDB = '/geoip/GeoLite2-City.mmdb' to my sentry.conf.py

Am I doing something wrong? The permissions seems fine:

root@2a1d0fb1749c:/geoip# ls -lah
total 64M
drwx------ 2 root root 4.0K Jan 26 17:01 .
drwxr-xr-x 1 root root 4.0K Jan 26 17:07 ..
-rw-r--r-- 1 root root  60M Jan 26 17:00 GeoLite2-City.mmdb

You just need to add this to x-sentry-defaults volumes section in docker-compose.yml:
- '/path/to/geoip/on/host:/path/to/geoip/in/sentry/conf'

Was this page helpful?
0 / 5 - 0 ratings

Related issues

adrielliu picture adrielliu  路  3Comments

SteveEdson picture SteveEdson  路  3Comments

NullIsNot0 picture NullIsNot0  路  5Comments

rmisyurev picture rmisyurev  路  4Comments

meriturva picture meriturva  路  6Comments