my City not imported
It seem Immich is importing to table "geodata_places" all cites with population bigger than 500. I think it imports datas from the files "cities500.txt" from GeoNames.
Few weeks ago, i added one new city "X" (with population bigger than 500) to GenoName website, and adjusted the population of city "Y" to be 1200.
After immich upgrade, i can find my new city "X" has been properly imported to Immich. Nice! But the city "Y" is still not imported. Seem to be ignored. I confirmed that the new population value is properly there into the latest version of "cities500.txt" file. So the file seem ok.
i did few modifications on GeoName to try to figure out myself which value should i change to make Immich importing my city "Y", but no luck.
Someone knows what are conditions immich considers to import data to its database ?
Thanks for you help!
9 Replies
:wave: Hey @ddube,
Thanks for reaching out to us. Please carefully read this message and follow the recommended actions. This will help us be more effective in our support effort and leave more time for building Immich :immich:.
References
- Container Logs:
docker compose logs
docs
- Container Status: docker ps -a
docs
- Reverse Proxy: https://immich.app/docs/administration/reverse-proxy
- Code Formatting https://support.discord.com/hc/en-us/articles/210298617-Markdown-Text-101-Chat-Formatting-Bold-Italic-Underline#h_01GY0DAKGXDEHE263BCAYEGFJA
Checklist
I have...
1. :ballot_box_with_check: verified I'm on the latest release(note that mobile app releases may take some time).
2. :ballot_box_with_check: read applicable release notes.
3. :ballot_box_with_check: reviewed the FAQs for known issues.
4. :ballot_box_with_check: reviewed Github for known issues.
5. :ballot_box_with_check: tried accessing Immich via local ip (without a custom reverse proxy).
6. :blue_square: uploaded the relevant information (see below).
7. :blue_square: tried an incognito window, disabled extensions, cleared mobile app cache, logged out and back in, different browsers, etc. as applicable
(an item can be marked as "complete" by reacting with the appropriate number)
Information
In order to be able to effectively help you, we need you to provide clear information to show what the problem is. The exact details needed vary per case, but here is a list of things to consider:
- Your docker-compose.yml and .env files.
- Logs from all the containers and their status (see above).
- All the troubleshooting steps you've tried so far.
- Any recent changes you've made to Immich or your system.
- Details about your system (both software/OS and hardware).
- Details about your storage (filesystems, type of disks, output of commands like fdisk -l
and df -h
).
- The version of the Immich server, mobile app, and other relevant pieces.
- Any other information that you think might be relevant.
Please paste files and logs with proper code formatting, and especially avoid blurry screenshots.
Without the right information we can't work out what the problem is. Help us help you ;)
If this ticket can be closed you can use the /close
command, and re-open it later if needed.Geonames cities500, right. Excluding PPLX and PPLH. In code:
https://github.com/immich-app/immich/blob/303307e1ac9949e1a4c56bb1cf27e4969d46135b/server/src/repositories/map.repository.ts#L261-L281
You can query
geodata_places
in the database to check if it was imported or not
Related:
- https://github.com/immich-app/immich/issues/20085
- https://github.com/immich-app/immich/pull/11370
- https://github.com/immich-app/immich/issues/8941
- https://github.com/immich-app/immich/discussions/17635
- https://www.reddit.com/r/immich/comments/1fcq2z3/gps_latlong_info_is_correct_but_incorrect_and/
- https://www.reddit.com/r/immich/comments/1mbpf2u/immich_changing_location_data_language/[Issue] geodata_places does not include cities500 (immich-app/immich#20085)
[Pull Request] feat(server): significantly improve Australian reverse geocoding accuracy (immich-app/immich#11370)
[Issue] Reverse geocoding is frequently incorrect (immich-app/immich#8941)
[Discussion] [Feature] skip PPLH in geonames import (immich-app/immich#17635)
Thanks so much for you help. i reviewed provided links and found a way to understand at which date data from Geonames has been included into Immich version. So taking a look on "build/geodata/goedata-date.txt" in my container, it shows 2025-08-19. So my updates on Geonames happened after that date.
so i will wait few other immich updates to understand when new datas will be refreshed.
Based on documentation, each minor version should include a fresh version of Geonames datas... but it seem its not always the case. Because the last minor version v1.140.0 has been published on August 29th, and i my city has been updated on August 25th (based on the last modification date in the cities500.txt if i download it from Geonames).
so i will wait few other immich updates to understand when new datas will be refreshed.
Based on documentation, each minor version should include a fresh version of Geonames datas... but it seem its not always the case. Because the last minor version v1.140.0 has been published on August 29th, and i my city has been updated on August 25th (based on the last modification date in the cities500.txt if i download it from Geonames).
To quickly validate your Geonames change - try/force downloading cities500 in the running Immich container
docker exec --user root immich_server sh -c 'apt-get update && apt-get install -yq unzip && curl -Lo /build/geodata/cities500.zip https://download.geonames.org/export/dump/cities500.zip && umask 0333 && unzip -o /build/geodata/cities500.zip -d /build/geodata/ && rm /build/geodata/cities500.zip && date -Is | tr -d "\n" > /build/geodata/geodata-date.txt && echo Done && ls -l /build/geodata'
Then docker restart immich_server
In logs it should print
The command is adapted from https://github.com/immich-app/base-images/blob/489692aaafce6c4d005537809cd48b82f206a9bb/server/Dockerfile#L89-L90
This is a separate repo for Immich base images. Which is rebuilt less frequently than Immich itself. Not every minor release. That explains the lag.
Re: docs
This data is loaded into the Postgres database on each minor version upgradeYeah, it should be rephrased. Immich checks the timestamp from
geodata-date.txt
on each restart, then performs the import if timestamp is newer than last import (recorded in the database). If the timestamp is more fresh, then cities500.txt is expected to be fresh as well.
Current build process does not guarantee presence of fresh geodata on each minor version build.Hey thanks so much.... the command you gave me works pretty well!!! Thank you. So it mean my updates on Geonames are properly done. I will just have to wait for Immich to include it in their futur build, to avoid doing this manually at every updates.
Other question: Do you know if the reverse Geocoding is reliable ? Meaning i have several photos took from about the same place, and just few of them resolve properly the city. The majority are giving the "second nearest" city. Really weird. i even built a SQL query to replicate the same logic immich is doing (based on the code on GitHub)... and i dont have the same result. The manual query executed into pgAdmin give me alwasy other city. i can't get the same result as Immich. FYI, here is my query:
WITH params AS (
Select 47.4377472222222 as myLat, -69.8549611111111 AS myLong -- GPS location of one of my photo
)
SELECT
t1.*
FROM
public.geodata_places AS t1,
params AS t2
WHERE
earth_box(ll_to_earth_public(t2.myLat, t2.myLong), 25000) > ll_to_earth_public(t1.latitude, t1.longitude)
ORDER BY
earth_distance(ll_to_earth_public(t2.myLat, t2.myLong) , ll_to_earth_public(t1.latitude, t1.longitude)) asc
LIMIT 1
This query even doesn't show the city Immich resolve.. really weird. Maybe i'm focussing on the wrong code 😉
You are almost there:
> vs @>
Different operators return different results for me too.
You can peek into Immich internal working with these two tricks:
1. Increase Immich log level: through env var IMMICH_LOG_LEVEL or simply in UI > Administration > Logging > set Verbose level.
2. Enable Postgres query logging
This is how I got the query without looking into Immich sources.Wowwww... You help is priceless!! I will take a look on that. Yes i found after several tries that i can activate the VERBOSE log_level via the .env file. And.. i can agree with you it will be lot easier if i enable LOGS into Postgres. Totally new for me 🙂 Thanks again!!