HydraIssues

hydracluster: head heartbeat rejects xr_drivers (array) as invalid JSON — breaks ALL Quest heads
closed unclassified Priority: high Project: hydracluster Parent: #781 Reporter: 14 Oct 2026 22:49

Description

handleUpdateHead (pkg/api/handlers_head.go:125) decodes the PUT /api/v1/heads/{id} body with Diagnostics map[string]string. Every diagnostics value MUST be a string.

Since the WiVRn merge (hydraheadquest, 2026-09-16) the head sends xr_drivers as a JSON ARRAY in diagnostics (e.g. ["wivrn","alvr"]). A JSON array cannot decode into map[string]string, so json.Decode errors and the whole PUT returns 400 {"error":"invalid JSON"}. The head cannot heartbeat at all.

CONFIRMED LIVE 2026-10-15 on quest-head-36afcd (node-695ddd25): v0.9.0 running, tunnel UP, every heartbeat logs: W HydraState: heartbeat failed: HTTP 400 ... {"error":"invalid JSON"}. Both VR clients installed (wivrn + alvr) so xr_drivers is non-empty. The head still shows the last ACCEPTED heartbeat (v0.8.2, 2026-09-15) because the merge that added xr_drivers postdates that; v0.9.0 is the first Quest build to send the array.

Flatscreen heads are unaffected (they send no xr_drivers), which is why they still report.

Also affected: hydraheadquest v0.9.0 adds last_stream_start_ms (a number) to diagnostics; that too cannot decode into map[string]string once a stream has run.

BLOCKS: all Quest heads status/diagnostics reporting, including the 5 Quest 3 onboarding 2026-10-15/16.

FIX OPTIONS:
A (cluster, correct): Diagnostics map[string]any (or json.RawMessage / typed struct); adjust SetHeadDiagnostics + store + GET response + operator UI.
B (head, contained): hydraheadquest sends xr_drivers comma-joined and last_stream_start_ms as strings so diagnostics stays all-strings. Ships as a head release, no cluster deploy.

Contract note: docs/hydra-api-contract.md documents xr_drivers as an array and last_stream_start_ms as an integer; option B changes those to strings.

Session Context

Venue
mobile-kit

Comments (1)

api 14 Oct 2026 23:11

FIXED + VERIFIED LIVE 2026-10-15. hydracluster v2.0.122 force-deployed to prod cx22 (hydracluster update --force, service restarted). quest-head-36afcd now heartbeats successfully every 30s: record flipped from the stuck v0.8.2/2026-09-15 to v0.9.0, node_status online, last_seen advancing (23:10:01 -> 23:10:31), xr_drivers ["alvr"] stored as coerced text. Zero heartbeat-400s since the deploy. Unblocks all Quest heads incl. the 5 Quest 3 onboarding.