usestrix/strix · critical · RuntimeError

Docker not available

Error message

Docker not available

What it means

check_docker_connection calls docker.from_env(); on DockerException (daemon unreachable, socket missing, permission denied on /var/run/docker.sock) it prints a rich 'DOCKER NOT AVAILABLE' panel with remediation hints, then raises RuntimeError('Docker not available') from None. Strix's scan engine runs inside Docker, so no daemon means no scan.

Source

Thrown at strix/interface/utils.py:1602

        console = Console()
        error_text = Text()
        error_text.append("DOCKER NOT AVAILABLE", style="bold red")
        error_text.append("\n\n", style="white")
        error_text.append("Cannot connect to Docker daemon.\n", style="white")
        error_text.append(
            "Please ensure Docker Desktop is installed and running, and try running strix again.\n",
            style="white",
        )

        panel = Panel(
            error_text,
            title="[bold white]STRIX",
            title_align="left",
            border_style="red",
            padding=(1, 2),
        )
        console.print("\n", panel, "\n")
        raise RuntimeError("Docker not available") from None


def image_exists(client: Any, image_name: str) -> bool:
    try:
        client.images.get(image_name)
    except ImageNotFound:
        return False
    else:
        return True


def update_layer_status(layers_info: dict[str, str], layer_id: str, layer_status: str) -> None:
    if "Pull complete" in layer_status or "Already exists" in layer_status:
        layers_info[layer_id] = "✓"
    elif "Downloading" in layer_status:
        layers_info[layer_id] = "↓"
    elif "Extracting" in layer_status:
        layers_info[layer_id] = "📦"

View on GitHub (pinned to 8551339130)

Solutions

  1. Start Docker Desktop (macOS/Windows) or the daemon: sudo systemctl start docker.
  2. Verify access with docker ps in the same shell/user that runs strix.
  3. Add your user to the docker group (sudo usermod -aG docker $USER, then re-login) for socket permission errors.
  4. Unset or fix DOCKER_HOST if it points to an unreachable daemon.

Example fix

# before
$ strix -n -t ./
DOCKER NOT AVAILABLE ...
RuntimeError: Docker not available

# after
$ sudo systemctl start docker && docker ps   # daemon up and reachable
$ strix -n -t ./
Defensive patterns

Strategy: validation

Validate before calling

import shutil
import subprocess

def docker_daemon_reachable() -> bool:
    if shutil.which("docker") is None:
        return False
    try:
        subprocess.run(["docker", "info"], check=True, capture_output=True, timeout=15)
        return True
    except (subprocess.SubprocessError, OSError):
        return False

if not docker_daemon_reachable():
    raise SystemExit("Docker daemon unreachable: start Docker Desktop / `systemctl start docker` first")

Try / catch

try:
    client = check_docker_connection()
except RuntimeError as e:
    if str(e) == "Docker not available":
        raise SystemExit("Start the Docker daemon and confirm `docker ps` works, then re-run.") from e
    raise

Prevention

When it happens

Trigger: Docker Desktop not started; docker.sock absent (no daemon installed); current user not in the docker group (permission denied on the socket); DOCKER_HOST pointing at a dead endpoint; rootless daemon not configured.

Common situations: Fresh machines with the CLI but no daemon; CI runners where the docker socket isn't mounted into the job container; WSL2 without Docker Desktop running; remote DOCKER_HOST set to a stale IP.

Related errors


AI-assisted analysis of usestrix/strix@8551339130 (2026-08-15). Data as JSON: /api/errors/ee152df1dc37aac1. Report an issue: GitHub.