{"record":{"id":"3d30fc985c222db9","repo":"amir20/dozzle","slug":"docker-daemon-unreachable-or-unsupported-minimum","errorCode":null,"errorMessage":"docker daemon unreachable or unsupported (minimum API version %s required): %w","messagePattern":"docker daemon unreachable or unsupported \\(minimum API version (.+?) required\\): %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"internal/docker/client.go","lineNumber":95,"sourceCode":"\t}\n\n\treturn &DockerClient{\n\t\tcli:  cli,\n\t\thost: host,\n\t\tinfo: info,\n\t}\n}\n\n// NewLocalClient creates a new instance of Client with docker filters\nfunc NewLocalClient(hostname string) (*DockerClient, error) {\n\tcli, err := client.New(client.FromEnv, client.WithUserAgent(\"Docker-Client/Dozzle\"))\n\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif _, err := cli.Ping(context.Background(), client.PingOptions{NegotiateAPIVersion: true}); err != nil {\n\t\treturn nil, fmt.Errorf(\"docker daemon unreachable or unsupported (minimum API version %s required): %w\", client.MinAPIVersion, err)\n\t}\n\n\tinfoResult, err := cli.Info(context.Background(), client.InfoOptions{})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tinfo := infoResult.Info\n\n\thost := container.Host{\n\t\tName:     info.Name,\n\t\tEndpoint: \"local\",\n\t\tType:     \"local\",\n\t}\n\n\tif hostname != \"\" {\n\t\thost.Name = hostname\n\t}\n","sourceCodeStart":77,"sourceCodeEnd":113,"githubUrl":"https://github.com/amir20/dozzle/blob/d9463cbe21874e44ab79db6fa63e746ca7d22928/internal/docker/client.go#L77-L113","documentation":"NewLocalClient pings the Docker daemon with API version negotiation right after client creation; if the ping fails, the daemon is unreachable or older than the minimum supported API version, and the error wraps the underlying cause. This fails fast at startup instead of producing confusing per-call errors later.","triggerScenarios":"NewLocalClient is called (from Run, main, or CreateMultiHostService) and cli.Ping with NegotiateAPIVersion fails: no Docker socket at /var/run/docker.sock, daemon down, TCP endpoint wrong, or daemon older than client.MinAPIVersion.","commonSituations":"Dozzle container launched without mounting /var/run/docker.sock; DOCKER_HOST pointing to a dead TCP endpoint; remote daemon offline; very old Docker engine (< minimum API version) after a Dozzle upgrade; permissions on the socket.","solutions":["Mount the Docker socket when running in Docker: -v /var/run/docker.sock:/var/run/docker.sock","Verify DOCKER_HOST / endpoint is correct and the daemon is running (docker info on that host)","Check socket permissions (add the user to the docker group or run with appropriate access)","Upgrade the Docker Engine to a version supporting client.MinAPIVersion if the daemon is too old"],"exampleFix":"// before\ndocker run amir20/dozzle  # no docker.sock\n// after\ndocker run -v /var/run/docker.sock:/var/run/docker.sock amir20/dozzle","handlingStrategy":"fallback","validationCode":"sock := os.Getenv(\"DOCKER_HOST\")\nif sock == \"\" { sock = \"unix:///var/run/docker.sock\" }\n// stat the socket / TCP dial before starting Dozzle","typeGuard":null,"tryCatchPattern":"cli, err := NewLocalClient()\nif err != nil && strings.Contains(err.Error(), \"docker daemon unreachable\") {\n  // log hint about docker.sock mount / DOCKER_HOST and exit or retry with backoff\n}","preventionTips":["Mount /var/run/docker.sock when running Dozzle in Docker","Verify DOCKER_HOST endpoints before launch","Keep Docker Engine upgraded to meet the client's MinAPIVersion","Check daemon status (systemctl status docker) and socket permissions on deploy"],"tags":["docker","network","startup","daemon"],"backgroundTag":"connection-refused","analyzedSha":"d9463cbe21874e44ab79db6fa63e746ca7d22928","analyzedAt":"2026-09-07T10:08:55.855Z","contentChangedAt":"2026-09-07T10:08:55.855Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}