{"record":{"id":"8fb8fb3722001240","repo":"abiosoft/colima","slug":"failed-to-pull-model-q-w","errorCode":null,"errorMessage":"failed to pull model %q: %w","messagePattern":"failed to pull model %q: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"model/docker.go","lineNumber":156,"sourceCode":"\tguest := lima.New(host.New())\n\toutput, err := guest.RunOutput(\"docker\", \"model\", \"version\")\n\tif err != nil {\n\t\treturn \"\"\n\t}\n\treturn strings.TrimSpace(output)\n}\n\n// EnsureDockerModel ensures a Docker model is available, pulling if necessary.\n// Returns the normalized model name (resolving aliases like hf.co → huggingface.co).\nfunc EnsureDockerModel(modelName string) (string, error) {\n\tguest := lima.New(host.New())\n\n\t// Try to inspect the model first\n\tmodelInfo, err := InspectDockerModel(modelName)\n\tif err != nil {\n\t\t// Model not found locally, try to pull it\n\t\tif pullErr := guest.RunInteractive(\"docker\", \"model\", \"pull\", modelName); pullErr != nil {\n\t\t\treturn \"\", fmt.Errorf(\"failed to pull model %q: %w\", modelName, pullErr)\n\t\t}\n\t\t// Retry inspect after pull\n\t\tmodelInfo, err = InspectDockerModel(modelName)\n\t\tif err != nil {\n\t\t\treturn \"\", fmt.Errorf(\"failed to inspect model %q after pull: %w\", modelName, err)\n\t\t}\n\t}\n\n\t// Return the first tag as the normalized name (e.g., \"docker.io/ai/smollm2:latest\")\n\tif len(modelInfo.Tags) > 0 {\n\t\treturn modelInfo.Tags[0], nil\n\t}\n\treturn modelName, nil\n}\n\n// DockerModelServeConfig holds configuration for serving a Docker model.\ntype DockerModelServeConfig struct {\n\tModelName string // Model name (e.g., \"smollm2\")","sourceCodeStart":138,"sourceCodeEnd":174,"githubUrl":"https://github.com/abiosoft/colima/blob/c3a5f9184d83a197184f897a9f07eb3c01b3bc88/model/docker.go#L138-L174","documentation":"EnsureDockerModel falls back to guest.RunInteractive(\"docker\",\"model\",\"pull\",<modelName>) when inspect fails; a non-zero pull exit produces this wrapped error. The docker pull of the model failed: unknown name/registry path, authentication required, network failure, insufficient disk, or cancellation of the interactive pull.","triggerScenarios":"Model name typo or nonexistent repo (e.g. ai/smollm2 vs ai/smollm2:latest variants); private model without docker login; disk exhausted mid-download (GGUF files are multi-GB); network/proxy drop; user Ctrl-C during the interactive pull.","commonSituations":"First-time use with a misspelled model; corporate proxy environments; default colima disk (60-100GB) filled by earlier models; large 70B models exceeding free space.","solutions":["Reproduce manually for the real message: colima ssh -- docker model pull <name>","Fix the model reference (correct namespace/repo/tag, GGUF variants)","docker login in the VM for private registries","Free/expand disk (docker system prune, docker model rm unused models, or colima stop + resize) and retry"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// Before pulling: crude name sanity + disk headroom check in the VM.\nfunc canPull(guest environment.VM, name string) bool {\n    if len(strings.Split(name, \"/\")) < 2 && !strings.Contains(name, \":\") {\n        return false // likely missing namespace or tag\n    }\n    out, err := guest.RunOutput(\"sh\", \"-c\", \"df -Pk /var/lib/docker | tail -1 | awk '{print $4}'\")\n    return err == nil && out != \"\" // require some free space reported\n}","typeGuard":null,"tryCatchPattern":"if pullErr := guest.RunInteractive(\"docker\", \"model\", \"pull\", modelName); pullErr != nil {\n    return \"\", fmt.Errorf(\"failed to pull model %q: %w (check name, docker login, network, and VM disk)\", modelName, pullErr)\n}","preventionTips":["Pull once interactively to validate the name and auth, then automate","docker login in the VM for private registries before scripted pulls","Keep >2x model-size free disk; GGUF models are multi-GB"],"tags":["docker","model-pull","network","disk-space"],"backgroundTag":null,"analyzedSha":"c3a5f9184d83a197184f897a9f07eb3c01b3bc88","analyzedAt":"2026-08-15T18:58:08.334Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}