{"record":{"id":"749f7bad25bf3921","repo":"abiosoft/colima","slug":"failed-to-pull-model-q-w-749f7b","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/ramalama.go","lineNumber":141,"sourceCode":"\n\treturn name\n}\n\n// EnsureRamalamaModel ensures a ramalama model is available, pulling if necessary.\nfunc EnsureRamalamaModel(modelName string) error {\n\tif ramalamaModelExists(modelName) {\n\t\treturn nil\n\t}\n\n\t// Model not found locally, pull it\n\tguest := lima.New(host.New())\n\tshellCmd := fmt.Sprintf(\n\t\t`export RAMALAMA_CONTAINER_ENGINE=docker PATH=\"$HOME/.local/bin:$PATH\"; ramalama pull %s`,\n\t\tmodelName,\n\t)\n\n\tif err := guest.RunInteractive(\"sh\", \"-c\", shellCmd); err != nil {\n\t\treturn fmt.Errorf(\"failed to pull model %q: %w\", modelName, err)\n\t}\n\n\treturn nil\n}\n\n// ProvisionRamalama installs ramalama and its dependencies in the VM.\nfunc ProvisionRamalama() error {\n\tguest := lima.New(host.New())\n\n\tscript := `set -e\nexport PATH=\"$HOME/.local/bin:$PATH\"\n\n# ensure pipx is available\nsudo apt-get update -y && sudo apt-get install -y pipx\n\n# install ramalama via pipx; upgrade if ramalama is already installed\nif command -v ramalama >/dev/null 2>&1; then\n  pipx upgrade ramalama","sourceCodeStart":123,"sourceCodeEnd":159,"githubUrl":"https://github.com/abiosoft/colima/blob/c3a5f9184d83a197184f897a9f07eb3c01b3bc88/model/ramalama.go#L123-L159","documentation":"EnsureModelAvailable runs `ramalama pull <model>` inside the Lima VM through guest.RunInteractive, after ramalamaModelExists reported the model absent locally; the error means that interactive shell command exited non-zero. %q carries the requested model name and %w the shell exit error from the VM.","triggerScenarios":"The model identifier does not exist on its source registry (typo in an ollama/hf.co/quay reference); the VM has no internet egress; registry authentication is required; the VM disk is full; the user aborts the interactive pull with Ctrl-C.","commonSituations":"Typo'd model names passed to colima model run; VPN cut-offs isolating the VM; VM disk (colima disk size) exhausted after pulling several multi-GB models.","solutions":["Reproduce inside the VM to see ramalama's own error: colima ssh -- sh -c 'PATH=$HOME/.local/bin:$PATH ramalama pull <model>'","Check VM disk headroom: colima ssh -- df -h, and grow with colima stop && colima start --disk if full","Verify VM internet egress and DNS: colima ssh -- curl -I https://ollama.com","Use the exact model identifiers listed by colima model list / ramalama ls"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// sanity-check the reference shape before triggering a pull\nvar modelRef = regexp.MustCompile(`^(ollama://|huggingface://|hf.co/|quay.io/)[\\w./:-]+$`)\n\nfunc looksLikeModelRef(name string) bool {\n\treturn modelRef.MatchString(name)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["List installed models before pulling to avoid duplicate or typo'd pulls","Keep VM disk headroom above the largest model you plan to pull","Run large pulls on a stable network; a Ctrl-C abort surfaces as this error"],"tags":["models","vm","shell","network","disk","go"],"backgroundTag":null,"analyzedSha":"c3a5f9184d83a197184f897a9f07eb3c01b3bc88","analyzedAt":"2026-08-15T18:58:08.334Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}