abiosoft/colima · error
error during image download: %w
Error message
error during image download: %w
What it means
Wrapped error returned by downloadImage when downloader.Download fails to fetch the VM disk image. The request carries the image URL and, when known, a sha512 digest; failure covers network errors, HTTP failures (404/403), and digest verification mismatches.
Source
Thrown at environment/vm/lima/limautil/image.go:165
}
files[arch.GoArch()] = file
diskImageMap[runtime] = files
}
return nil
}
// downloadImage downloads the file and returns the location of the downloaded file.
func downloadImage(host environment.HostActions, file limaconfig.File) (string, error) {
// download image
request := downloader.Request{URL: file.Location}
if file.Digest != "" {
request.SHA = &downloader.SHA{Size: 512, Digest: file.Digest}
}
location, err := downloader.Download(host, request)
if err != nil {
return "", fmt.Errorf("error during image download: %w", err)
}
return location, nil
}
// qcow2ToRaw uses qemu-img to conver the image from qcow to raw.
// Returns the filename of the raw file and an error (if any).
func qcow2ToRaw(host environment.Host, image diskImageFile) (string, error) {
if _, err := os.Stat(image.Raw()); err == nil {
// already exists, return
return image.Raw(), nil
}
err := host.Run("qemu-img", "convert", "-f", "qcow2", "-O", "raw", image.String(), image.Raw())
if err != nil {
// remove the incomplete raw file
_ = host.RunQuiet("rm", "-f", image.Raw())
return "", errView on GitHub (pinned to c3a5f9184d)
Solutions
- Check connectivity to the image URL (curl -I) and fix proxy/DNS/VPN
- If using an image mirror, verify it actually serves the path that replaced the github.com prefix, or drop the mirror setting
- Clear the partial download from the downloader cache and retry 'colima start'
- Retry later if GitHub is having an incident
Example fix
# before: mirror 404 -> error during image download export COLIMA_IMAGE_MIRROR=https://mirror.example.com # after: use a mirror that mirrors github release assets, or unset it unset COLIMA_IMAGE_MIRROR
Defensive patterns
Strategy: retry
Validate before calling
// cheap pre-flight before the big download
resp, err := http.Head(img.Location)
if err != nil || resp.StatusCode >= 400 {
return fmt.Errorf("image URL unreachable (status %d): aborting before download", resp.StatusCode)
} Try / catch
Wrap DownloadImage in bounded retry with backoff; abort retries early if the cause is a digest mismatch (strings.Contains(err.Error(), "sha512") or "digest"), since retries cannot fix corruption — clear the cache instead.
Prevention
- Validate mirrors actually mirror GitHub release assets before pointing colima at them
- Keep the downloader cache clearable: know its location so a corrupt file can be removed
- In CI, pre-cache the image artifact and run with the cache warm
When it happens
Trigger: Calling DownloadImage with no internet, through a breaking proxy, with a mirror that returns 404 (mirrorURL swaps the https://github.com prefix for the mirror), or when the downloaded bytes fail the embedded sha512 check.
Common situations: Corporate proxy/MITM certificate breaking the GitHub asset download; misconfigured image mirror; truncated download on flaky Wi-Fi causing checksum failure; GitHub outage during first 'colima start'.
Related errors
- error getting qcow image: %w
- error provisioning %s: %w
- failed to fetch releases: %w
- failed to decode response: %w
- curl download failed for '%s': %w
AI-assisted analysis of abiosoft/colima@c3a5f9184d (2026-08-15).
Data as JSON: /api/errors/fd81e94bf13021b6.
Report an issue: GitHub.