{"record":{"id":"0567f6994a5264a8","repo":"abiosoft/colima","slug":"curl-not-found-in-path-w","errorCode":null,"errorMessage":"curl not found in PATH: %w","messagePattern":"curl not found in PATH: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"util/downloader/curl.go","lineNumber":42,"sourceCode":"func 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\n\t\tr.URL,\n\t}\n\n\tcmd := exec.Command(\"curl\", args...)\n\tcmd.Stdout = os.Stdout\n\tcmd.Stderr = os.Stderr\n\n\tif err := cmd.Run(); err != nil {\n\t\treturn fmt.Errorf(\"curl download failed for '%s': %w\", path.Base(r.URL), err)\n\t}\n","sourceCodeStart":24,"sourceCodeEnd":60,"githubUrl":"https://github.com/abiosoft/colima/blob/c3a5f9184d83a197184f897a9f07eb3c01b3bc88/util/downloader/curl.go#L24-L60","documentation":"curlDownloader.Download resolves the curl executable with exec.LookPath before spawning it; if no curl binary is found on PATH the download aborts with the LookPath error wrapped. The curl downloader is only selected when configuration asks for it (COLIMA_DOWNLOADER=curl); the native downloader needs no external binary.","triggerScenarios":"COLIMA_DOWNLOADER=curl on systems without curl installed: minimal or distroless containers, slim CI images, or a PATH that omits the directory containing curl.","commonSituations":"Running colima or embedding its downloader inside scratch/alpine images that ship no curl; CI images trimmed of extra CLI tools.","solutions":["Install curl: apt-get install -y curl / apk add curl / brew install curl","Switch to the native downloader — unset COLIMA_DOWNLOADER or set it to 'native'; it needs no external binary","If curl is installed but not found, fix PATH so command -v curl resolves it"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// pick the downloader based on actual tool availability\nchoice := \"curl\"\nif _, err := exec.LookPath(\"curl\"); err != nil {\n\tchoice = \"native\" // no external binary required\n}","typeGuard":"func curlAvailable() bool {\n\t_, err := exec.LookPath(\"curl\")\n\treturn err == nil\n}","tryCatchPattern":null,"preventionTips":["Default to the native downloader in containers","Verify tool presence before selecting an implementation that shells out","Bake curl into CI images if the curl downloader is required for proxy reasons"],"tags":["downloader","environment","path","curl","go"],"backgroundTag":null,"analyzedSha":"c3a5f9184d83a197184f897a9f07eb3c01b3bc88","analyzedAt":"2026-08-15T18:58:08.334Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}