Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GEOIP_PATH_MMDB support #310

Closed
ptman opened this issue Dec 19, 2019 · 8 comments · Fixed by #766
Closed

GEOIP_PATH_MMDB support #310

ptman opened this issue Dec 19, 2019 · 8 comments · Fixed by #766
Assignees

Comments

@ptman
Copy link

ptman commented Dec 19, 2019

How should one configure GEOIP_PATH_MMDB for the docker image?

@BYK BYK transferred this issue from getsentry/docker-sentry Dec 30, 2019
@BYK
Copy link
Collaborator

BYK commented Dec 30, 2019

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.

@BYK BYK self-assigned this Dec 30, 2019
@ptman
Copy link
Author

ptman commented Jan 1, 2020

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

@BYK
Copy link
Collaborator

BYK commented Jan 2, 2020

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.

@ptman
Copy link
Author

ptman commented Jan 3, 2020

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

@BYK
Copy link
Collaborator

BYK commented Jan 3, 2020

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.

@bellini666
Copy link

@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

@urusha
Copy link

urusha commented Jun 30, 2020

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'

@BYK BYK added this to the 20.8.0 milestone Jul 10, 2020
@BYK BYK modified the milestones: 20.8.0, 20.9.0 Aug 15, 2020
@BYK BYK removed this from the 20.9.0 milestone Sep 14, 2020
@BYK
Copy link
Collaborator

BYK commented Sep 14, 2020

Relevant: sentry-kubernetes/charts#92

@chadwhitacre chadwhitacre assigned chadwhitacre and unassigned BYK Dec 7, 2020
@github-actions github-actions bot locked and limited conversation to collaborators Dec 30, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants