{"record":{"id":"4ab7ee5e78befe71","repo":"jdx/mise","slug":"docker-load-failed-status-stderr-ensure","errorCode":null,"errorMessage":"`docker load` failed ({status}): {stderr}. Ensure the docker daemon is running and your user has access to the socket.","messagePattern":"`docker load` failed \\((.+?)\\): (.+?)\\. Ensure the docker daemon is running and your user has access to the socket\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/oci/docker_archive.rs","lineNumber":113,"sourceCode":"        .join()\n        .map_err(|_| eyre::eyre!(\"docker archive writer thread panicked\"))?;\n\n    if !out.status.success() {\n        let stderr = String::from_utf8_lossy(&out.stderr);\n        let mut msg = format!(\n            \"`docker load` failed ({}): {}. Ensure the docker daemon is running and \\\n             your user has access to the socket.\",\n            out.status,\n            stderr.trim()\n        );\n        // A write error here is usually the broken pipe caused by docker\n        // dying (so docker's stderr is the real cause), but if it's something\n        // else — e.g. a layer failed to decompress — surface it too so the\n        // truncated-archive error from docker doesn't mask the root cause.\n        if let Err(e) = &write_result {\n            msg.push_str(&format!(\"\\n(while writing archive: {e})\"));\n        }\n        bail!(msg);\n    }\n    // docker succeeded — don't swallow a writer error if one somehow occurred.\n    write_result?;\n    Ok(())\n}\n\nfn write_docker_archive<W: Write>(\n    out: W,\n    layout: &ImageLayout,\n    manifest: &ImageManifest,\n    config_bytes: &[u8],\n    tag: &str,\n) -> Result<()> {\n    let mut builder = Builder::new(out);\n\n    let config_name = format!(\"{}.json\", hex_of(&manifest.config.digest));\n    append_bytes(&mut builder, &config_name, config_bytes)?;\n","sourceCodeStart":95,"sourceCodeEnd":131,"githubUrl":"https://github.com/jdx/mise/blob/afd2eddd3a50c16190efc1c7e94404b48f72af57/src/oci/docker_archive.rs#L95-L131","documentation":"After streaming the OCI image as a docker archive to `docker load`, mise checks the process exit status. This error is thrown when docker load exits non-zero, and appends docker's stderr plus a hint that the docker daemon may not be running or the user may lack socket access. A failure while writing the archive stream is also surfaced so the truncated-archive message from docker does not mask the real cause.","triggerScenarios":"Running `mise oci load` (load_into_docker) when the docker daemon is stopped, the user is not in the docker group / lacks socket permissions, docker is not installed or DOCKER_HOST is wrong, or the image archive is corrupt so docker reports a truncated archive.","commonSituations":"CI without a running docker daemon; running inside a container without /var/run/docker.sock mounted; user not in the docker group after installing docker; disk-full or failed download producing a truncated layer tar.","solutions":["Start the docker daemon (systemctl start docker / start Docker Desktop) and verify with `docker info`, then retry the load.","Fix socket permissions: `sudo usermod -aG docker $USER` (then re-login) or set DOCKER_HOST correctly to the daemon you intend to use.","Check the full message: if it includes \"(while writing archive: ...)\", fix the underlying archive write/decompression failure instead of docker itself.","Verify the source image layout is complete and valid (all blobs present) and rebuild it if it was truncated."],"exampleFix":"// before\nmise oci load ./out/image\n// error: `docker load` failed ...\n// after\nsudo systemctl start docker\nsudo usermod -aG docker $USER  # then re-login\nmise oci load ./out/image","handlingStrategy":"try-catch","validationCode":"if !command_exists(\"docker\") { return Err(\"docker not installed\"); }\nlet info = Command::new(\"docker\").arg(\"info\").output()?;\nif !info.status.success() {\n    return Err(\"docker daemon unreachable; start it or check DOCKER_HOST / socket permissions\".into());\n}","typeGuard":null,"tryCatchPattern":"match load_into_docker(&dir) {\n    Err(e) if e.to_string().contains(\"`docker load` failed\") => {\n        if e.to_string().contains(\"while writing archive\") {\n            eprintln!(\"archive write failed — rebuild the image layout\");\n        } else {\n            eprintln!(\"start the docker daemon / fix socket access, then retry\");\n        }\n    }\n    r => r,\n}","preventionTips":["Check `docker info` as a preflight before oci load.","Add your user to the docker group or run in an environment with the socket mounted.","Verify image archives are complete (checksums) before loading."],"tags":["docker","oci","daemon"],"backgroundTag":"connection-refused","analyzedSha":"afd2eddd3a50c16190efc1c7e94404b48f72af57","analyzedAt":"2026-09-09T01:38:25.179Z","contentChangedAt":"2026-09-09T01:38:25.179Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}