# 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: ```bash 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: ```bash 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 ` 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 Anubis signing key. For a local Health Check image build, initialise the pinned submodule and use `bash scripts/healthcheck-source.sh --verify` for `HEALTHCHECK_SOURCE_REF`. 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](privacy-convergence.md) 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](privacy-convergence.md). HTTP requests never run this analytical rebuild. The worker reads the entire 92-day window in a single repeatable-read snapshot. Each SQL unit takes up to 32,768 index entries, or fewer when `REGION_SCOPE_MAX_PACKETS` is lower. All observations sharing its last hash stay together. The ordered reducer spans all units. The worker caps nodes at 100,000 and unscoped elements at three times the node limit. Each unit has a 120-second deadline and publication has a five-second lock deadline. The supervisor allows 180 seconds between completed units and at most 12 minutes overall (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. A due public chart refresh and the signed release chart preflight can take the shared analytics slot after the region worker finishes a packet range. During that handoff the region worker keeps its source snapshot, reducer and publisher lock. Its per-unit timer resumes when it reacquires the slot. The 12-minute total deadline includes the handoff. Readers receive an existing same-generation snapshot immediately while a single refresh waits for the next checkpoint. Full DEV startup starts ingress first and prepares charts before starting a new region worker. A chart preflight failure still starts the worker and leaves startup failed. 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: ```bash 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: ```sql 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 /healthz` checks whether that process is serving HTTP. - `GET /api-readyz` checks the API's database connection. Docker uses this for the `backend` container. - `GET /readyz` on the API checks database access, MQTT intake and owner authorization. It returns `503` when a dependency is degraded. The `mqtt-ingest` container checks its own database connection and broker transport at its private `GET /readyz` endpoint. - `GET /api/health` returns worker history and a top-level `status` (`healthy`, `degraded`, or `critical`) plus machine-readable `problems`. 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: ```bash 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: ```bash 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. Public chart responses and stored snapshots always use the visibility-filtered packet source. Snapshot version 3 expires previous results that may have included private counts. The hourly rollup combines public and private packets in the same buckets. Use the read switch for isolated repository benchmarks and the shadow switch to compare counts in a running service. Once the aggregate-writing backend is live, reconcile the partial cutover hour: ```bash 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. When a refresh fails, public requests can reuse the last complete snapshot for the same network and privacy generation. The next request can retry after one minute. Consecutive failures double that interval up to five minutes. A new privacy generation or a backend release preflight can refresh immediately. Public chart routes compute counts from visibility-filtered packet rows. The hourly rollup is available to diagnostic and shadow comparisons. Canonical snapshots survive process restarts in `analytics.stats_chart_snapshot_versions`, keyed by network and schema version. The current schema is version 4. A fresh snapshot serves immediately. An older snapshot from the same visibility generation can serve while one refresh runs. Publishing checks the generation again and preserves the newer snapshot when refreshes overlap. A policy change invalidates both memory and durable entries. Observer-specific results stay outside this shared store. To restore a chart snapshot, capture a complete canonical network response from a release using the same chart schema and visibility generation. Run the import tool against the migrated database: ```bash npm run stats:seed-chart-snapshot -- --network ukmesh < verified-ukmesh-charts.json ``` The tool accepts a network-wide response generated after the current policy change, within six hours. It checks the original schema and generation and rejects observer or section projections. After a schema or generation change, generate a fresh canonical response on the candidate. Verify its schema version, generation and timestamp before directing traffic to the new instance. ## 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](rf-coverage-rollout.md) 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 moved to `/health-check`. This route embeds the Health Check service and keeps the site navigation visible. Keep maintenance text free of hostnames, credentials, addresses and private node identities. ## Tagger service The tagger defaults to Jev. Set `TYPESAFE_API_URL`, `TYPESAFE_API_KEY` and `TYPESAFE_MODEL` for that service. To use a local model endpoint, set `TAGGER_BACKEND=local`, `TAGGER_URL` and `TAGGER_MODEL_ID`. Supply `TAGGER_API_KEY` when the endpoint requires authentication. The full DEV overlay selects its own local fixture endpoint. ## Operational runbooks - [Immutable release and rollback](runbook-release-rollback.md) - [Encrypted backup, isolated restore, and disaster recovery](runbook-backup-restore.md) - [Bounded queue and dead-letter recovery](runbook-queue-recovery.md) - [SRTM cache, alert delivery, observer review, and planned publication](runbook-srtm-alerts-observers.md) - [Database compression and retention gates](db-lifecycle.md) ### Restart MQTT ingest or the API independently In DEV, use `scripts/dev-all.sh restart mqtt-ingest` for the broker-facing process, or `scripts/dev-all.sh restart backend` for HTTP and WebSockets. A restart uses the current built image. Verify `docker compose ps`, the relevant readiness check and recovery of the MQTT delivery probe after reconnect. For the first rollout from the combined runtime, recreate `backend` with the split-capable image first. Once the old process has exited, start `mqtt-ingest` with the same broker endpoint, username, client ID and persistent broker data store. For a rollback that returns to a combined image, stop `mqtt-ingest` before starting the combined backend. The DEV launcher checks this handoff. During an API restart, MQTT keeps committing observations. During an ingest restart, the broker queues eligible QoS 1 deliveries for the existing session. The offline guarantee requires the broker to retain that session and enough backlog capacity for the outage. Check queue depth, queued bytes and the drop counter. QoS 0 can lose messages in flight. Clients reconnecting to WebSockets receive the existing bounded initial snapshot and can use the HTTP packet history for earlier committed observations. ### MqttIngestDown The dedicated ingest readiness check is failing. Check `docker compose ps mqtt-ingest`, its broker connection and its database access. Keep the broker session and volume intact. If a targeted restart is needed, restart `mqtt-ingest` and verify that commit and acknowledgement counters advance. ### DEV recovery and storage The DEV database, broker, Redis, companion services, and LAN entry points use Docker's `unless-stopped` restart policy. An intentional stop remains in effect. Migration and initialisation jobs finish and exit. The main API and ingest services each keep their own restart policy and readiness check. The sample Redis service writes an append-only file to the `sample-redis` volume and syncs it once a second. Preserve that volume during a restart or rebuild. The MQTT durable commit boundary remains PostgreSQL. Restore Redis state from the old volume before switching an existing DEV installation from an anonymous volume. Local archive replay pauses below the qualification disk reserve of 10 GiB. It retains its cursor and resumes automatically once 10.5 GiB is available. `scripts/dev-all.sh replay status` reports `pauseReason: disk-reserve` when the guard is active. This pause applies only to the archive player. The broker and MQTT ingest keep running. Preserve databases, fixture stores and evidence when reclaiming disk space. WebSocket snapshots prewarm once on startup. After expiry, the first reader refreshes the snapshot. DEV permits two concurrent snapshot builds and reads the 24-hour message history through the analytics pool, leaving the HTTP pool available for interactive reads. The synthetic monitor still exercises full snapshot delivery. ### Rotate the ingest password on the current broker Mount a private directory as `MQTT_INGEST_PASSWORD_HOST_DIR` for MQTT ingest. The default is `deploy/mqtt-credentials`, which is excluded from Git and Docker builds. Keep the `password` file readable by the ingest user and writable only by the operator. A missing file leaves the environment credential in use. The file contains one UTF-8 password. It can end in a single newline. Apply the broker's password change and reload Mosquitto. Put the candidate password in a separate file in the mounted directory and rename it over `password`. The ingest process tests the candidate on a separate clean session with a QoS 1 round trip. On success it reconnects the existing persistent client and checks session resumption and delivery before reporting completion. Public HTTP and the packet processor continue running through the reconnect. A rejected candidate leaves the previous credential selected. A broker reload can close the previous connection. In that case, recovery with the old password also requires restoring it on the broker. Retain a protected copy of both files until the new session is verified. The file controls only the password. A different broker or MQTT principal requires a separate ACL and backlog handoff. The WebSocket and database privacy checks remain independent of the transport credentials. ### Add a verified MQTT owner Use `scripts/newuser.sh` from the managed deployment. Give it the exact node public key with `--confirm-owner-grant`. The script can create the broker credential and verify login before recording the owner grant. Broker log discovery alone supplies a fingerprint for review. Confirm every key being granted. The recorded grant is audited and stays pending until the running reconciler applies the ACL. The command verifies the active grant, generation and broker file. If it reports pending readback, retry the same explicit approval with `--watch` for the existing credential, or `--link` for an existing owner. Previously revoked grants require a separate reauthorization review. Normal provisioning completes through its own readback without a backend restart. Deployment readiness still compares any configured inventory baseline against the current policy. Promote approved evidence using the procedure below. ### 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](privacy-convergence.md#owner-acl-readiness-convergence). Review approved grant changes before generating a replacement baseline. The static website and map have their own health checks. MQTT or owner ACL problems can degrade `/readyz` while the site continues serving its HTML and assets. Owner login and protected owner routes return a retryable error if the initial ACL pass has not completed. The backend retries that pass separately from live ingest and public HTTP. `/readyz` remains the aggregate deployment and restore check. 1. Identify the change from the audit trail and confirm it was approved: ```bash 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" ``` 2. Generate and validate a fresh baseline with the running image (read-only against the database; it only writes the new baseline file): ```bash scripts/refresh-owner-baseline.sh ``` 3. Activate it after reviewing the printed counts and generations. Use a stable `OWNER_AUTH_INVENTORY_BASELINE_PATH=/owner-auth-inventory/current.json` for live activation. To adopt it, first seed `current.json` in the mounted host directory with the currently validated baseline, preserving its permissions. Apply that path to the backend once, using its existing image. Later updates can replace the file while the backend is running. ```bash scripts/refresh-owner-baseline.sh --activate-live ``` With a legacy versioned baseline path, use the existing activation flow. ```bash scripts/refresh-owner-baseline.sh --apply --recreate curl -fsS http://127.0.0.1:3000/readyz ``` The script validates the new file against the live inventory. Live activation preserves the active file's permissions and retains the prior bytes under a timestamped filename. The existing automatic baseline job uses live activation when `current.json` is configured and its narrow authorization checks pass. Roll back by restoring the corresponding approved owner policy and atomically replacing `current.json` with its reviewed baseline. The legacy activation instead backs up `.env` and repoints the path before recreating only 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. Restart only `backend`, or roll it back to a compatible signed API image if it repeatedly fails. Coordinate a session handoff before using a combined image from before the split. ### 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. Inspect backend logs and `meshcore_mqtt_connection_monitor_healthy` for broker-log read and audit-write failures. `init:EACCES` or `poll:EACCES` means the backend cannot read `MOSQUITTO_LOG_PATH`; inspect that mount's ownership and permissions. `audit:` 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](reviews/20261023-ukmesh-broker.md) 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](runbook-srtm-alerts-observers.md#observer-registration). 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`. Lean DEV defaults to 28 PostgreSQL worker slots and 21 Timescale workers. The Timescale limit covers the launcher, 16 schedulers and four concurrent jobs on the qualification VM. Count all databases with the extension installed and check the scheduled job overlap. Correct the configuration, restart TimescaleDB and 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. ### On-demand chart refresh failures If a client reports stale data, inspect the `snapshot.generatedAt` value from `/api/stats/charts` and look for `[stats] chart refresh failed` or `STATS_QUERY_BUDGET_EXCEEDED` in backend logs. Chart refresh runs on request. A refresh aborts the snapshot when a dimension exceeds its budget. Identify the slow dimension and measure it before changing its query budget. ### 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=&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 `Health` page removed (StatusPage + `/health` route + legacy `/status → /health` redirect + nav entry/flag). The separate `meshcore-health-check` app (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 ingest service'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 Packets view gets its filter options from `/api/feed/regions`, which lists public observer region codes seen in the past seven days for the requested scope. Historical charts refresh when a client requests `/api/stats/charts` and the snapshot is more than 30 minutes old. The previous complete snapshot remains available within its retention window during the refresh. Use its `snapshot.generatedAt` value to check when it was computed. ### ObserverRegistrationWebhookFailing Observer registrations are announced to the operator Discord webhook configured by `OBSERVER_REGISTRATION_WEBHOOK_URL`. Delivery is fire-and-forget: a failed notification never fails the public registration request, and the request stays in `core.observer_registration_requests` for the operator page. The backend exports `meshcore_observer_registration_webhook_deliveries_total{outcome}` with one increment per delivery attempt (two attempts per notification). An increase in `outcome="failure"` pages because the operator loses the timely notification even though the submission survives. Confirm the variable is still a valid Discord webhook (`GET` returns the webhook object), that the backend has outbound HTTPS, and that `backend/src/security/outboundWebhook.ts` is not rejecting the resolved address (private/reserved answers, non-443 ports and plain HTTP are refused by design). There is no retry after the second attempt; re-announce from the operator page if the request is still actionable. ### ObserverRegistrationWebhookSilent `ObserverRegistrationWebhookSilent` fires when at least one registration was accepted in the last six hours and no successful delivery was recorded in the same window. Its usual causes are an unset or empty `OBSERVER_REGISTRATION_WEBHOOK_URL` (the notification function returns without attempting a delivery, so the failure counter never moves), a rotated Discord webhook, or a DNS/egress failure. The absence of a successful-delivery series is treated as zero; never read it as "no submissions". Accepted and duplicate submissions are counted separately in `meshcore_observer_registration_submissions_total{outcome}`. Duplicates are deliberately not announced, so a burst of duplicates with no accepted submissions cannot page.