🐛 Bug Report: Unable to see IP location #23

Closed
opened 2025-10-07 23:50:11 +03:00 by OVERLORD · 11 comments
Owner

Originally created by @vilisseranen on GitHub.

Reproduction steps

When a user logs in, I see correct IP in the Audit log, but the location is always marked as unknown (except LAN IPs which are correctly flagged).

Expected behavior

Return the approximate location of the IP in the audit log

Actual Behavior

All non LAN IPs show as Unknown.

Image

Pocket ID Version

1.10.0

Database

SQLite

OS and Environment

Docker on Ubuntu 24.04

Log Output

No log output related to IP location matching.

Originally created by @vilisseranen on GitHub. ### Reproduction steps When a user logs in, I see correct IP in the Audit log, but the location is always marked as unknown (except LAN IPs which are correctly flagged). ### Expected behavior Return the approximate location of the IP in the audit log ### Actual Behavior All non LAN IPs show as Unknown. <img width="285" height="257" alt="Image" src="https://github.com/user-attachments/assets/05df2934-c68e-4bdb-a79f-0e248c0fb1bb" /> ### Pocket ID Version 1.10.0 ### Database SQLite ### OS and Environment Docker on Ubuntu 24.04 ### Log Output No log output related to IP location matching.
Author
Owner

@vilisseranen commented on GitHub:

Please note that I tried with both MAXMIND_LICENSE_KEY and MAXMIND_LICENSE_KEY_FILE (for the latter I pasted the file that you can download when you create an API key on the maxmind website.
I also validated that the database is indeed present in the container.

Note that I also have the variable set TRUST_PROXY=true.

@vilisseranen commented on GitHub: Please note that I tried with both `MAXMIND_LICENSE_KEY` and `MAXMIND_LICENSE_KEY_FILE` (for the latter I pasted the file that you can download when you create an API key on the maxmind website. I also validated that the database is indeed present in the container. Note that I also have the variable set `TRUST_PROXY=true`.
Author
Owner

@warfair1337 commented on GitHub:

Having the exact same issue, Unknown for any location that is not LAN.
I tried setting this up for the first time today.
Using MAXMIND_LICENSE_KEY variable, it downloads the database GeoLite2-City.mmdb. Tried deleting and letting Pocket-ID re-download, but same result.

No errors in logs:
Sep 20 15:02:57 INF Updating GeoLite2 City database app=pocket-id version=1.11.1
Sep 20 15:02:58 INF GeoLite2 City database successfully updated. app=pocket-id version=1.11.1

@warfair1337 commented on GitHub: Having the exact same issue, Unknown for any location that is not LAN. I tried setting this up for the first time today. Using MAXMIND_LICENSE_KEY variable, it downloads the database GeoLite2-City.mmdb. Tried deleting and letting Pocket-ID re-download, but same result. No errors in logs: Sep 20 15:02:57 INF Updating GeoLite2 City database app=pocket-id version=1.11.1 Sep 20 15:02:58 INF GeoLite2 City database successfully updated. app=pocket-id version=1.11.1
Author
Owner

@ItalyPaleAle commented on GitHub:

@vilisseranen if you type the IP in https://www.maxmind.com/en/geoip-demo do you see it geolocated?

@ItalyPaleAle commented on GitHub: @vilisseranen if you type the IP in https://www.maxmind.com/en/geoip-demo do you see it geolocated?
Author
Owner

@ItalyPaleAle commented on GitHub:

I am not really able to repro....

I wonder if the database is corrupted? Can you try deleting the GeoLite2-City.mmdb file and restart Pocket ID? It should re-fetch it.

Also, can you take a look at the logs and share them? Especially if you see anything that could be relevant

@ItalyPaleAle commented on GitHub: I am not really able to repro.... I wonder if the database is corrupted? Can you try deleting the `GeoLite2-City.mmdb` file and restart Pocket ID? It should re-fetch it. Also, can you take a look at the logs and share them? Especially if you see anything that could be relevant
Author
Owner

@vilisseranen commented on GitHub:

Yes @ItalyPaleAle, it is properly located when I input the IP on the website.

@vilisseranen commented on GitHub: Yes @ItalyPaleAle, it is properly located when I input the IP on the website.
Author
Owner

@warfair1337 commented on GitHub:

Thanks. I noticed it started populating location after WAN-users began signing in after enabling Maxmind.
No issue here then, just my assumption getting the best of me ;-)

@warfair1337 commented on GitHub: Thanks. I noticed it started populating location after WAN-users began signing in after enabling Maxmind. No issue here then, just my assumption getting the best of me ;-)
Author
Owner

@ItalyPaleAle commented on GitHub:

Oh yeah that would make sense!

@ItalyPaleAle commented on GitHub: Oh yeah that would make sense!
Author
Owner

@ItalyPaleAle commented on GitHub:

Ok great, I'll close this issue then. Thanks for confirming

@ItalyPaleAle commented on GitHub: Ok great, I'll close this issue then. Thanks for confirming
Author
Owner

@vilisseranen commented on GitHub:

I think I found the issue. Some IPs are geolocated by Maxmind but do not provide a city name (and the accuracy is 200km instead of the 20km I see when the city is geolocated). This happens when I connect via mobile data.
I think the geolite_service always looks for City + Country and it's probably why I see the location as Unknown when I am on mobile data, but was able to see it properly located when I was using the wifi at my parents for example.
I'll try to create a PR for it.

@vilisseranen commented on GitHub: I think I found the issue. Some IPs are geolocated by Maxmind but do not provide a city name (and the accuracy is 200km instead of the 20km I see when the city is geolocated). This happens when I connect via mobile data. I think the geolite_service always looks for City + Country and it's probably why I see the location as Unknown when I am on mobile data, but was able to see it properly located when I was using the wifi at my parents for example. I'll try to create a PR for it.
Author
Owner

@ItalyPaleAle commented on GitHub:

I cannot repro, this is working fine for me.

Just a note that the location is stored when the record is created, not when it's displayed. So after deleting the database and re-starting Pocket ID, you'd see it for new records only.

@ItalyPaleAle commented on GitHub: I cannot repro, this is working fine for me. Just a note that the location is stored when the record is created, not when it's displayed. So after deleting the database and re-starting Pocket ID, you'd see it for new records only.
Author
Owner

@vilisseranen commented on GitHub:

The IPs which don't have a city name in maxmind actually have an entry for the country in the audit_logs table. The issue was on the UI side which would show the location unknown unless both the city and country were present.

@vilisseranen commented on GitHub: The IPs which don't have a city name in maxmind actually have an entry for the country in the audit_logs table. The issue was on the UI side which would show the location unknown unless both the city and country were present.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/pocket-id-pocket-id-1#23