abiosoft/colima · warning

error loading oci images: %w

Error message

error loading oci images: %w

What it means

In air-gapped k3s provisioning, colima preloads the downloaded image tarball into the container runtime ('nerdctl -n k8s.io load -i ... --all-platforms' for containerd, or 'docker load -i' for docker) and that load failed. It is explicitly non-fatal: colima logs a warning that startup will be slower because images will be pulled from the registry instead.

Source

Thrown at environment/container/kubernetes/k3s.go:121

		return guest.Run("gzip", "-f", "-d", downloadPathTarGz)
	})

	airGapDir := "/var/lib/rancher/k3s/agent/images/"
	a.Add(func() error {
		return guest.Run("sudo", "mkdir", "-p", airGapDir)
	})
	a.Add(func() error {
		return guest.Run("sudo", "cp", downloadPathTar, airGapDir)
	})

	// load OCI images for K3s
	// this can be safely ignored if failed as the images would be pulled afterwards.
	switch containerRuntime {
	case containerd.Name:
		a.Stage("loading oci images")
		a.Add(func() error {
			if err := guest.Run("sudo", "nerdctl", "-n", "k8s.io", "load", "-i", downloadPathTar, "--all-platforms"); err != nil {
				log.Warnln(fmt.Errorf("error loading oci images: %w", err))
				log.Warnln("startup may delay a bit as images will be pulled from oci registry")
			}
			return nil
		})
	case docker.Name:
		a.Stage("loading oci images")
		a.Add(func() error {
			if err := guest.Run("sudo", "docker", "load", "-i", downloadPathTar); err != nil {
				log.Warnln(fmt.Errorf("error loading oci images: %w", err))
				log.Warnln("startup may delay a bit as images will be pulled from oci registry")
			}
			return nil
		})
	}
}

func installK3sCluster(
	host environment.HostActions,

View on GitHub (pinned to c3a5f9184d)

Solutions

  1. Do nothing if slow first start is acceptable — images pull automatically later
  2. Free guest disk space and re-run: 'colima stop && colima start --kubernetes'
  3. Verify the tarball: 'colima ssh -- sudo nerdctl -n k8s.io load -i <path> --all-platforms' and read the error
  4. For guaranteed air-gap, ensure the downloaded tar matches the VM arch and re-download on checksum mismatch
Defensive patterns

Strategy: fallback

Validate before calling

// verify the tarball is a readable image archive before loading
if err := guest.Run("sudo", "tar", "-tf", downloadPathTar, "manifest.json"); err != nil {
    log.Warnln("oci image tarball looks invalid, will fall back to registry pull")
    return nil
}

Try / catch

if err := guest.Run("sudo", "nerdctl", "-n", "k8s.io", "load", "-i", downloadPathTar, "--all-platforms"); err != nil {
    log.Warnln(fmt.Errorf("error loading oci images: %w", err))
    log.Warnln("startup may delay a bit as images will be pulled from oci registry")
    return nil // deliberate fallback: k3s pulls images on first start
}

Prevention

When it happens

Trigger: guest.Run('sudo','nerdctl','load','-i',tar,'--all-platforms') or the docker equivalent exits non-zero: tarball corrupt/incomplete download, architecture mismatch, containerd/docker socket unavailable at that moment, disk space exhausted while expanding layers.

Common situations: Flaky network during image download, guest disk nearly full, mismatch between image platforms and the VM architecture, containerd not ready when the chain step runs.

Related errors


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