macos-container: host loses route to orchestrator control plane once the multi-homed gateway attaches (bottle launch times out) #484
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Symptom
On the
macos-container(Apple Container) backend, launching a bottle fails: every host-side orchestrator control-plane call connect-times-out (<urlopen error timed out>):Surfaced by the advisory
integration-macosCI job added in #479 (TestSandboxEscape.setUpClass). Run: https://gitea.dideric.is/didericis/bot-bottle/actions/runs/3200/jobs/6189This is not the
gateway_init.pysupervisor regression (which fails asGatewayError: gateway CA not available), and not related to the job's trigger config.Root cause (host -> control-network routing on vmnet)
The orchestrator stays
runningand listening on0.0.0.0:8099the entire time (on-failure diagnostics confirm: staterunning, IP192.168.129.6/24onbot-bottle-mac-control, logorchestrator control plane listening). The host simply loses its TCP route to it.The break happens at a precise point in
infra.py:ensure_running:http://192.168.129.6:8099/healthOK (logsorchestrator healthy).gateway.connect_to_orchestrator()brings up the triple-homed gateway (gateway.py:126-152) with--networkorder egress, agent, control -- NAT egress first (its default route).192.168.129.6:8099. A connect timeout occurs at the TCP handshake, before any auth header / method / body -- so it is a routing failure, not an HTTP-layer one.I.e. bringing the NAT-defaulted, multi-homed gateway onto the shared control network breaks the host's route to the orchestrator.
This is a real backend bug, not a CI artifact:
bot-bottle startwalks the sameensure_gateway -> register bottlepath, so a real launch on this host hits the identical timeout.Aggravating factor: shared per-host singleton
The host also runs a live
bot-bottleinstance. The macOS backend uses per-host singletons (bot-bottle-mac-infra,bot-bottle-mac-orchestrator), so the CI job force-restarts them (connect_to_orchestratordoesforce_remove_container) and theif: always()teardown removes them. Two consequences:Proposed fix
Stop depending on host->vmnet routing for the control plane. Have the orchestrator publish its port to host loopback (
--publish 127.0.0.1::8099) and point the host-sideOrchestratorClientat127.0.0.1:<published>. Container->container (gateway->orchestrator) keeps using the control-net IP (gateway_url()), which works fine. This sidesteps the vmnet multi-network routing limitation entirely.Separately: guard the
integration-macosjob (or require a dedicated runner) so it can't clobber co-located live bottles via the shared singleton.Repro (leaves infra up, unlike CI)
Closing per decision: keep the integration-macos CI job disabled (dispatch-only, not auto-run) and run macOS integration tests manually for now instead of chasing the vmnet routing fix.