HydraIssues

hydraheadipad: the head never reconnects its own WireGuard tunnel, so every stream fails until a person goes behind the operator PIN
open bug Project: hydraheadipad Reporter: 8 Nov 2026 13:22

Description

Measured on ipad-head-cederik (node-ea866a02) on 2026-11-08, directly after the iPadOS 27.2 update.

What the head reported

From the 12:23:21Z heartbeat:

  • wireguard = disconnected
  • last_error = Pairing failed: The request timed out.
  • app_uptime_seconds = 210, so the application had just been started by hand
  • version = v0.4.0

From the same heartbeat recent_logs:

12:21:40.522Z Discovering body for 'world-of-warcraft' in bxl1-mercator-39/cloud-seven
12:21:42.125Z Body host 10.10.100.12 did not answer within 1000ms
12:21:43.191Z Body host 11.0.11.24 did not answer within 1000ms
12:21:43.194Z Found cosmic-pretzel-98 (stream_count:0, host:10.10.100.12)
12:21:43.195Z Pairing with cosmic-pretzel-98 at 10.10.100.12
12:21:48.210Z Pairing failed: The request timed out.

The body address is a mesh address. The tunnel is the only route to it. The tunnel was down, so the pairing could not succeed.

The defect

The application adopts an installed tunnel at launch but it never connects it.

In AppState.restoreEnrollmentIfNeeded:

Task { await WireGuardManager.shared.loadExisting() }

The comment on loadExisting states that it adopts the profile "without touching the network". That is correct behaviour for a status read. The defect is that nothing else ever calls start().

The only two calls to start() in the whole application are both inside the WireGuard panel:

  • WireGuardSetupView, the Connect action
  • WireGuardSetupView, the Set up tunnel action, through AppState.setUpWireGuard

There are no on demand rules. A search for isOnDemandEnabled, onDemandRules and NEOnDemand across Sources returns nothing. The stream start path does not check the tunnel and does not try to raise it. The heartbeat tick does not either.

The heartbeat value is disconnected and not not-installed. WireGuardManager.heartbeatState returns not-installed when isInstalled is false, so the profile and the stored private key both survived the operating system update. Only the tunnel session dropped.

Why this is worse than it looks

Issue #512 moved the WireGuard panel behind an operator PIN, for good reason: it is a destructive surface on a public kiosk. The result is that the only control that can raise the tunnel is now behind that PIN. A head that loses its tunnel cannot recover without a person who knows the PIN.

There is also nothing on this iPad to restart the application after a reboot. ipad-head-cederik has no SimpleMDM record, so it has no Single App Mode payload. So a reboot gives a head that is enrolled, heartbeating over the public internet, reporting healthy, and unable to stream anything.

The operator sees only "Pairing failed: The request timed out." That message does not name the tunnel, so it does not point at the cause.

Two candidate fixes

  1. Connect at launch. When isInstalled and hasStoredConfig are both true, call start() after loadExisting(). This touches no network and reuses the stored key, exactly as the existing reuse path in setUpWireGuard already does. Small and safe.

  2. Set on demand rules on the tunnel profile. This is the correct behaviour for a kiosk, because iOS then raises the tunnel whenever it is needed, with no application running at all, and it survives a reboot. A deliberate Disconnect must clear the rules first, or the two fight each other.

The second is the real answer for an unattended head. The first is worth having in any case, because it costs almost nothing.

A third, separate improvement: name the tunnel in the failure. When a body host does not answer and wireguard is not connected, the error the operator reads should say that the tunnel is down, not only that a request timed out.

How to reproduce

  1. Take a head with an installed and connected tunnel.
  2. Restart the application, or restart the iPad.
  3. Read the heartbeat. wireguard reads disconnected.
  4. Start any experience whose body is on a mesh address. Pairing times out.

Related

  • #512 put the only Connect control behind the operator PIN
  • #503 fixed a different route choice defect in the same area and is done
  • #435 is the same shape of fault on the district hub, where wg-quick was disabled and the mesh was down for about eleven hours undetected
  • #733 reads like this one from the outside, but it is a site fault: the venue router peer had no handshake at all
  • #1147, #1148 and #1149 are the controller and keyboard work on the same head

Shipped in v0.5.1, build 212, VALID 2026-11-08

Tag v0.5.1 = 895501f on main. Validate run 42489152740 green, release run 42489619629 all 30 steps, Build 212: VALID read live from the log.

Both mechanisms are in:

  • AppState calls WireGuardManager.restoreTunnel() at launch.
  • The profile carries one NEOnDemandRuleConnect rule with no interface match, so iOS raises the tunnel with no application running and again after a restart.

Three holes closed while writing it:

  • start() enables on demand before it starts, so no route can leave a head connected but not always on. Without this, pressing Connect after a Disconnect would reconnect the operator and silently drop the mesh at the next restart, which is this same defect again.
  • stop() clears on demand before stopping, or iOS raises the tunnel within seconds and Disconnect appears to do nothing.
  • restoreTunnel() refuses on demand when no configuration is stored, because the extension would have no key and iOS would retry a tunnel that cannot come up. A profile already in the wanted state is never written again, since a save can bounce a live connection.

The launch rule is a nonisolated pure static with five cases in Tests/TunnelRestoreTests.swift, wired into both workflows. The runbook gains the diagnostics table that tells disconnected from not-installed. The testbook gains fourteen steps across an application restart, an iPad restart, a deliberate disconnect and a removed tunnel.

STILL OPEN, and why this issue stays open: the operator reads only "Pairing failed: The request timed out.", which does not name the tunnel. Device verification is also outstanding. ipad-head-cederik is still on v0.4.0, so nothing has run this yet.

Session Context

Venue
cloud-seven