{"record":{"id":"0dbecff788a84a7b","repo":"abiosoft/colima","slug":"error-listing-models-w","errorCode":null,"errorMessage":"error listing models: %w","messagePattern":"error listing models: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"model/runner.go","lineNumber":185,"sourceCode":"\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tif len(models) == 0 {\n\t\treturn \"\", nil\n\t}\n\t// Return the first tag of the first model\n\tif len(models[0].Tags) > 0 {\n\t\treturn models[0].Tags[0], nil\n\t}\n\treturn \"\", nil\n}\n\n// listDockerModels returns all available models from docker model list.\nfunc listDockerModels() ([]dockerModel, error) {\n\tguest := lima.New(host.New())\n\toutput, err := guest.RunOutput(\"docker\", \"model\", \"list\", \"--json\")\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error listing models: %w\", err)\n\t}\n\n\toutput = strings.TrimSpace(output)\n\tif output == \"\" || output == \"[]\" {\n\t\treturn nil, nil\n\t}\n\n\tvar models []dockerModel\n\tif err := json.Unmarshal([]byte(output), &models); err != nil {\n\t\treturn nil, fmt.Errorf(\"error parsing model list: %w\", err)\n\t}\n\n\treturn models, nil\n}\n\n// ResolveModelName resolves a short model name to its full tag.\n// Supports flexible matching:\n//   - \"smollm2\" resolves to \"docker.io/ai/smollm2:latest\"","sourceCodeStart":167,"sourceCodeEnd":203,"githubUrl":"https://github.com/abiosoft/colima/blob/c3a5f9184d83a197184f897a9f07eb3c01b3bc88/model/runner.go#L167-L203","documentation":"listDockerModels executes `docker model list --json` inside the VM via guest.RunOutput and a non-zero exit surfaces here. Typical roots: the VM's docker engine/CLI lacks the model subcommand (older Docker), the docker daemon is unreachable inside the VM, or the call was made without the prerequisite checks (VM running) having passed.","triggerScenarios":"Docker version in the colima VM predates `docker model`; docker daemon wedged or still initializing inside the VM; invoking listDockerModels directly, bypassing validateCommonPrerequisites.","commonSituations":"Older colima VM images carrying older Docker; commands run right after colima start while dockerd is not yet ready.","solutions":["See the real error by running it in the VM: colima ssh -- docker model list --json","Upgrade the VM's docker engine (colima stop && colima start --upgrade) so the model plugin exists","Always enter through the public paths that call validateCommonPrerequisites first (VM running, docker runtime, krunkit)"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// probe plugin availability before parsing-dependent flows\nif _, err := guest.RunOutput(\"docker\", \"model\", \"--help\"); err != nil {\n\treturn nil, fmt.Errorf(\"docker model plugin not available in VM: %w\", err)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep the VM's docker engine current via colima start --upgrade","Never call listDockerModels before VM/runtime prerequisites pass","After colima start, wait for docker info to succeed before issuing model commands"],"tags":["docker","models","vm","shell","go"],"backgroundTag":null,"analyzedSha":"c3a5f9184d83a197184f897a9f07eb3c01b3bc88","analyzedAt":"2026-08-15T18:58:08.334Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}