Skip to content

sandbox start fails after initial command exits: 'supervisor authentication bundle does not match runtime session' #4505

Open

Description

@niico09

Summary

Starting a sandbox whose initial command already finished (phase Completed) fails deterministically and moves the sandbox to Error. Creating a sandbox and running a command via sandbox create works fine; only restarting a stopped/completed sandbox is affected.

Environment

  • OpenShell 0.1.3 (CLI, gateway, sandbox, driver-vm)
  • Install method: Arch-based distro (CachyOS). The official install.sh supports only snap/deb/rpm, so I used the AUR package openshell-bin 0.1.3-1, which repackages the official release tarballs (sha256 verified against the release checksums file).
  • Gateway: local, native systemd user service (systemctl --user), mTLS
  • Registration: openshell gateway add https://127.0.0.1:17670 --local --name openshell → Connected / Authenticated (mTLS)
  • Compute driver: Docker 29.9.0 (user is in the docker group); openshell doctor check passes
  • Host: Linux x86_64, kernel 7.2.9, CachyOS
  • Default sandbox image: nvcr.io/nvidia/base/ubuntu:24.04

Steps to reproduce

  1. openshell sandbox create --name repro1 -- echo done → runs fine; sandbox reaches phase Completed
  2. openshell sandbox start repro1

Actual

Error: code: 'The service is currently unavailable', message: "start sandbox failed: Docker supervisor exited before becoming ready; log tail: 2026-10-13T21:45:18.451Z INFO openshell_supervisor: Starting sandbox supervision
Error: supervisor authentication bundle does not match runtime session"

The sandbox transitions to phase Error. A subsequent openshell sandbox exec repro1 -- ... reports not ready (phase: Error). Reproduced with two independent sandboxes. The gateway was NOT restarted between creation and start.

Relevant sandbox-side log lines from the failed start (openshell logs repro1):

[sandbox] CONFIG:ENABLED TLS termination enabled: ephemeral CA generated
[sandbox] WARN host.openshell.internal maps to a non-link-local IP; trusted-gateway SSRF exemption disabled ip=127.0.0.1
[sandbox] NET:OPEN 127.0.0.1:17670
[gateway] supervisor session: superseded by reconnect, shutting down
[gateway] supervisor session: ended (already superseded)
[gateway] Stopped Docker sandbox after control supervisor failure
[gateway] Container exited

openshell sandbox get repro1 after the failure:

Phase: Error
Configuration: ConfigurationPending: Waiting for effective configuration validation before workload activation
Main process instance: e9924d02-442b-4c85-943b-efd169c12405
Annotations:
  internal.openshell.ai/auth-epoch: 2
  internal.openshell.ai/runtime-generation: 4ae09559-7423-4685-9bf4-0ae105d8ee5b
Conditions:
  - Ready: False (ContainerExited) - Container exited
  - ConfigurationReady: False (ConfigurationPending)

Expected

sandbox create → Completed → sandbox start → Ready.

Workaround

Delete the sandbox and create a new one (works immediately, image is cached).

Activity

  1. mdusserebetclic commented on Oct 20, 2026

    @mdusserebetclic

    Reproduced on 0.1.4, on a different platform:

    • macOS 26.7.1, Apple Silicon (arm64)
    • OpenShell 0.1.4, official install.sh (Homebrew, gateway as brew services)
    • Docker driver, Docker Desktop 29.8.0 (linux/arm64, kernel 7.0.12-linuxkit)
    • Default image nvcr.io/nvidia/base/ubuntu:24.04

    sandbox create -- sh -c 'exit 0' → Completed → sandbox start gives the same supervisor authentication bundle does not match runtime session error, and the sandbox can't be started again. stop/start on a Ready sandbox works.

    We'd welcome a fix too.

  2. vibexp-agent commented on Oct 25, 2026

    @vibexp-agent

    Same thing on 0.1.5 with the Docker driver, and it also happens after a failed main process, not only Completed.

    Repro: connect to a sandbox, hit Ctrl-C so the main process exits with 130. The sandbox goes to Error (MainProcessFailed) but the container keeps running ("retaining control-mode access plane"). sandbox start then fails with the same "authentication bundle does not match runtime session" error.

    I think the cause is in start_sandbox_with_lifecycle_fence in the Docker driver. The gateway mints a new runtime identity (new session_id) for the start. The container is still running, so the driver takes the "gateway restart" branch and calls refresh_docker_supervisor_authentication. That writes the new auth bundle but leaves runtime-descriptor.json with the old session_id, and SelectedBackend::select rejects the mismatch.

    Workaround without deleting: once the failed start has stopped the container, sandbox stop then sandbox start works and keeps the workspace. With the container exited, start goes through refresh_docker_boundary_authentication, which rotates the descriptor too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    state:triage-neededOpened without agent diagnostics and needs triage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions