{"record":{"id":"4b087986a63a9b27","repo":"abiosoft/colima","slug":"failed-to-inspect-model-q-after-pull-w","errorCode":null,"errorMessage":"failed to inspect model %q after pull: %w","messagePattern":"failed to inspect model %q after pull: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"model/docker.go","lineNumber":161,"sourceCode":"\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\")\n\tPort      int    // Host port to expose the model on\n\tThreads   int    // Number of CPU threads (default: 2)\n\tGPULayers int    // Number of GPU layers (default: 999 = all)\n}\n","sourceCodeStart":143,"sourceCodeEnd":179,"githubUrl":"https://github.com/abiosoft/colima/blob/c3a5f9184d83a197184f897a9f07eb3c01b3bc88/model/docker.go#L143-L179","documentation":"After a pull that exited 0, EnsureDockerModel re-runs InspectDockerModel; if that still fails this error is returned. The pull claimed success but the model is still not inspectable: registration lag, inspect output unparseable (see error 227), or the pulled alias normalizes to a name inspect cannot resolve back.","triggerScenarios":"Pull succeeded under an alias (hf.co/...) but inspect of the original modelName still 404s; inspect CLI error right after pull while metadata settles; the parsing failure of error 227 recurring post-pull.","commonSituations":"Alias normalization mismatches between pull and inspect; slow VMs where the model registry is not yet consistent; Docker CLI/Model Runner version skew.","solutions":["List what actually landed: colima ssh -- docker model ls — inspect the exact listed name","Retry serve/ensure with the name exactly as shown by docker model ls","Check whether the inner error is a parse failure (error 227) rather than not-found, and address that","Update Docker/colima to versions whose alias handling agrees"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// After a successful pull, allow metadata a moment to settle before re-inspect.\ntime.Sleep(2 * time.Second)\nmodelInfo, err = InspectDockerModel(modelName)","typeGuard":null,"tryCatchPattern":"var modelInfo *DockerModelInfo\nfor attempt := 0; attempt < 3; attempt++ {\n    info, err := InspectDockerModel(modelName)\n    if err == nil { modelInfo = info; break }\n    if attempt == 2 {\n        return \"\", fmt.Errorf(\"failed to inspect model %q after pull: %w\", modelName, err)\n    }\n    time.Sleep(2 * time.Second)\n}","preventionTips":["Use the exact name reported by docker model ls for subsequent inspect calls","Treat pull->inspect as eventually consistent; brief retries smooth registration lag","Watch for parse failures (distinct from not-found) and fix parsing instead of re-pulling"],"tags":["docker","model-pull","inspect","aliasing"],"backgroundTag":null,"analyzedSha":"c3a5f9184d83a197184f897a9f07eb3c01b3bc88","analyzedAt":"2026-08-15T18:58:08.334Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}