abiosoft/colima · error
error downloading '%s': %w
Error message
error downloading '%s': %w
What it means
client.Download failed during the actual GET: a network error mid-transfer, an HTTP status error, or one of the local-file errors from http.go (create/truncate/seek). When the server exposed an ETag, resume info was saved to <cache>.resume so the next attempt continues from the bytes already on disk instead of restarting.
Source
Thrown at util/downloader/native.go:57
finalURL, err := client.GetFinalURL(ctx, r.URL)
if err != nil {
return fmt.Errorf("error resolving download URL '%s': %w", r.URL, err)
}
// download the file
result, err := client.Download(ctx, DownloadOptions{
URL: finalURL,
DestPath: destPath,
ExpectedETag: resumeInfo.ETag,
ResumeFromByte: existingSize,
ShowProgress: true,
})
if err != nil {
// save resume info for next attempt if we have ETag
if result != nil && result.ETag != "" {
d.saveResumeInfo(r.URL, result.ETag, existingSize)
}
return fmt.Errorf("error downloading '%s': %w", path.Base(r.URL), err)
}
// clean up resume info on successful download
_ = os.Remove(resumeInfoPath)
return nil
}
View on GitHub (pinned to c3a5f9184d)
Solutions
- Simply retry — resume is automatic when an ETag was captured
- Check and free disk space first
- For repeated corruption or 416 (Range Not Satisfiable), clear the .resume and .downloading files and start fresh
- Stabilize the network or download during off-peak if the 2h timeout is the binding constraint
Example fix
// before: single attempt, fail hard
if err := fileDownloader.Download(req, dest); err != nil {
return err
}
// after: retry loop, network errors only
var err error
for attempt := 0; attempt < 3; attempt++ {
err = fileDownloader.Download(req, dest)
if err == nil {
break
}
var ne *downloader.NetworkError
if !errors.As(err, &ne) {
break
}
time.Sleep(time.Duration(attempt+1) * 5 * time.Second)
}
if err != nil {
return err
} Defensive patterns
Strategy: retry
Type guard
func isNetworkErr(err error) bool {
var ne *downloader.NetworkError
return errors.As(err, &ne)
} Try / catch
var err error
for attempt := 0; attempt < 3; attempt++ {
err = fileDownloader.Download(req, dest)
if err == nil {
break
}
if !isNetworkErr(err) {
break // local-file or HTTP status errors need human action, not retries
}
time.Sleep(time.Duration(attempt+1) * 5 * time.Second) // resume continues from .resume info
}
if err != nil {
return err
} Prevention
- Always retry interrupted downloads — the ETag/.resume mechanism makes retries cheap
- Check disk space before starting; a full disk turns every retry into failure
- For flaky links, increase attempt counts and backoff rather than disabling resume
When it happens
Trigger: Connection reset/timeout mid-download; the 2-hour context deadline expires on very large files over slow links; disk fills while writing; server aborts the range request.
Common situations: Unstable Wi-Fi/VPN; huge images on slow links; proxies killing long transfers; low disk space.
Related errors
- curl download failed for '%s': %w
- error resolving download URL '%s': %w
- error downloading SHA file from '%s': %w
- error getting qcow image: %w
- error during image download: %w
AI-assisted analysis of abiosoft/colima@c3a5f9184d (2026-08-15).
Data as JSON: /api/errors/cf40867f142be999.
Report an issue: GitHub.