Node enrolled via install.sh never comes online if approved after install (Toughny) — no client-side key pickup, and re-run doesn't restart edge-node #14
Closed
opened 2026-10-04 00:50:57 -04:00 by logan
·
4 comments
No Branch/Tag Specified
main
feat/45-trunk-recorder
fix/44-upload-spool
feat/41-disk-reporting
fix/41-updater-prune
fix/discord-voice-join
fix/updater-safe-directory
fix/28-amd64-images
fix/18-install-token-argv
fix/19-image-tag-skew
feat/discord-system
feat/24-p25-conventional
feat/local-ui-usable
fix/14-15-provision-ota
feat/sdr-pins
feat/secondary-sdr-priority
feat/second-sdr-adsb-ais
feat/publish-public-images
fix/install-rerun-pickup
pulse-recorder
v1.1.0
v1
Labels
Clear labels
area/ai-pipeline
area/auth
area/billing
area/correlation
area/discord
area/frontend
area/governance
area/growth
area/infra-deploy
area/legal
area/map
area/mqtt
area/node-ota
area/osint
area/recording-audio
area/sdr-radio
area/transcription
board
board:agenda
Scene/entity extraction, summarizer, AI providers, embeddings
AuthN/Z, roles, tenancy/org scoping, API keys, credentials
Plans, entitlements, AI spend accounting and caps
Incident correlation, linking, lifecycle, severity, corr_debug
Discord bot, radio bots, voice streams, bot tokens, webhooks
Web UI: Next.js app and the edge-node local dashboard
Board process, minutes, unattended runner, agent tooling
Go-to-market, outreach, cold email, discovery conversations
CI/CD, VM, registry, Firestore rules/indexes deploy, Terraform/Caddy
ToS, retention, licences/DAAs, CAN-SPAM, E&O, name suppression
Live map: pins, paths, tiles, legend, geocoding
Node-C2 MQTT, checkins, commands, node sweeper, dynsec
Node install, enrollment, OTA updater, image skew
External feeds: cameras, 511, ADS-B, AIS, outages, and their licences
Call capture, boundaries, PulseAudio, ring buffer, trimming, attribution
OP25 decode, SDR hardware/tuning, conventional, second SDR, mesh radio
STT, transcript correction, place verification, name accuracy
Board process: minutes and board-filed items
Needs board scoping at the next sitting; CEO removes the label once scoped
kind
behavior-bug
Wrong product behavior; the instrument reads it correctly
kind
measurement-bug
Corrupts the recording/instrument (debug data, evals, health checks), not behavior
priority
p0
Drop everything: prod broken, live exposure, or owner-ruled P0
priority
p1
Next up: blocks a gate, a customer, or core incident quality
priority
p2
Normal: real defect or planned work, schedule in turn
priority
p3
Low: minor, cosmetic, or someday
status
blocked
Waiting on an external party, spend, or another issue
status
in-progress
Branch or PR open against it
status
needs-decision
Waiting on an owner or board ruling before work
status
needs-info
Root cause or repro unknown; needs a reading first
type
bug
Something built is wrong: code, data, or a measurement
type
chore
Maintenance, refactor, tests, pinning, cleanup: no user-visible change
type
decision
A ruling to make or record: board minutes, owner calls, legal reviews
type
docs
Docs, runbooks, CLAUDE.md, skills, SOPs
type
feature
New capability or an extension of an existing one
type
security
Security, privacy, credential or tenant-isolation exposure
type
tracking
Tracker, checklist, initiative or punch-list spanning several changes
Milestone
No items
No Milestone
Projects
Clear projects
No projects
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: logan/node-26#14
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Symptom (2026-10-04): node "Toughny" was installed + enrolled with
install.shbut never shows online in prod.Top hypothesis (high confidence from source; prod-side not yet confirmed): the node is sitting in a credential deadlock.
install.shdefaultsENROLL_WAIT=0. If the admin hadn't approved Toughny at install time, §5 printssay_pending, writes noconfigs/credentials.json, and §6 starts the stack anyway.mqtt_manager._build_client()with no api_key and no legacy MQTT_USER connects anonymously; the dynsec broker (mqtt.drb.cusano.net:8883) refuses it. It retries forever (2–60s backoff) and logsMQTT connect refused.approve_node()upserts dynsec + retain-publishes the key onnodes/{id}/api_key— which the node can never read because it can't authenticate. The edge-node app has no HTTPS pickup of its own (GET /nodes/{id}/credentialslives only in install.sh;mqtt_manager.pyTODO(mqtt-cutover) says so).docker compose up -d, which is a no-op for an already-running container.credentials.load()runs only in the FastAPI lifespan at startup, anduvicorn --reloadwatches /app, not /configs — so the running process keeps api_key=None untildocker compose restart edge-node.Ruled out: WireGuard. install.sh intentionally doesn't provision it; nodes use public
mqtt.drb.cusano.net:8883(verified from the dev box 2026-10-04: TCP+TLS OK, LE cert CN=mqtt.drb.cusano.net, verify 0).api.drb.cusano.net/health= ok, mqtt_connected=true, sha fb29900. TheWireGuardcomments inServer/docker-compose.prod.yml/infra/main.tfare stale.Not verified: prod admin UI state for Toughny (Chrome got an error page on drb.cusano.net), and broker logs (
ssh drbdoes not resolve from the dev box). Confirm on the node:cd /opt/drb/node-26 && ls -l configs/ && docker compose logs --tail=50 edge-node | grep -iE 'mqtt|api key'— expect no credentials.json and repeatedMQTT connect refused.Owner recovery on Toughny (in order):
cd /opt/drb/node-26 && sudo bash install.sh(re-run; reuses configs/pickup_secret, collects the key). If it says pickup secret 401/404, re-run with--token DRB-….test -s configs/credentials.json && echo key-presentsudo docker compose restart edge-nodesudo docker compose logs --tail=30 edge-node | grep -i mqtt→ expectMQTT connected.Proposed fix:
docker compose restart edge-nodeif it was already running (orup -d --force-recreate edge-node).GET {C2_URL}/nodes/{id}/credentials(e.g. every 60s), then save the key and rebuild the MQTT client in place. This is the 'client-side enrollment' follow-up named in node-26#4/#6.--wait-approvalto something non-zero when interactive, and make the final banner say plainly that the node stays offline until re-run + restart.Related: node-26#4, node-26#6.
Prod evidence 2026-10-04 (correcting the original write-up, which never checked prod):
Last seen: never— it has never completed one MQTT checkin. Enrollment tokenToughny= 1 use; a secondToughnytoken revoked;New-Toughnytoken 0 uses.approve_node()writes the dynsec client (username=node_id, password=new api_key) before Firestore, andreconcile_all()re-syncs at startup. So the denial is node-side: the node presents either no key (approved after install.sh ran with default--wait-approval 0) or a stale key —approve_node()mints a freshsecrets.token_hex(32)on every call andnode_keysis overwritten (merge=False), so any second approve/reissue silently kills the key already on the node.nodes/{id}/api_key, and the edge-node app never callsGET /nodes/{id}/credentialsitself. A remote node with no SSH is stuck until someone on site re-runs install.sh + restarts edge-node.Fix scope (both needed): (1) edge-node app polls
GET /nodes/{id}/credentialswithconfigs/pickup_secreton startup and on every MQTTnot authorised, hot-reloads the key and reconnects; (2) approve on an already-approved node must not rotate the key (or the UI must warn it will lock the node out).Owner confirms install.sh WAS re-run after approval. That narrows it to the restart gap: re-run writes
configs/credentials.json(install.shwrite_creds), thendocker compose up -d/up --no-build -dleaves the already-running edge-node untouched.credentials.load()(app/internal/credentials.py:26) reads the key once at startup into a module global;mqtt_managerbuilds the client from that cached value, so paho keeps reconnecting with no credentials →not authorised, forever. Any restart of edge-node (incl. a device power-cycle, compose hasrestart: unless-stopped) should pick the key up — unless the node was approved/reissued again after the re-run, which would make the on-disk key stale. Minimal installer fix:docker compose up -d --force-recreate edge-node(orrestart edge-node) afterwrite_creds.Fix is up and not merged. The owner decides when to merge.
credentials.json, then falls back toGET /nodes/{id}/credentialswith the pickup secret, and rebuilds the MQTT client in place.approve_nodereuses an existing key and never rotates it.Toughny recovery (after #16 merges and
v1is re-cut at the merge commit):cd /opt/drb/node-26 && sudo ls -l configs/. Expectpickup_secret.curl -fsSL https://git.vpn.cusano.net/logan/node-26/raw/tag/v1/install.sh -o /tmp/drb-install.shsudo bash /tmp/drb-install.sh. It keeps.env, checks the key against C2 and replaces it if stale, recreates edge-node, and installs the updater.sudo docker compose logs --tail=40 edge-node | grep -iE 'mqtt|key'. ExpectMQTT connected.Follow-ups filed: #17 (OTA signing), #18 (
--tokenon argv), #19 (code/image skew), server-26#195 (reject doesn't revoke).Fixed: node-26#16 (
f46c798) + server-26#194 (ae0ece9); v1 re-cut at1e1dab6. Toughny itself still needs the one-time SSH re-run (steps above) — existing nodes can only receive the updater by running the new install.sh once.