{"record":{"id":"d6b93b6957ab1d89","repo":"abiosoft/colima","slug":"error-inspecting-model-q-w","errorCode":null,"errorMessage":"error inspecting model %q: %w","messagePattern":"error inspecting model %q: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"model/docker.go","lineNumber":102,"sourceCode":"\t// Create bundle directory and hard-link the blob (same approach as Docker Model Runner)\n\tbundleDir := fmt.Sprintf(\"/models/bundles/sha256/%s/model\", modelHash)\n\tif err := guest.RunQuiet(\"docker\", \"exec\", \"docker-model-runner\", \"mkdir\", \"-p\", bundleDir); err != nil {\n\t\treturn \"\", fmt.Errorf(\"failed to create bundle directory: %w\", err)\n\t}\n\n\tif err := guest.RunQuiet(\"docker\", \"exec\", \"docker-model-runner\", \"ln\", blobPath, bundlePath); err != nil {\n\t\treturn \"\", fmt.Errorf(\"failed to link model file: %w\", err)\n\t}\n\n\treturn bundlePath, nil\n}\n\n// InspectDockerModel returns information about a Docker model.\nfunc InspectDockerModel(modelName string) (*DockerModelInfo, error) {\n\tguest := lima.New(host.New())\n\toutput, err := guest.RunOutput(\"docker\", \"model\", \"inspect\", modelName)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error inspecting model %q: %w\", modelName, err)\n\t}\n\n\tvar info DockerModelInfo\n\tif err := json.Unmarshal([]byte(strings.TrimSpace(output)), &info); err != nil {\n\t\treturn nil, fmt.Errorf(\"error parsing model info: %w\", err)\n\t}\n\n\treturn &info, nil\n}\n\n// SetupOrUpdateDocker reinstalls Docker Model Runner in the VM.\nfunc SetupOrUpdateDocker() error {\n\tguest := lima.New(host.New())\n\n\tlog.Println(\"reinstalling Docker Model Runner...\")\n\n\tif err := guest.RunInteractive(\"docker\", \"model\", \"reinstall-runner\"); err != nil {\n\t\treturn fmt.Errorf(\"error reinstalling Docker Model Runner: %w\", err)","sourceCodeStart":84,"sourceCodeEnd":120,"githubUrl":"https://github.com/abiosoft/colima/blob/c3a5f9184d83a197184f897a9f07eb3c01b3bc88/model/docker.go#L84-L120","documentation":"InspectDockerModel runs guest.RunOutput(\"docker\",\"model\",\"inspect\",<modelName>) in the colima VM; non-zero exit produces this error. The docker CLI in the VM failed: model not present locally, the 'model' subcommand missing from that docker build, the runner backend not running, or the name/alias unresolvable.","triggerScenarios":"Calling InspectDockerModel/EnsureDockerModel for a model that was never pulled; VM docker CLI predates the 'docker model' command; docker-model-runner stopped so inspect cannot resolve the model; typo or wrong alias (e.g. hf.co vs huggingface.co namespace).","commonSituations":"First use of colima model serve before any pull; colima VM created with an older Docker version; switching between Docker Desktop and colima contexts; private registries without login.","solutions":["Run it manually to see the real error: colima ssh -- docker model inspect <name>","Pull first: docker model pull <name> (EnsureDockerModel does this automatically when inspect fails)","Check docker model support in the VM: colima ssh -- docker model version; if absent, update Docker/colima and restart","Fix the model reference (correct namespace/alias) and ensure docker login for private models"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// Optional pre-check that the docker CLI even supports models.\nfunc dockerModelSupported(guest environment.VM) bool {\n    return guest.RunQuiet(\"docker\", \"model\", \"version\") == nil\n}","typeGuard":null,"tryCatchPattern":"modelInfo, err := InspectDockerModel(modelName)\nif err != nil {\n    // inspect failure doubles as \"not found\": fall through to pull, but keep the cause\n    if pullErr := guest.RunInteractive(\"docker\", \"model\", \"pull\", modelName); pullErr != nil {\n        return \"\", fmt.Errorf(\"model %q not inspectable (%v) and pull failed: %w\", modelName, err, pullErr)\n    }\n    modelInfo, err = InspectDockerModel(modelName)\n}","preventionTips":["Use EnsureDockerModel rather than raw inspect — it tolerates not-found by pulling","Confirm 'docker model version' works in the VM before scripting model workflows","docker login in the VM for private models; verify exact model namespace before inspect"],"tags":["docker","model-runner","inspect","cli"],"backgroundTag":null,"analyzedSha":"c3a5f9184d83a197184f897a9f07eb3c01b3bc88","analyzedAt":"2026-08-15T18:58:08.334Z","schemaVersion":2},"datasetVersion":"2026-08-16T03:17:38.424Z"}