{"record":{"id":"942ce94c6062f3eb","repo":"abiosoft/colima","slug":"could-not-start-docker-model-runner-after-3-attemp","errorCode":null,"errorMessage":"could not start docker-model-runner after 3 attempts","messagePattern":"could not start docker-model-runner after 3 attempts","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"model/docker.go","lineNumber":278,"sourceCode":"\n\treturn err\n}\n\n// ensureDockerModelRunner ensures the docker-model-runner container is running.\n// Attempts to start it up to 3 times if not found.\nfunc ensureDockerModelRunner(guest environment.VM) error {\n\tfor attempt := 1; attempt <= 3; attempt++ {\n\t\t// Check if container exists\n\t\tif err := guest.RunQuiet(\"docker\", \"inspect\", \"docker-model-runner\"); err == nil {\n\t\t\treturn nil\n\t\t}\n\n\t\tlog.Infof(\"docker-model-runner not found, starting it (attempt %d/3)...\", attempt)\n\t\t_ = guest.Run(\"docker\", \"model\", \"start-runner\")\n\t\ttime.Sleep(2 * time.Second)\n\t}\n\n\treturn fmt.Errorf(\"could not start docker-model-runner after 3 attempts\")\n}\n\n// getDockerModelRunnerIP returns the IP address of the docker-model-runner container.\nfunc getDockerModelRunnerIP(guest environment.VM) (string, error) {\n\toutput, err := guest.RunOutput(\"docker\", \"inspect\", \"docker-model-runner\",\n\t\t\"--format\", \"{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}\")\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"failed to get container IP: %w\", err)\n\t}\n\n\tip := strings.TrimSpace(output)\n\tif ip == \"\" {\n\t\treturn \"\", fmt.Errorf(\"container IP is empty\")\n\t}\n\n\treturn ip, nil\n}\n","sourceCodeStart":260,"sourceCodeEnd":296,"githubUrl":"https://github.com/abiosoft/colima/blob/c3a5f9184d83a197184f897a9f07eb3c01b3bc88/model/docker.go#L260-L296","documentation":"ensureDockerModelRunner loops up to 3 times: it checks guest.RunQuiet(\"docker\",\"inspect\",\"docker-model-runner\") and, when absent, runs `docker model start-runner` then sleeps 2s. This error means the container was still not inspectable after the third attempt — start-runner is failing (image pull, disk, unsupported docker/arch) or the docker engine in the VM is unhealthy.","triggerScenarios":"docker model start-runner erroring on each attempt (registry unreachable, disk full); docker daemon in the VM not running; docker version/arch without Model Runner support; start-runner taking longer than the fixed 3x2s window.","commonSituations":"Offline/proxied setups that cannot pull the runner image; low disk after storing many models; AMD64 hosts where Model Runner support is unavailable; heavy VM load making 2s sleeps insufficient.","solutions":["Run it manually and read the error: colima ssh -- docker model start-runner","Check the engine: colima ssh -- docker info and docker ps; restart colima if the daemon is wedged","Free disk space and retry","Update Docker/colima; confirm Model Runner is supported on your arch/OS combination"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// Cheaper than looping: verify model support before attempting starts.\nfunc modelRunnerAvailable(guest environment.VM) bool {\n    return guest.RunQuiet(\"docker\", \"model\", \"version\") == nil\n}","typeGuard":null,"tryCatchPattern":"for attempt := 1; attempt <= 3; attempt++ {\n    if guest.RunQuiet(\"docker\", \"inspect\", \"docker-model-runner\") == nil { return nil }\n    _ = guest.Run(\"docker\", \"model\", \"start-runner\")\n    time.Sleep(time.Duration(attempt) * 2 * time.Second) // backoff\n}\nreturn fmt.Errorf(\"could not start docker-model-runner after 3 attempts — run 'docker model start-runner' in the VM for the real error\")","preventionTips":["Check docker model version support once at start instead of discovering it via failed starts","Keep disk headroom and registry access so start-runner can pull the runner image","Escalate to manual start-runner after two automated failures instead of looping longer"],"tags":["docker","model-runner","retry","startup"],"backgroundTag":null,"analyzedSha":"c3a5f9184d83a197184f897a9f07eb3c01b3bc88","analyzedAt":"2026-08-15T18:58:08.334Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}