Appearance
Operational runbooks
Common repair procedures for a HiveCast platform Host or a paired user Device.
Diagnostic first steps
bash
# 1. Is the Host running?
hivecast status --home /var/lib/hivecast/host-home
# 2. Are runtimes healthy?
matrix invoke host.control status '{}' --home /var/lib/hivecast/host-home
# 3. Is the gateway responding?
curl -fsS http://127.0.0.1:3100/healthz | jq .
# 4. Are paired Devices online?
matrix invoke system.devices devices.list '{"includeOffline":true}'If any of these fail, follow the matching runbook below.
Host won't start
Symptom: hivecast start exits with an error.
bash
# Inspect supervisor log
tail -50 <host-home>/logs/host-service.logCommon causes:
- NATS already running on port. A previous NATS sibling process did not stop.
pkill nats-server, thenhivecast start. - Stale PID file. Delete
<host-home>/host.pidand<host-home>/nats.pidif the processes are not actually running. - Port collision (gateway port). Pass
--http-port 0to let the OS allocate, or kill the holder.
After fix, hivecast start again.
Runtime won't start
Symptom: host.control runtimes.list shows the runtime in failed or it never appears.
bash
tail -50 <host-home>/logs/runtimes/<runtime-id>.logCommon causes:
- Empty/corrupt runtime record JSON.
hivecast seedself-heals. - Missing package. Verify
<host-home>/.matrix/packages/<package-name>/exists; if not, reinstall the wrapper. - Bad env config. Check
host.jsontransport.rootmatchesMATRIX_AUTHORITY_ROOTif set. - Pinned port collision. Edit the runtime record's
portto0or kill the holder.
system.devices shows zero rows
Symptom: devices.list returns count: 0 even though Host Links exist in auth-state.json.
This is a registration-propagation lag. The Host's host.control heartbeats register the Device with system.devices. If the Host just restarted, allow ~30 seconds.
If still empty:
bash
# Verify the Host Link exists
matrix invoke system.auth auth.hostLink.list '{"principalId":"p_xxx"}'
# Verify the Host is heartbeating
tail -20 <host-home>/logs/runtimes/host-control.log
# Force a register
matrix invoke host.control register '{}'If auth.hostLink.list returns the link but system.devices.devices.list still shows zero, the registration step on system.devices has a bug — file an issue.
Device shows offline but is running
Symptom: Device row has status: 'offline' and recent lastSeenAt.
Verify on the Device itself:
bash
# On the Device
matrix invoke host.control status '{}' --home <host-home>
# Look for last heartbeat outcomeIf the Device is heartbeating but the platform records old lastSeenAt, check:
- Heartbeat token validity (re-pair if stale).
- Network reachability from Device to platform.
- Platform's
_auth/host-link/heartbeatendpoint logs.
Cookies fail to authenticate
Symptom: Browser is logged in but every API request returns 401.
- Check
mx_sessioncookie is present (browser dev tools, Application > Cookies). - Check
auth.sessionSecretwas not rotated (rotation invalidates all sessions; users must re-login). - Check the platform's
issmatches the cookie.auth.session.validatechecksclaims.iss === issuerwhere issuer ismatrix-host:<authorityRoot>.
Lost the session HMAC secret
Recovery: Generate a new one, deploy, accept that all users must re-login.
bash
# On the platform Host
node -e 'console.log(require("crypto").randomBytes(32).toString("hex"))'
# Copy to host.json auth.sessionSecret
hivecast stop && hivecast startThere is no secret-derivation path; if the secret is lost, every existing session is unrecoverable. Plan for periodic rotation.
Lost a paired Device's credentials
Symptom: A Device's <host-home>/credentials/hivecast-link.json was deleted or corrupted.
The Device cannot heartbeat. The platform still has the Host Link record.
Recovery: revoke the lost Host Link (so its NATS keys can't be reused if recovered) and re-pair:
bash
# On platform
matrix invoke system.auth auth.hostLink.revoke '{"hostLinkId":"<id>"}'
# On Device
hivecast login --device --cloud https://hivecast.aiNATS hub failed to reload after revoke
Symptom: auth.hostLink.revoke returned ok: true, but the revoked Device's NATS user JWT still authenticates.
bash
# Force NATS to reload the account JWT
nats account reload # via NATS CLI on the platform NATS
# Verify revocation took effect
matrix invoke system.auth auth.hostLink.get '{"hostLinkId":"<id>"}'
# Status should be revoked.Audit a principal's full state
bash
# All Host Links
matrix invoke system.auth auth.hostLink.list '{"principalId":"p_xxx"}'
# All namespace claims
matrix invoke system.auth auth.namespace.list '{"principalId":"p_xxx"}'
# Default Space
matrix invoke system.auth auth.space.default '{"principalId":"p_xxx"}'
# Authority root
matrix invoke system.auth auth.principal.authorityRoot '{"principalId":"p_xxx"}'
# Their Devices
matrix invoke system.devices devices.list '{"principalId":"p_xxx","includeOffline":true,"includeRevoked":true}'Cross-reference with the dashboard or with auth-state.json if needed.
Suspend a principal
Until auth.principal.suspend ships, hand-edit:
bash
# On the platform Host. CARE: this is direct state mutation.
hivecast stop
sudo jq '.principals |= map(if .id == "p_xxx" then .status = "suspended" else . end)' \
<host-home>/state/auth-state.json > /tmp/auth-state.json
sudo mv /tmp/auth-state.json <host-home>/state/auth-state.json
hivecast start
# Revoke their Host Links so paired Devices stop authenticating
matrix invoke system.auth auth.hostLink.list '{"principalId":"p_xxx"}'
# For each id, call revokeSee also
- Database ownership — what each store contains.
- Platform APIs — HTTP debugging.
- Devices / Disconnect / unlink — full revoke.
- Security: Secrets — secret rotation.
Source: Operational experience captured in
WORKSTREAMS/loose-ends/items/P1.22*progress logs andWORKSTREAMS/product-launch/HIVECAST-DEVICE-ENROLLMENT-SPEC.md.