42 KiB
Operations
Live host Compose overlay
The long-running production host shares its historical
meshcore-analytics_default bridge with separately managed beacon and Discord
services. Use docker-compose.live.yml for every production config, up,
ps, exec, and controlled replacement command:
docker compose -f docker-compose.yml -f docker-compose.live.yml \
--profile dev --profile tunnel config --quiet
The overlay treats that bridge as external and reserves
172.30.0.10–172.30.0.30 for the analytics proxies and tunnel. This keeps
the backend trusted-proxy allowlist exact without attempting to delete or
renumber unrelated endpoints. It also publishes this stack's Prometheus on
127.0.0.1:9092 because the host's independent isolated-network Prometheus
owns port 9090. The base application Compose file uses separately managed
data-plane services. CI combines it with docker-compose.ci.yml on a dedicated
172.30.0.0/24 network; the contributor helper and restore drill use their own
owned stacks. Do not apply the live external-network overlay to those fixtures.
Browser operator access
The operator dashboard exchanges OPERATOR_SITE_TOKEN for a 30-minute,
in-memory browser session. The session cookie is always HttpOnly, Secure,
and SameSite=Strict; the token is not stored in browser storage. Login,
logout, expiry, and failed authentication are audited without logging the
token.
Use either the deployment's local HTTPS endpoint or an SSH tunnel that opens
the dashboard as https://localhost. Plain HTTP to a private IP is not a
supported operator transport and the server will not weaken the cookie to make
it work. Example tunnel:
ssh -L 8443:127.0.0.1:443 operator@mesh-host
Then open https://localhost:8443/, enter the operator token, and use the
dashboard normally. Logout requires the session CSRF token. Existing automation
may continue to send Authorization: Bearer <OPERATOR_SITE_TOKEN> for one
release; migrate it to a purpose-specific operator credential before that
compatibility path is removed.
Automated checks
Pull requests and branch pushes run .github/workflows/ci.yml. The workflow:
- installs dependencies from lockfiles
- type-checks, tests, and builds the backend
- builds the frontend and runs Playwright desktop/mobile smoke tests
- compiles the observed-link Python worker and tests HopReach with Go 1.23
- enforces the UK-4,600 HopReach speed/memory release gate
- validates the Docker Compose model with required secrets represented by CI-only placeholders
Dependabot groups weekly dependency updates for the backend, frontend, and GitHub Actions.
Clean bootstrap
Set every required value in .env, including the immutable
HEALTHCHECK_SOURCE_REF and Anubis signing key. Before starting Mosquitto, load
the environment and run scripts/bootstrap-mosquitto.sh. The helper creates a
backend-only read ACL and password file, refuses partial or symlinked state, and
does not replace an existing credential set.
Public packet visibility recovery
Use the privacy convergence runbook when public and
materialized generations differ or privacy work remains pending/failed. The
privacy:converge command defaults to a read-only inventory. Its explicit apply
mode locks policy/data writers and reclassifies both retained packet stores
before publishing a verified generation; it requires a maintenance window.
Region snapshot worker
region-snapshot-worker uses the backend image and its worker database role
(MESHCORE_WORKER_DATABASE_URL, with DATABASE_URL fallback). It polls every
30 seconds, rebuilding when the ready visibility generation changes or the
snapshot exceeds 15 minutes. Pending/failed privacy work prevents rebuilding;
resolve that first using the privacy convergence runbook.
HTTP requests never run this analytical rebuild.
Defaults in .env.example bound the source to 500,000 distinct scoped packets
within 92 days and 100,000 nodes; unscoped evidence is capped at three times
the node limit. SQL has a 120-second statement deadline and publication has a
five-second lock deadline. The supervisor kills the child after 180 seconds
(SIGTERM, then SIGKILL after two seconds). Compose limits the combined worker
to one CPU and 1 GiB without swap; parent/child V8 heaps are capped at
128/640 MiB. Source row caps do not promise a fixed byte size: pathological
rows can still exhaust the child, which fails without publishing partial data.
Failures retry with exponential backoff, capped at five minutes; a newer
ready generation can retry immediately. Capacity/decode failures retain the
last committed snapshot. If its privacy certificate is old, APIs continue to
withhold it. Inspect worker logs and the source counts before changing
REGION_SCOPE_MAX_PACKETS, REGION_SCOPE_MAX_NODES, the window, or deadlines;
qualify any higher limit against available memory and database load. All
settings have finite clamps in backend/src/regions/rebuildSettings.ts.
The worker explicitly allows a complete empty public corpus to replace an old
snapshot after privacy convergence. The manual regions:rebuild tool requires
REGION_SCOPE_ALLOW_EMPTY=1 for that operation. Both paths reject a nonempty
corpus when no packet decodes. A session advisory lock excludes competing
publishers, including manual invocations; process death releases the lock.
Metrics expose health, publication time, running state and fixed worker outcomes on container port 9091. The local development helper binds this worker's metrics to loopback port 9092; that helper is separate from the live Compose overlay's Prometheus port.
Legacy schema-16 compatibility cutover
An existing database that has 016_stale_mqtt_observer_cleanup.sql but not
016_private_prefixes.sql deliberately fails closed. After a signed backup and
isolated restore preflight, run the one-time reviewed compatibility path:
docker compose run --rm \
-e MIGRATION_016_PRIVATE_PREFIXES_APPROVAL=supersede-016-and-017-with-authoritative-privacy-and-026 \
db-migrate
The runner requires the exact sibling migration and both replacement files,
records superseded-existing for the unsafe historical rewrites, and installs
the prefix schema/trigger replacement before a new backend starts.
Authoritative public predicates validate path framing and consult the current
private-prefix table for historical as well as new packets. This avoids
decompressing or rewriting Timescale history. It also does not rewrite every
historical packet merely to materialize a topic prefix; public query predicates
safely derive the prefix from topic when the legacy column is empty. Read back
the decision before continuing:
SELECT migration_name, disposition, replacement_name
FROM schema_migration_compatibility
WHERE migration_name = '016_private_prefixes.sql';
Never set this approval on a fresh database or for any other missing migration.
Metrics
The provisioned MeshCore — Public performance dashboard shows bounded public
route p95, selected cache hit ratios and anonymous document LCP/CLS/INP samples.
Browser metrics arrive at /api/telemetry/web-vitals; the endpoint accepts only
six fixed public paths, a metric name and a bounded numeric value. Reports omit
cookies, referrers, query/hash values, identifiers and interaction attribution.
They update aggregate process metrics and create no database rows.
Prometheus scrapes the backend registry from backend:9091/metrics on the
internal Compose network. Port 9091 is deliberately not published by Compose or
proxied by Nginx; /metrics on a public website origin must return 404.
The browser sends at most one sample per metric per document and supports
?telemetry=off. Samples remain attributed to the initial document route across
client-side navigation. INP is absent until a real interaction is observed; lab
navigation results do not substitute for field INP. Check sample counts and
delivery after deployment before interpreting percentiles. Public samples are
diagnostic input, not authenticated availability or release-gate evidence.
The first reported lifecycle sample is retained; interactions after returning
to an already-backgrounded document do not produce additional samples.
PublicRouteP95High
This warning requires at least 100 successful requests in five minutes and a server-observed p95 above one second for ten minutes. Inspect the affected fixed route, SQL plans, backend queues and cache outcomes. Compare against the qualified fixture and current visibility generation before changing query or cache behavior. The operational warning threshold does not replace the tighter before/after performance qualification budgets.
PublicCacheHitRateLow
This warning covers api_stats, api_charts, topology_dto and stats_observer.
It requires at least 100 lookups in five minutes and a hit ratio below 20% for
15 minutes, including a cache that has never recorded a hit. Check expiry,
scope distribution, concurrent refresh failures and privacy-generation churn.
Preserve the fresh authority/publication fences while diagnosing invalidations.
Health endpoints
GET /healthzis a process liveness check. It deliberately remains healthy during an MQTT outage so Docker does not restart an otherwise functioning API in a loop.GET /readyzchecks database access and MQTT connectivity. It returns503with per-dependency state when the real-time platform is not ready.GET /api/healthreturns worker history and a top-levelstatus(healthy,degraded, orcritical) plus machine-readableproblems.
Current problem codes cover stale public ingest, worker queue backlog, disk pressure, and frontend error spikes. External monitoring should alert on readyz failures and critical /api/health problems, while allowing a short deploy/reconnect grace period.
The synthetic-monitor service independently checks liveness, dependency readiness, the scoped stats API, and delivery of a WebSocket initial_state. Results and latency are retained for 14 days in operational_check_results. Three consecutive failures trigger a structured log alert and, when ALERT_WEBHOOK_URL is configured, a JSON webhook. A successful check after an alert emits a recovery notification.
Load checks
Run bounded HTTP load locally with:
cd backend
npm run load:realtime -- --duration 30 --concurrency 25 --max-p95-ms 1500
Use --mqtt-messages 5000 to exercise MQTT ingest backpressure with isolated, rejected test envelopes, and --slow-ws-clients 10 to hold non-reading WebSocket clients during the run. MQTT mode uses MQTT_BROKER_URL, MQTT_USERNAME, and MQTT_PASSWORD; never point it at a broker outside the deployment under test.
The internal HopReach compatibility load path is covered by
backend/src/api/hopreachCompatibility.test.ts. Its UK-size test performs ten
pages over 4,600 nodes, 32 concurrent calibration requests, a cold pass, and
verified cache hits/coalescing without exposing the adapter publicly.
Statistics aggregate rollout
packet_hourly_stats is maintained atomically with accepted packet batches.
Populate historical hours with a resumable, one-hour-per-transaction tool:
docker compose exec backend node dist/tools/backfillStatsRollups.js --hourly-days 8
docker compose exec backend node dist/tools/backfillStatsRollups.js --apply --hourly-days 8
The first command is a read-only inventory. The checkpoint and the rollup
slice commit together, so interruption resumes without double-counting. The
STATS_AGGREGATE_READS_ENABLED and STATS_AGGREGATE_SHADOW_ENABLED settings
accept comma-separated network names; true retains the all-network mode.
Start with STATS_AGGREGATE_SHADOW_ENABLED=ukmesh while reads remain disabled.
The bounded aggregate query and its legacy comparison run off the response path
even in this shadow-only mode. Set STATS_AGGREGATE_READS_ENABLED=ukmesh only
after backfill and a clean parity window. Once the
aggregate-writing backend is live, reconcile the partial cutover hour:
docker compose exec backend node dist/tools/backfillStatsRollups.js \
--apply --catch-up-current-hour
The reconciliation closes the bounded gap between the completed historical checkpoint and now one hour at a time, including the current partial hour. Each slice takes a writer lock with a five-second lock timeout and fails closed; a gap above 48 hours requires a newly reviewed historical backfill. Transactions that arrive during a rebuild increment the reconstructed rows after its lock is released.
A short validation window may set
STATS_AGGREGATE_SHADOW_ENABLED=ukmesh. The comparison pins one cutoff, scans
the recent source rows once, and runs off the response path with one in-flight
comparison per scope and a five-minute minimum interval. Dimension keys must
match exactly. Count differences may be at most five packets or 0.1%,
whichever is larger, to allow a transaction that commits between the two
snapshots. Treat any [stats-aggregate-shadow] mismatch or
[stats-aggregate-shadow] failed as a failed rollout and turn aggregate reads
back off. Shadow mode deliberately adds a raw validation scan and must not
remain enabled.
Chart queries also share one asOf cutoff. STATS_QUERY_DURATION_BUDGET_MS
defaults to 60 seconds, STATS_CHART_QUERY_TIMEOUT_MS defaults to 120 seconds,
and STATS_CHART_MAX_RESULT_ROWS defaults to 100,000. A query that exceeds a
budget fails the chart refresh and is logged with a [stats-query-budget]
record; the existing stale snapshot remains available. The result-row limit is
an output-size guard. It does not measure rows scanned inside PostgreSQL, so
keep reviewing query plans and database scan telemetry before enabling reads on
additional networks.
Production aggregate reads combine maintained full-hour rows with raw boundary fragments, preserving the legacy exact rolling 24-hour/seven-day windows while keeping raw work bounded to partial hours.
Canonical chart responses are also stored in stats_chart_snapshots after
completeness, scope, age, privacy-generation, and 2 MiB payload checks. Schema
version 2 snapshots survive a backend restart: a fresh snapshot is returned
directly, and a stale snapshot remains available for up to six hours while one
refresh runs in the background. Newer snapshots cannot be overwritten by an
older concurrent refresh. A public/private visibility change immediately
invalidates both memory and durable entries, and a generation publication fence
prevents an in-flight old computation from being cached. Observer-filtered chart
responses are never persisted.
For the first migration to durable snapshots, capture a current successful canonical response from the still-running release and pipe it to the candidate backend tool after migration 031 has been applied:
npm run stats:seed-chart-snapshot -- --network ukmesh < verified-ukmesh-charts.json
The tool reads JSON only from stdin and rejects incomplete, cross-scope,
future-dated, more-than-six-hour-old, oversized, or pre-visibility-change input.
It binds the response to the current generation and fails if that generation
changes during publication. Verify the stored scope_key, schema version,
visibility generation, generated_at, and payload byte count before restarting
the serving backend. Do not seed an observer-filtered response.
HopReach RF coverage
The app serves only meta.json, progress.json, and numeric PNG tile paths
under /rf-coverage/. The private compatibility adapter is mounted at
/hopreach on the backend container and rejects forwarded/public traffic.
Legacy /api/coverage and /api/coverage/planned contracts return 410 Gone
without querying node_coverage or creating work.
Use the HopReach rollout and recovery runbook for
source publication, benchmark gates, deployment order, progressive live
verification, checkpoint restart tests, and rollback. Do not delete the
rf_coverage_data volume or DEM cache to recover a failed run.
Topology API
GET /api/topology?network=ukmesh&limit=300 returns recent viable repeater relationships, bounded to 500 links and a 30-day observation window. It reports connected components, recently active isolated repeaters, and articulation points labelled as likely bridges because the bounded graph is evidence rather than a complete routing model. Private-node names and positions pass through the same redaction policy used by the node APIs.
Public API and exports
GET /api/v1 is the stable discovery endpoint and links to /api/v1/openapi.yaml. Positioned nodes can be exported from /api/v1/exports/nodes.csv and /api/v1/exports/nodes.geojson; both formats are read-only, rate-limited, capped at 5,000 rows, network-scoped, and use the public-node redaction policy.
GET /api/activity/timeline is bounded to a 24-hour window and 250 active node IDs per bucket. GET /api/rf-validation compares stored terrain-model viability with recent observed evidence and distinguishes likely mismatches, weak evidence, and explicit operator overrides.
Public status and maintenance
The machine-readable /api/health contract includes the configured
MAINTENANCE_ACTIVE=1 and bounded MAINTENANCE_MESSAGE notice. The former
website /health page was removed; public navigation links to the separate
health-check application. Keep maintenance text free of hostnames, credentials,
addresses and private node identities.
Operational runbooks
- Immutable release and rollback
- Encrypted backup, isolated restore, and disaster recovery
- Bounded queue and dead-letter recovery
- SRTM cache, alert delivery, observer review, and planned publication
- Database compression and retention gates
Owner authorization baseline refresh
/readyz validates owner accounts, grants, configured grants and ACL evidence
against OWNER_AUTH_INVENTORY_BASELINE_PATH. Unexplained inventory or permission
drift fails closed. A verified transition limited to public-feed read permissions
can converge without replacing the baseline; see the exact certificate rules.
Review approved grant changes before generating a replacement baseline.
-
Identify the change from the audit trail and confirm it was approved:
docker exec -e PGOPTIONS='-c default_transaction_read_only=on' \ meshcore-infra-timescaledb-1 psql -U meshcore -d meshcore_owner_auth -X \ -c "SELECT occurred_at, event_type, source, actor FROM owner_grant_audit \ WHERE occurred_at > now() - interval '30 days' ORDER BY occurred_at DESC" -
Generate and validate a fresh baseline with the running image (read-only against the database; it only writes the new baseline file):
scripts/refresh-owner-baseline.sh -
Activate it after reviewing the printed counts/generations:
scripts/refresh-owner-baseline.sh --apply --recreate curl -fsS http://127.0.0.1:3000/readyz
The script refuses to overwrite an existing baseline, backs up .env before
editing, keeps the previous baseline for rollback, and validates the new file
against the live inventory before activation. To roll back, point
OWNER_AUTH_INVENTORY_BASELINE_PATH at the previous file and recreate the
backend.
Use the /operations, /observer-registrations, and operator audit pages for
normal mutations. They enforce authorization, CSRF, typed confirmation,
idempotency, capacity, and audit rules that direct Redis/SQL edits bypass.
Alert first response
Start every alert response by recording the firing time, checking Prometheus
target state, and preserving the relevant ten-minute logs. Acknowledge only
after assigning an operator. The following headings are stable targets for the
Prometheus runbook_url annotations.
BackendDown
Check docker compose ps backend, then backend logs and the container OOM/exit
state. If the process is stopped, restart only backend; if it repeatedly
fails, keep ingest stopped and roll back to the prior signed digest.
BackendNotReady
Read /readyz and act on the named dependency. Check PostgreSQL, Redis, and
Mosquitto before restarting the API. Liveness remaining green is expected
during a dependency outage.
checks.mqttConnectionMonitor reports broker-log read and audit-write failures
when MQTT ingest is enabled. init:EACCES or poll:EACCES means the backend
cannot read MOSQUITTO_LOG_PATH; inspect that mount's ownership and permissions.
audit:<code> means an observation could not be persisted. Idle log polls do
not clear that failure; a later successful audit write does. Logs remain
audit-only and never grant node ownership. An inaccessible/missing log degrades
readiness and reaches the existing two-minute BackendNotReady alert.
Ingest SQL uses a separate two-connection pool with a 10-second server statement
timeout. MQTT_INGEST_STATEMENT_TIMEOUT_MS accepts 100–30000 ms; the general
DATABASE_STATEMENT_TIMEOUT_MS cannot disable or extend this ingest bound.
[ingest-db] query timed out and
meshcore_db_queries_total{pool="ingest",outcome="timed_out"} identify cancelled
statements without exposing SQL or packet contents. The client read fallback
has one second of grace; transaction sockets that hit it are discarded.
Failed durable packet writes remain unacknowledged, and failed RAM-writer
commits remain pending for retry.
SyntheticProbeFailed
Compare the failing blackbox target with direct localhost liveness, stats, and WebSocket checks. If localhost succeeds, inspect Nginx, Anubis, Cloudflare and DNS in that order; do not restart the database.
DependencyExporterDown
Check the named exporter and its dependency independently. An exporter-only failure loses visibility but does not prove PostgreSQL or Redis is down. Restore telemetry, then verify the underlying dependency metric.
MosquittoUnavailable
Check broker health, its WebSocket listener, password/ACL file permissions and the reloader logs. Do not regenerate credentials over an existing set. If ACL reconciliation caused the alert, keep the last verified ACL and roll back that change.
Denied PUBLISH on /raw (#269 / #213)
Disposition: /raw is an unsupported secondary publication. Keep the
restricted ACL and fix the publisher. The separate meshmonitor-observer EXT
family published supported /packets and /status topics: its historical
denials were an onboarding/grant gap. The earlier version of this runbook
incorrectly called that family /raw noise.
The 2026-10-23 evidence review records exact
keys, clients, commands, windows, and counts. Four retained broker archives
contain 2,356 /raw denials from ESP32_a806F8, on
meshcore/LBA/8CA23B78908F366D2D9F63EFE4A5726D685332FD3EC9AFF1B3B6CFF22EC2AE8A/raw.
The dated review's current-log snapshot contained zero further denials from
that client; these counts are historical, not current host readback.
Accepted /packets messages for the same key are present in the archive.
In that dated review, meshmonitor-observer-nevrg6ol authenticated as nick. It had
zero denied publishes in the retained files and accepted packets on
meshcore/EXT/67969D8FF8A2DE6FFF873638CCAB3F70E38111BE3BD599F75E9D21D907B217B5/packets.
The ACL inspected for that review granted this key's packet/status/neighbor topics. Historical
broker output preserved in shared memory shows meshmonitor-observer-qy92lten
denied on this key's /status and /packets topics; it does not establish a
current fault. EXT is a valid IATA covered by the ACL's + segment.
The renderer in backend/src/mqtt/aclManager.ts grants owner writes to
packets, status, neighbors, and neighbours. backend/src/mqtt/topic.ts
accepts those suffixes and rejects /raw. Packet bytes are carried in the
raw JSON field on the /packets envelope and decoded in
backend/src/mqtt/client.ts; there is no /raw topic consumer. Granting the
extra suffix would authorize a broker topic that the backend does not ingest.
Mick / ESP32 operator: disable the secondary send to the exact /raw topic
above in the publisher's topic configuration. Keep
meshcore/LBA/8CA23B78908F366D2D9F63EFE4A5726D685332FD3EC9AFF1B3B6CFF22EC2AE8A/packets
and its existing JSON envelope, including the raw hex field, and retain status
and neighbor publication. If the firmware has no per-topic switch, ask its
maintainer to remove the secondary /raw send; a firmware-specific switch has
not been verified. Do not send a bare hex payload to /packets. Check fresh
broker logs after the change: accepted packets should continue and /raw
denials for this client should cease. No credential or owner grant change is
needed for this optional, unused output.
Nick / meshmonitor operator: retain username nick and base topic
meshcore/EXT/67969D8FF8A2DE6FFF873638CCAB3F70E38111BE3BD599F75E9D21D907B217B5;
publish the normal JSON envelopes on /packets and /status. The current
evidence requires no client change. If supported topics become denied again,
confirm the actual device key and username, then have an operator review the
existing owner grant and approved registration/provisioning workflow.
The reviewed grant must cover that exact key; broker connection success alone
does not grant publish permission. Verify the reconciler's rendered ACL and
fresh accepted messages after any approved correction. Avoid duplicate
accounts, automatic grants from logs, and edits to the managed ACL.
Visibility: the backend connection monitor reads the broker log's existing
read-only mount. Every parsed denial increments
meshcore_mqtt_denied_publishes_total{kind,phase}. kind is one of raw,
packets, status, neighbors, neighbours, or other; phase is history
or live. Client IDs, usernames, and topics appear only in the backend's
[conn-monitor] denied publish JSON log records, with a per-scan occurrence
count. Repeated client/topic/username groups coalesce within a scan. At most 64
groups are logged per scan; excess occurrences are reported as
denied publish details omitted and still counted by the metric. Detail fields
are capped at 512 characters with truncated=true; use the broker source log
for full longer values. Missing or expired connection context gives a null
username and does not suppress telemetry. These observations cannot grant
ownership or change the ACL.
Use sum by (kind) (increase(meshcore_mqtt_denied_publishes_total{phase="live"}[10m]))
to inspect recent recurrence, then find the exact client and topic in backend
logs. History scans replay at startup (at most the last 50 MB); exclude
phase="history" from live recurrence queries. These are counts of log
observations, not durable, lifetime broker totals. The monitor polls every two
seconds by default and depends on readable broker logs with denial logging
enabled. Supported-topic denials need grant/configuration investigation;
/raw needs the publisher correction above. Reopen the /raw policy only if
the ingest contract deliberately adds a consumer for it.
MeshIngestSilent
Check backend MQTT readiness, broker connected-client events, public topic rates, and whether this is a genuine quiet period. Compare independent observers before changing credentials or subscriptions.
QueueAgeHigh
Open /operations, identify the oldest queue and heartbeat, then follow the
queue recovery runbook. Fix the worker/dependency cause before requeueing a
single retained dead job.
QueueCapacityHigh
Disable the affected optional link producer if growth continues. Confirm the worker is consuming and the byte/job counters are consistent. Never make Redis eviction-based or raise the cap without measuring host memory.
DeadJobsPresent
Inspect each bounded reason and attempt count in /operations. Requeue only
transient failures after the cause is fixed; purge one permanently invalid job
with the exact confirmation string.
AnalysisLeaseLost
Preserve both worker logs and the analysis run record. The publication fence prevents a stale writer from committing. Let the current lease expire, resume from its checkpoint, and investigate clock, database, or long-step latency.
HealthWorkerHeartbeatStale
Check the health-worker container, database reachability, and its last
successful snapshot. Restart only that worker; public health may be stale but
the API should remain available.
RegionSnapshotUnavailable
The region worker has reported no fresh privacy-certified snapshot for ten
minutes. Check region-snapshot-worker logs, its last publication timestamp,
and privacy readiness. Resolve pending privacy work first. Investigate source
capacity, decode failures, statement deadlines or child memory failures before
tuning limits. Restarting cannot make an old privacy certificate valid; keep
the API's withholding behavior until a complete rebuild succeeds.
WorkerMetricsDown
Identify the role label, inspect that worker's health endpoint and container
state, and restart only the affected worker. If work is queued, treat a stale
heartbeat as the higher-priority symptom.
ActiveQueueWorkerHeartbeatStale
The link worker publishes a Unix timestamp to Redis every ten seconds with a
45-second TTL, independently of ITM output (which can have roughly 50-minute
gaps). Each metrics scrape reads that key; an expired, unreadable or invalid
heartbeat exports -1. With queued work on the same job/instance, an age
above 45 seconds or -1 must persist for three minutes to page. With 15-second
scrapes and rule evaluations, a stopped publisher should page within about
four minutes of its last heartbeat. A brief read failure resets on recovery;
an idle queue does not page. Do not raise this limit to match ITM publication.
Stop new optional work, confirm the queue retains its leased payloads, and restart the affected link worker. Allow lease recovery to requeue; do not manually duplicate the job.
DatabaseUnavailable
Check TimescaleDB container state, disk, memory, and recent logs. Stop writers if storage errors appear. Never recreate or delete the volume; escalate to the signed backup/restore runbook.
If a scheduled Timescale policy logs failed to start a background worker,
compare SHOW max_worker_processes with
SHOW timescaledb.max_background_workers. The Compose default reserves 24
PostgreSQL worker slots for the image's current 16-worker Timescale setting,
its launcher/database schedulers, and logical-replication headroom. Correct the
configuration and restart only TimescaleDB; then require the policy's next
manual or scheduled run to succeed before closing the incident.
DatabasePoolSaturated
Inspect waiting/active connection metrics, slow route latency and PostgreSQL activity. Shed optional analysis/load, identify the bounded slow query, and avoid increasing pool size until connection and memory headroom are measured.
DatabaseVacuumBacklog
Inspect the relname table label, n_dead_tup, n_live_tup, and recent
autovacuum activity in PostgreSQL. A table with more than 50,000 dead tuples
is actionable even when its live-row estimate is small (as can happen for a
TimescaleDB chunk after deletes); run the reviewed bounded vacuum procedure and
confirm that both the alert and /api/health clear. Do not drop chunks or
delete the database volume as a response.
DatabaseWalRateHigh
Identify current maintenance, backfill, compression or ingest activity. Pause the optional writer and check replica/backup capacity. A short known migration burst may be observed; sustained unexplained WAL is an incident.
HostDiskSpaceLow
The existing node-exporter rule includes the data filesystem and fires at 90% usage (10% available or less) sustained for ten minutes. Configured-volume health separately warns at 80% of a directory budget and is critical at 90%; that budget measurement is not the host filesystem's free-space measurement.
Stop optional RF/backfill work and identify the mount from the alert. Preserve databases and signed backups. Prune only explicitly identified unused build cache/images or let the bounded SRTM/log policies converge; never run a broad volume prune.
HostDiskExhaustionForecast
Treat a sustained forecast of disk exhaustion within 24 hours as an incident before the low-space threshold fires. Identify the filesystem and its largest consumers, compare the database hypertable and chunk growth gauges, pause optional backfills, and preserve backup capacity. Do not remove database chunks or volumes to make space; follow the signed backup and lifecycle gates.
CoreTelemetryGrowthHigh
Compare the per-table byte and chunk gauges with the retention and compression
policies, then run the read-only npm run db:lifecycle inventory during a low
traffic window. Check for missed retention/compression jobs and forecast the
next 30 days of disk use. Changes to destructive retention require the current
signed backup/restore receipt and the per-table approval in docs/db-lifecycle.md.
CoreTelemetryRetentionOverdue
Use read-only queries against timescaledb_information.jobs and
timescaledb_information.chunks to identify the missing or failing policy for
the labelled table. Verify backup and isolated restore evidence before running
the gated per-table lifecycle command. Keep expired forensic access isolated
and read-only; never expose restored expired rows through production APIs.
CoreTelemetryCompressionOverdue
Inspect the labelled table's compression policy and Timescale job history, as
well as worker capacity and recent database/WAL pressure. Apply compression
only through the per-table, receipt-gated command in docs/db-lifecycle.md.
PacketPathsCapacity
Compare the health-worker meshcore_packet_paths_rows_30d,
meshcore_packet_paths_bytes_per_row, and overdue-chunk gauges with the
reviewed 10,000–23,000 rows/day and roughly 1 kB/row baseline. If compression
is overdue, inspect the packet_paths compression job and Timescale worker
headroom; never add a retention job for this table. For genuine growth, forecast
the next 12 months against free disk before changing storage or ingest policy.
Durable MQTT ingestion
The MQTT client uses the library's inbound message callback for backpressure;
QoS 1 PUBACK follows successful database persistence. A database failure is
returned as a handler error, leaving the broker delivery unacknowledged for
redelivery and keeping readiness failed until a durable write succeeds. Inspect
the failure, packet_persist_failure, status_persist_failure, or
neighbors_persist_failure ingest outcomes and resolve the database issue;
do not clear the broker session or discard its inflight delivery.
BackupReceiptMissing
Check the receipt mount, signature/key permissions, and backup job result. Create a new encrypted backup and complete an isolated restore drill. Do not enable destructive retention while evidence is missing.
BackupStale
Run the backup immediately, verify the signature/checksum, and perform the isolated drill. Investigate target capacity or scheduling after a fresh verified receipt restores the recovery guarantee.
TelemetryIntegrityFailures
Inspect aggregate rejection reasons and a bounded redacted sample. Treat private/cross-network leakage as an immediate rollback condition. Otherwise identify the malformed observer/client version without weakening validation.
Spring-clean additions (2026-08-06)
MQTT ingest resilience
The MQTT client keeps a stable clean=false QoS-1 session and uses MQTT.js
message handling as the backpressure boundary. It sends PUBACK only after
packet, status, or neighbour persistence completes. Persistence failures are
propagated to MQTT.js and close the connection without PUBACK so the persistent
broker session redelivers the message. The process-local packet dedupe marker
is written only after packet-batch commit. The broker session is
meshcore-analytics-ingest (Mosquitto reports c0).
Feed history contract
GET /api/feed/messages?channel=<scope>&limit<=50 — up to 50 unique
historical messages per public channel, a query upper bound of 90 days, dedup
by packet hash. Actual availability is limited by the 30-day content-retention
policy and retained rows. Uses an
ordered keyset-paginated packet scan (100-row pages and bounded distinct-hash
selection, with oversampling before the final public projection to 50 rows) so it stays fast under TimescaleDB load; observer-stat
aggregation is bounded on the history path only (live WS path keeps full
aggregation). UI merges history under live WS messages; initial_state
still delivers 200. See docs/decryption.md for the join.
Canonical node identity
Evidence-based identity merging is live (docs/node-identity.md,
migrations 036/037). Owner dashboard shows one entry per canonical identity
with the merged member key list.
Spring-clean UI removals
- Site
Healthpage removed (StatusPage +/healthroute + legacy/status → /healthredirect + nav entry/flag). The separatemeshcore-health-checkapp (healthcheck.ukmesh.com) is unaffected. - Owner dashboard collapsed to a single page; alert-settings tab and the unused "coming next" roadmap payload removed end-to-end (backend, types, CSS).
- Live map feed cards are message-first with compact metadata; stale repeaters (no recent advert/status AND no multibyte-hop evidence) are filtered from the map; MQTT repeaters render like normal repeaters.
- Spam transparency page verified working (live API) and kept.
MosquittoBacklogOverflow
The qualified profile keeps the 10,000-message per-session ceiling, adds a
32-MiB queued-byte ceiling and rejects MQTT frames larger than 1 MiB. These
settings reload with SIGHUP. Debug packet logging is disabled. The October
measurement was approximately 198 incoming messages/minute and 105 KiB/minute;
the count ceiling corresponds to about 50 minutes at that observed aggregate
rate, before bursts or changes in subscription fanout. This is an observation,
not a guaranteed outage window. An owned 6,000 x 600-byte offline QoS 1 fixture
replayed completely; a 400 x 128-KiB overflow fixture delivered 256 and exposed
144 drops through $SYS/broker/publish/messages/dropped.
MosquittoBacklogOverflow alerts on any increase of the dropped-publication
counter. Restore the consumer and reconcile persisted observations; a
publisher PUBACK alone does not establish delivery to every subscriber.
MosquittoBacklogHigh warns at 7,500 aggregate stored messages. Inspect individual
sessions and byte pressure as well; a few large messages can reach the byte
ceiling first. Do not claim unlimited replay from finite queues.
Observation ledger lifecycle
The hot ledger retains at least 60 days of creation-time history. A bounded
Timescale job examines at most 5,000 earliest rows every five minutes and moves
eligible metadata atomically into ingest_observation_archive. Archives are
compressed after 14 days in the archive. ingest_observation_history is the
complete sequence/history interface across hot and archived rows. UUID guards
remain permanent in ingest_observation_tombstones, so old and current SQL
writers both reject archived replays. Never prune that guard or archive as an
ordinary retention task. The archive job does not delete packet paths,
aggregates or observation history.
Canonical advert dedupe keys and immutable message classifications remain permanent semantic state. They are deliberately not given a blind TTL; a replayed advert must not increment its total again, and an immutable message hash must retain its classification. Queue dead letters remain until resolved. Normal packet/content retention, compression, signed backups and the host disk exhaustion forecast continue to apply. Compression reduces retained metadata; it does not make an infinite exact identity history occupy bounded disk.
MqttBrokerBacklog
Full local DEV subscribes to the three exact Mosquitto system topics for
stored messages, stored bytes, and dropped publications. An external broker
can opt in with MQTT_BROKER_BACKLOG_MONITOR=true and read grants for those
topics. Backlog metrics are broker-wide and include retained messages.
The warning uses half of the local 10,000-message or 16 MiB per-session capacity as an early indicator. A rise in dropped publications is critical. Check the subscriber's commit and PUBACK rates, the active stored message count, and the broker log before retrying a session. Keep the persistent session and its storage intact. Confirm any suspected gap against committed observations. A publisher's PUBACK measures broker acceptance.
MqttDeliveryStalled
The ingest connection publishes a non-retained QoS 1 nonce every 30 seconds on a reserved system topic under its configured MQTT prefix. The envelope is consumed before application parsing and never becomes observer or packet data. A probe must return on that same persistent subscriber session within 60 seconds. QoS 0 traffic and successful socket keepalives cannot satisfy this check.
A timeout marks /readyz unavailable and /api/health critical, and reconnects
the client with its existing client ID and clean=false, preserving queued
messages. Recovery attempts are limited to one per five minutes. Prometheus
alerts if the delivery probe remains unhealthy for two minutes. Inspect
meshcore_mqtt_delivery_probe_healthy, the last-success timestamp, recovery
count, and meshcore_mqtt_wire_ack_duration_seconds_count.
Every reconnect explicitly subscribes again and waits for actual SUBACKs before
starting the probe. MQTT.js automatic resubscription is disabled so its cached
empty subscription result cannot be mistaken for an ACL denial. The backend's
40-second container stop grace allows its 30-second durable drain to finish;
keep BACKEND_STOP_GRACE_PERIOD longer than any custom shutdown deadline.
If the session remains stalled after reconnect, preserve the Mosquitto data volume and perform a controlled broker restart. Never clear the persistent session or change the ingest client ID to discard the backlog. Confirm that QoS 1 acknowledgements resume and status samples advance. Replayed status measurements keep their source timestamp; expired samples, offline Wills and undated retained status cannot renew observer presence.
Observer activity at /api/stats/observers/live is privacy-filtered and scoped
to the last 15 minutes, with a bounded 60-second cache. The Stats page refreshes
this independently of historical charts. Charts regenerate every 30 minutes
in the background; the previous complete snapshot remains available during
refresh, and the page displays its generation time rather than its fetch time.