{"record":{"id":"ea81ba6173411ed7","repo":"abiosoft/colima","slug":"unknown-runner-type-s-valid-options-docker-ra","errorCode":null,"errorMessage":"unknown runner type: %s (valid options: docker, ramalama)","messagePattern":"unknown runner type: (.+?) \\(valid options: docker, ramalama\\)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"model/runner.go","lineNumber":79,"sourceCode":"\t// CheckSetup checks if setup/update is needed and returns version info.\n\t// This should be called before Setup() to display version info on primary screen.\n\tCheckSetup() (SetupStatus, error)\n\t// Setup installs or updates the runner.\n\t// Call CheckSetup() first to determine if setup is needed.\n\tSetup() error\n\t// GetCurrentVersion returns the currently installed version.\n\tGetCurrentVersion() string\n}\n\n// GetRunner returns the appropriate Runner based on type.\nfunc GetRunner(runnerType RunnerType) (Runner, error) {\n\tswitch runnerType {\n\tcase RunnerDocker:\n\t\treturn &dockerRunner{}, nil\n\tcase RunnerRamalama:\n\t\treturn &ramalamaRunner{}, nil\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"unknown runner type: %s (valid options: docker, ramalama)\", runnerType)\n\t}\n}\n\n// validateCommonPrerequisites checks prerequisites common to all runners.\nfunc validateCommonPrerequisites(a app.App) error {\n\t// VM must be running\n\tif !a.Active() {\n\t\treturn fmt.Errorf(\"%s is not running\", config.CurrentProfile().DisplayName)\n\t}\n\n\t// check runtime is docker\n\tr, err := a.Runtime()\n\tif err != nil {\n\t\treturn err\n\t}\n\tif r != docker.Name {\n\t\treturn fmt.Errorf(\"'colima model' requires docker runtime, current runtime is %s\\n\"+\n\t\t\t\"Start colima with: colima start --runtime docker --vm-type krunkit\", r)","sourceCodeStart":61,"sourceCodeEnd":97,"githubUrl":"https://github.com/abiosoft/colima/blob/c3a5f9184d83a197184f897a9f07eb3c01b3bc88/model/runner.go#L61-L97","documentation":"GetRunner is the factory mapping a RunnerType to its Runner implementation; only RunnerDocker and RunnerRamalama are handled, and everything else — including the empty string — falls to the default branch. RunnerType values originate from CLI flags or environment input, so this error indicates unvalidated external input reaching the factory.","triggerScenarios":"Calling GetRunner with any RunnerType other than the docker/ramalama constants: colima model --runner podman, a typo like 'dockerr', or a variable that was never set (empty string).","commonSituations":"Users guessing runner names borrowed from other tools (podman); automation passing values from a mismatched colima version; whitespace or quotes in interpolated values.","solutions":["Pass exactly 'docker' or 'ramalama', matching the valid options quoted in the message","Check the flag/env value for typos and trailing whitespace or stray quotes","If you maintain a fork that adds a runner, extend the switch and the error's option list together"],"exampleFix":"// before\nr, err := GetRunner(runnerType)\n\n// after: reject at the parse boundary instead of deep in the factory\nif !isValidRunnerType(runnerType) {\n\treturn fmt.Errorf(\"unknown runner type: %s (valid options: docker, ramalama)\", runnerType)\n}\nr, err := GetRunner(runnerType)","handlingStrategy":"validation","validationCode":null,"typeGuard":"func isValidRunnerType(rt RunnerType) bool {\n\tswitch rt {\n\tcase RunnerDocker, RunnerRamalama:\n\t\treturn true\n\t}\n\treturn false\n}","tryCatchPattern":null,"preventionTips":["Validate runner flags at the CLI parse boundary the way ValidateDownloader does for downloaders","Keep the isValidRunnerType guard and the GetRunner switch in the same file so they change together","Fail fast on empty runner values — they usually indicate an unset variable"],"tags":["validation","factory","cli","input","go"],"backgroundTag":null,"analyzedSha":"c3a5f9184d83a197184f897a9f07eb3c01b3bc88","analyzedAt":"2026-08-15T18:58:08.334Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}