abiosoft/colima · error

curl not found in PATH: %w

Error message

curl not found in PATH: %w

What it means

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.

Source

Thrown at util/downloader/curl.go:42

func ValidateDownloader(v string) (string, error) {
	switch strings.ToLower(v) {
	case DownloaderNative:
		return DownloaderNative, nil
	case DownloaderCurl:
		return DownloaderCurl, nil
	default:
		return "", fmt.Errorf("invalid downloader %q: must be one of %s, %s", v, DownloaderNative, DownloaderCurl)
	}
}

// curlDownloader handles downloads using the curl command
type curlDownloader struct{}

// Download downloads a file using curl
func (c *curlDownloader) Download(r Request, destPath string) error {
	// check if curl is available
	if _, err := exec.LookPath("curl"); err != nil {
		return fmt.Errorf("curl not found in PATH: %w", err)
	}

	args := []string{
		"-fSL",    // fail on HTTP errors, show errors, follow redirects
		"-C", "-", // resume if possible (auto-detect offset)
		"--progress-bar", // show progress bar
		"-o", destPath,   // output file
		r.URL,
	}

	cmd := exec.Command("curl", args...)
	cmd.Stdout = os.Stdout
	cmd.Stderr = os.Stderr

	if err := cmd.Run(); err != nil {
		return fmt.Errorf("curl download failed for '%s': %w", path.Base(r.URL), err)
	}

View on GitHub (pinned to c3a5f9184d)

Solutions

  1. Install curl: apt-get install -y curl / apk add curl / brew install curl
  2. Switch to the native downloader — unset COLIMA_DOWNLOADER or set it to 'native'; it needs no external binary
  3. If curl is installed but not found, fix PATH so command -v curl resolves it
Defensive patterns

Strategy: validation

Validate before calling

// pick the downloader based on actual tool availability
choice := "curl"
if _, err := exec.LookPath("curl"); err != nil {
	choice = "native" // no external binary required
}

Type guard

func curlAvailable() bool {
	_, err := exec.LookPath("curl")
	return err == nil
}

Prevention

When it happens

Trigger: COLIMA_DOWNLOADER=curl on systems without curl installed: minimal or distroless containers, slim CI images, or a PATH that omits the directory containing curl.

Common situations: Running colima or embedding its downloader inside scratch/alpine images that ship no curl; CI images trimmed of extra CLI tools.

Related errors


AI-assisted analysis of abiosoft/colima@c3a5f9184d (2026-08-15). Data as JSON: /api/errors/0567f6994a5264a8. Report an issue: GitHub.