POI index never auto-refreshes — neither refresh timer is installed #19
Labels
No labels
dependencies
major
security-pin
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
trails-cool/trails#19
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The
poi-indexchange shipped 2026-07-13 with a documented remaining manual step: enable the two monthly refresh timers. That step was never done, so the POI index has not refreshed since the one-off manual planet import — OSM changes have not appeared in/api/poisfor the ~2 weeks since.Verified on both hosts today, and the units are not merely disabled — they are not installed at all:
BRouter host (
ullrich.is, user systemd):Flagship (
trails.cool, system systemd):The unit files are deployed by
cd-brouter—~/brouter/poi-extract/poi-extract.{service,timer}both exist — they were simply never installed into a systemd unit path.~/.config/systemd/user/does not exist on the BRouter host.Why it needs doing by hand
This is a persistence change on two machines, not something the deploy workflows cover:
loginctl enable-linger trails. Without linger the timer would not run when nobody is logged in, which is the normal state.Linger=notoday./etc/systemd/system/poi-import.timer, needs root.Runbooks already exist:
infrastructure/brouter-host/poi-extract/README.mdandinfrastructure/scripts/README.md.Worth deciding while doing it
cd-appssourcemaps (#5) and the SOPS restart gap (#13): no signal, just staleness. Consider a Grafana alert on POI index age, or emitting the extract's completion into Loki, so a failed monthly run is visible rather than discovered months later.Context: the BRouter host has no osmium and no sudo for the
trailsuser, so the extract runs osmium in a container (osmium.Dockerfile, built on first use).Correction to my "worth deciding" note above: the monitoring already exists. I suggested considering a Grafana alert on POI index age without checking first — it was already built, and I have now verified it is live end to end.
poi_index_age_secondsis published by the Planner from its own DB (extract(epoch from now() - max(pois.imported_at))).Current value: 1,191,795 s ≈ 13.8 days. Threshold is 42 days, so the alert has not fired — correctly. Given the timers are not installed, the index will keep aging and this alert will trip on its own at roughly 2026-08-23 unless the timers are enabled before then.
So the safety net is real, just slow by design. That changes the urgency of this issue rather than the substance: nothing is silently unmonitored, but the index is stale today and will stay stale until the timers exist.
Worth noting the alert also covers the failure mode where the import runs but refuses to swap — the guard leaves the old table in place, so age keeps climbing even though the job "ran". Detail is on the Planner dashboard (
poi_import_last_status).Done — both timers are installed, enabled, and their prerequisites verified.
BRouter host (
trails, user systemd + linger):Flagship (root, system systemd):
The one-day offset the units were designed around is intact, and
LASTis unset on both —Persistent=truedid not fire a catch-up run on enable, so nothing started early.Prerequisites checked rather than assumed
A monthly timer that fails at 02:00 would not surface for weeks, so the extract unit was checked end-to-end:
%hresolved correctly →ExecStart=/home/trails/brouter/poi-extract/poi-extract.shpoi-extract.shandto-ndjson.pyboth-rwxr-xr-xdocker psworks astrails;trails-osmium:localalready built, so the first run will not stop to build itpython3,curl,gzip,sha256sumpresent; 587G free on/home; timeout 6hNote for anyone else doing this:
su trailsdoes not register a logind session, sosystemctl --userfails withFailed to connect to bus.export XDG_RUNTIME_DIR=/run/user/$(id -u)fixes it, or SSH in astrailsdirectly.The monitoring question this issue raised
The issue asked whether a silently-not-running refresh would be visible. Two fixes went in, and the answer is now yes — verified rather than assumed:
poi-index-stale(Grafana, 6-week threshold onpoi_index_age_seconds) already existed and is live. Index age currently reads ~14.5 days, so if the Aug 1–2 cycle fails, it alerts around Aug 23.Per-run outcome detail was broken in two ways, both fixed in #22:
emit_metricis the last command a successful import runs, and itsmvtargeted a directory that did not exist on the flagship. Underset -euo pipefailthat failingmvbecame the exit status — a fully successful import would have been recorded by systemd as a failed unit. Verified against the pre-fix script: exit 1, with all the work already done.node-exporterran without--collector.textfile.directoryand without that path mounted, so the metrics were written and silently dropped. It also runs asnobody(uid 65534) whilemktempcreates0600root-owned files, so the file would have been unreadable even once the collector was wired.The chain is now confirmed working: a synthetic
.promwritten on the host was exposed by node_exporter (node_textfile_scrape_error 0) and scraped into Prometheus, then removed.Follow-up filed
Verifying that deploy surfaced #23 —
cd-infrakilled Prometheus one second after starting it, taking monitoring down for ~16 minutes. Unrelated to POI, but found here and tracked there.The remaining unknown is simply whether the first real cycle produces fresh data on Aug 1–2. The stale-index alert covers it if not, which is the outcome this issue was asking for.