Skip to content

bug: openshell gateway start fails on macOS Docker Desktop — wrong socket path #443

@drew

Description

@drew

Agent Diagnostic

Investigated via explore agent. Loaded codebase search across crates/openshell-bootstrap/src/docker.rs and related files.

Findings:

  • check_docker_available() at crates/openshell-bootstrap/src/docker.rs:122 uses Docker::connect_with_local_defaults() which respects DOCKER_HOST then falls back to /var/run/docker.sock.
  • docker_not_reachable_error() at line 153 checks Path::new("/var/run/docker.sock").exists() and DOCKER_HOST.
  • find_alternative_sockets() at line 208 probes Colima (~/.colima/docker.sock) and OrbStack (~/.orbstack/run/docker.sock) but does not probe the Docker Desktop macOS-specific socket path: ~/Library/Containers/com.docker.docker/Data/docker-cli.sock.
  • The WELL_KNOWN_SOCKET_PATHS constant at line 110 only contains /var/run/docker.sock.
  • The error path (line 192-198) when the socket exists but daemon is unresponsive does not suggest the Docker Desktop alternative path.

Root cause: Docker Desktop on recent macOS versions does not always create /var/run/docker.sock. The actual socket lives at ~/Library/Containers/com.docker.docker/Data/docker-cli.sock. OpenShell does not probe this path, nor does it auto-detect it as a fallback.

Upstream reference: NemoClaw#309

Description

Actual behavior: openshell gateway start fails with:

Error in the hyper legacy client: client error (Connect)
Docker socket found at /var/run/docker.sock but the daemon is not responding.

Expected behavior: OpenShell should detect the Docker Desktop macOS socket at ~/Library/Containers/com.docker.docker/Data/docker-cli.sock (or respect DOCKER_HOST) and connect successfully without manual workaround.

Reproduction Steps

  1. Install Docker Desktop on macOS (Apple Silicon)
  2. Ensure /var/run/docker.sock is not present or not functional (common on recent Docker Desktop versions)
  3. Run openshell gateway start
  4. Observe connection failure

Environment

  • OS: macOS (Apple Silicon, M4 Max)
  • Docker: Docker Desktop 29.2.1
  • OpenShell: 0.0.10

Logs

Error in the hyper legacy client: client error (Connect)
Docker socket found at /var/run/docker.sock but the daemon is not responding.

Proposed Fix

The fix is localized to crates/openshell-bootstrap/src/docker.rs:

  • Add ~/Library/Containers/com.docker.docker/Data/docker-cli.sock to the find_alternative_sockets() home-relative probes (alongside Colima and OrbStack)
  • In check_docker_available(), when Docker::connect_with_local_defaults() succeeds but ping() fails (or when the initial connect fails), probe alternative sockets and attempt connection via Docker::connect_with_socket() before returning an error
  • Update error messages to suggest the Docker Desktop socket path when detected on macOS
  • Add unit tests for the new socket path detection

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:clusterRelated to running OpenShell on k3s/docker

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions