macos-container: gateway supervisor spawned via removed /app/gateway_init.py; launch fails with misleading CA error #427

Closed
opened 2026-07-20 13:38:59 -04:00 by didericis · 0 comments
Owner

Symptom

bot-bottle start on the macos-container backend fails with:

bot_bottle.orchestrator.gateway.GatewayError: gateway CA not available in
bot-bottle-mac-infra after 30s: cat: /home/mitmproxy/.mitmproxy/mitmproxy-ca-cert.pem:
No such file or directory

The error points at TLS/certs, which is misleading — the CA is a downstream symptom.

Cause

bot_bottle/backend/macos_container/infra.py builds the infra container's init script and spawns the supervisor as python3 /app/gateway_init.py. 5ad3449 moved bot_bottle from flat files under /app into a pip-installed package, so that file does not exist. The container log shows the real failure:

python3: can't open file '/app/gateway_init.py': [Errno 2] No such file or directory

The supervisor never starts → mitmdump never runs → the CA is never generated → ca_cert_pem() times out.

Why it survived

127ba49 fixed the identical defect in the firecracker backend, because the KVM runner (PR #349 / c193b04) runs that backend's integration suite. Nothing exercises macos_container in CI — see #426.

The unit test did not catch it either: test_macos_infra asserted the substring "gateway_init.py", which the broken path satisfies. The firecracker twin was tightened to the module form in 127ba49; the macOS one was missed.

Fix

Spawn via the installed package (python3 -m bot_bottle.gateway_init), matching 127ba49, and tighten the unit assertion to the module form.

Related

  • #426 — no macOS runner; the reason this reached main
## Symptom `bot-bottle start` on the macos-container backend fails with: ``` bot_bottle.orchestrator.gateway.GatewayError: gateway CA not available in bot-bottle-mac-infra after 30s: cat: /home/mitmproxy/.mitmproxy/mitmproxy-ca-cert.pem: No such file or directory ``` The error points at TLS/certs, which is misleading — the CA is a downstream symptom. ## Cause `bot_bottle/backend/macos_container/infra.py` builds the infra container's init script and spawns the supervisor as `python3 /app/gateway_init.py`. `5ad3449` moved `bot_bottle` from flat files under `/app` into a pip-installed package, so that file does not exist. The container log shows the real failure: ``` python3: can't open file '/app/gateway_init.py': [Errno 2] No such file or directory ``` The supervisor never starts → mitmdump never runs → the CA is never generated → `ca_cert_pem()` times out. ## Why it survived `127ba49` fixed the identical defect in the firecracker backend, because the KVM runner (PR #349 / `c193b04`) runs that backend's integration suite. Nothing exercises `macos_container` in CI — see #426. The unit test did not catch it either: `test_macos_infra` asserted the substring `"gateway_init.py"`, which the broken path satisfies. The firecracker twin was tightened to the module form in `127ba49`; the macOS one was missed. ## Fix Spawn via the installed package (`python3 -m bot_bottle.gateway_init`), matching `127ba49`, and tighten the unit assertion to the module form. ## Related - #426 — no macOS runner; the reason this reached `main`
didericis added the Kind/Bug
Priority
High
2
labels 2026-07-20 13:39:01 -04:00
gitea-actions bot added the Status/Needs Triage label 2026-07-20 13:39:07 -04:00
didericis removed the Status/Needs Triage label 2026-07-20 13:42:07 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: didericis/bot-bottle#427