{"record":{"id":"1f0358c2b90d0fda","repo":"abiosoft/colima","slug":"invalid-downloader-q-must-be-one-of-s-s","errorCode":null,"errorMessage":"invalid downloader %q: must be one of %s, %s","messagePattern":"invalid downloader %q: must be one of (.+?), (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"util/downloader/curl.go","lineNumber":31,"sourceCode":"const (\n\t// DownloaderNative uses Go's native HTTP client\n\tDownloaderNative = \"native\"\n\t// DownloaderCurl uses the curl command (honors .curlrc)\n\tDownloaderCurl = \"curl\"\n\n\tenvDownloader = \"COLIMA_DOWNLOADER\"\n)\n\n// ValidateDownloader validates the downloader value (case-insensitive).\n// Returns the normalized value or an error if invalid.\nfunc ValidateDownloader(v string) (string, error) {\n\tswitch strings.ToLower(v) {\n\tcase DownloaderNative:\n\t\treturn DownloaderNative, nil\n\tcase DownloaderCurl:\n\t\treturn DownloaderCurl, nil\n\tdefault:\n\t\treturn \"\", fmt.Errorf(\"invalid downloader %q: must be one of %s, %s\", v, DownloaderNative, DownloaderCurl)\n\t}\n}\n\n// curlDownloader handles downloads using the curl command\ntype curlDownloader struct{}\n\n// Download downloads a file using curl\nfunc (c *curlDownloader) Download(r Request, destPath string) error {\n\t// check if curl is available\n\tif _, err := exec.LookPath(\"curl\"); err != nil {\n\t\treturn fmt.Errorf(\"curl not found in PATH: %w\", err)\n\t}\n\n\targs := []string{\n\t\t\"-fSL\",    // fail on HTTP errors, show errors, follow redirects\n\t\t\"-C\", \"-\", // resume if possible (auto-detect offset)\n\t\t\"--progress-bar\", // show progress bar\n\t\t\"-o\", destPath,   // output file","sourceCodeStart":13,"sourceCodeEnd":49,"githubUrl":"https://github.com/abiosoft/colima/blob/c3a5f9184d83a197184f897a9f07eb3c01b3bc88/util/downloader/curl.go#L13-L49","documentation":"ValidateDownloader normalizes the downloader choice case-insensitively and accepts exactly two values: DownloaderNative ('native', the Go built-in) and DownloaderCurl ('curl'). Anything else — 'wget', 'curl' with trailing whitespace, or the empty string — reaches the default branch and is rejected, quoting both the offending value and the allowed set.","triggerScenarios":"COLIMA_DOWNLOADER is set to an unsupported value (e.g. wget) or a downloader flag carries a typo, and any colima code path that downloads artifacts runs.","commonSituations":"Copy-pasted environment snippets from tutorials suggesting wget; trailing whitespace or quotes inside env values; stale values from older versions.","solutions":["Set the value to exactly 'native' or 'curl' (any casing)","Unset COLIMA_DOWNLOADER entirely to use the built-in default","Inspect for hidden characters: printf '%s' \"$COLIMA_DOWNLOADER\" | od -c"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":"func isValidDownloader(v string) bool {\n\t_, err := ValidateDownloader(strings.TrimSpace(v))\n\treturn err == nil\n}","tryCatchPattern":null,"preventionTips":["Validate env-derived settings once at process start","Trim whitespace before validating user-supplied config values","Prefer 'native' — it has no external dependency"],"tags":["validation","configuration","environment","downloader","go"],"backgroundTag":null,"analyzedSha":"c3a5f9184d83a197184f897a9f07eb3c01b3bc88","analyzedAt":"2026-08-15T18:58:08.334Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}