Geolocation not working

We used to be on version 10 and we recently upgraded to version 21. Back then we didn’t have geolocation set up but after upgrading, I decided to enable geolocation on our instance of Sentry. I followed the steps in the documentation to enable geolocation and the database looks like it downloaded properly after I restarted all services:


However the heatmap was still showing no signs of geolocation data being captured:

Afterwards I modified our docker-compose.yml file:

x-sentry-defaults: &sentry_defaults
    GEOIP_PATH_MMDB: "/geoip/GeoLite2-City.mmdb"
    - "./geoip:/geoip:ro"
    image: "maxmindinc/geoipupdate:latest"
      ["/usr/bin/geoipupdate", "-d", "/sentry", "-f", "/sentry/GeoIP.conf"]
      - "./geoip:/sentry"

I don’t know what else I’m missing. Is there a setting within the app that I have to do via the web browser? Can someone help me out?

Here’s my relay/config.yml:

  upstream: "http://web:9000/"
  port: 3000
  level: WARN
  enabled: true
    - {name: "bootstrap.servers", value: "kafka:9092"}
    - {name: "message.max.bytes", value: 50000000} #50MB or bust
  redis: redis://redis:6379
  geoip_path: "/geoip/GeoLite2-City.mmdb"
  _client: "reqwest"

And here’s my sentry/

# GeoIP #

GEOIP_PATH_MMDB = '/geoip/GeoLite2-City.mmdb'

Also, before I forget - after every change I made, I ran docker-compose restart to restart all services. I think based on the documentation, every time I do that, the database gets updated? I’m really confused as to what I’m doing wrong here.

Pinging our geoip mmdb expert @chadwhitacre here for help :smiley:

Thanks @BYK - it’s not a rush but I’d love it if we could get this to work. Most of our errors come from within the company’s network but we do have global users as well, just not as much.

@gregorip I’m able to reproduce your result. I have a valid GeoLite2-City.mmdb database, and both web and relay seem to be picking up what I’m putting down, yet I’m not seeing any evidence of IP address geolocation in the app. :thinking: Gonna have to dig deeper …


Thank you! I’ll be waiting for a solution. I appreciate the help!


False alarm. :frowning: I was hitting localhost with a private IP, which isn’t picked up. It still works for me with a public IP (via ngrok). Actually, though … could this be an issue for you, @gregorip? What IP addresses are you trying to geolocate? Are they public or private?

@chadwhitacre Majority of our traffic is on a private IP address, usually starts with 10.* - however we do have public-facing apps and some of our traffic comes from across the world, Europe, North and South America, China, etc.

I have the same issue.

Here is the traefik output to an example request:

traefik_1                                   | time="2021-03-15T15:48:24Z" level=debug msg="vulcand/oxy/roundrobin/rr: Forwarding this request to URL" ForwardURL="" Request="{\"Method\":\"POST\",\"URL\":{\"Scheme\":\"\",\"Opaque\":\"\",\"User\":null,\"Host\":\"\",\"Path\":\"/api/2/envelope/\",\"RawPath\":\"\",\"ForceQuery\":false,\"RawQuery\":\"\",\"Fragment\":\"\",\"RawFragment\":\"\"},\"Proto\":\"HTTP/1.1\",\"ProtoMajor\":1,\"ProtoMinor\":1,\"Header\":{\"Accept\":[\"application/json\"],\"Accept-Encoding\":[\"gzip, deflate, br\"],\"Content-Encoding\":[\"gzip\"],\"Content-Length\":[\"1174\"],\"X-Forwarded-For\":[\"87.xx.xx.134\"],\"X-Forwarded-Host\":[\"\"],\"X-Forwarded-Port\":[\"443\"],\"X-Forwarded-Proto\":[\"https\"],\"X-Forwarded-Server\":[\"eb02169e087d\"],\"X-Real-Ip\":[\"87.xx.xx.134\"],\"X-Sentry-Auth\":[\"Sentry sentry_version=7,sentry_client=sentry.dotnet,sentry_key=xxx,sentry_timestamp=1615823303\"]},\"ContentLength\":1174,\"TransferEncoding\":null,\"Host\":\"\",\"Form\":null,\"PostForm\":null,\"MultipartForm\":null,\"Trailer\":null,\"RemoteAddr\":\"87.xx.xx.134:64750\",\"RequestURI\":\"/api/2/envelope/\",\"TLS\":null}"`

I just found out that the geolocation works for a react project. :partying_face:
It doesn’t work for my c# project however.
I’m using those nugets:
Sentry.AspNetCore Version=3.1.0
Sentry.Serilog Version=3.1.0

Yeah, we were unable to replicate this issue. Could your C# project not sending a proper IP address to run geolocation on @klyse?

Not sure. Do I need to add something there?

using (SentrySdk.Init(""))
	throw null;

It also looks good from the traefik logs (with IP), right?

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.