{"record":{"id":"c289f3bae0e1a9f0","repo":"abiosoft/colima","slug":"curl-download-failed-for-s-w","errorCode":null,"errorMessage":"curl download failed for '%s': %w","messagePattern":"curl download failed for '(.+?)': %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"util/downloader/curl.go","lineNumber":58,"sourceCode":"\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\n\tterminal.ClearLine()\n\treturn nil\n}\n","sourceCodeStart":40,"sourceCodeEnd":64,"githubUrl":"https://github.com/abiosoft/colima/blob/c3a5f9184d83a197184f897a9f07eb3c01b3bc88/util/downloader/curl.go#L40-L64","documentation":"The curl subprocess exited non-zero while downloading the URL; %w carries the *exec.ExitError. Because the args include -fSL and -C -, the interesting exit codes are: 22 (HTTP >= 400), 6/7 (DNS/connect), 60 (TLS certificate problem, common with intercepting proxies), and 33 — the server ignored the Range header, so resuming an existing partial file at destPath failed.","triggerScenarios":"404/410 after the artifact moved (exit 22); network or DNS outage (6/7); TLS-intercepting proxy with an untrusted CA (60); retrying against a server that does not support byte ranges while a partial destPath file exists (33).","commonSituations":"Interrupted downloads leaving partial files that then break every subsequent resume; relocated release artifacts; corporate TLS inspection.","solutions":["Reproduce with identical flags to read curl's real error: curl -fSL -C - --progress-bar -o <dest> <URL>","If the exit is 33 (resume unsupported), delete the partial destPath file and download fresh","For 404/410, verify the artifact URL still exists upstream and update it","For TLS errors (60), install the proxy's CA or exclude the host from interception"],"exampleFix":"// before\nif err := cmd.Run(); err != nil {\n\treturn fmt.Errorf(\"curl download failed for '%s': %w\", path.Base(r.URL), err)\n}\n\n// after: recover from unsupported resume by restarting the download\nif err := cmd.Run(); err != nil {\n\tvar ee *exec.ExitError\n\tif errors.As(err, &ee) && ee.ExitCode() == 33 {\n\t\t_ = os.Remove(destPath) // discard partial file\n\t\tif retry := freshCommand(r, destPath); retry != nil { // same args minus -C -\n\t\t\tif err2 := retry.Run(); err2 != nil {\n\t\t\t\treturn fmt.Errorf(\"curl download failed for '%s': %w\", path.Base(r.URL), err2)\n\t\t\t}\n\t\t\tterminal.ClearLine()\n\t\t\treturn nil\n\t\t}\n\t}\n\treturn fmt.Errorf(\"curl download failed for '%s': %w\", path.Base(r.URL), err)\n}","handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"var ee *exec.ExitError\nif errors.As(err, &ee) {\n\tswitch ee.ExitCode() {\n\tcase 33: // resume unsupported: remove the partial file and retry without -C -\n\tcase 22: // HTTP error: verify the URL before retrying\n\tcase 6, 7: // connectivity: retry with backoff\n\tcase 60: // TLS trust: fix the CA bundle, do not retry blindly\n\t}\n}","preventionTips":["Remove partial destination files before starting fresh downloads","Verify artifact URLs in configuration before long download jobs","Prefer the native downloader where server resume support is inconsistent"],"tags":["download","network","curl","retry","tls","go"],"backgroundTag":null,"analyzedSha":"c3a5f9184d83a197184f897a9f07eb3c01b3bc88","analyzedAt":"2026-08-15T18:58:08.334Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}