abiosoft/colima · error

error reading embedded flannel config: %w

Error message

error reading embedded flannel config: %w

What it means

Colima reads the flannel CNI config embedded at build time via go:embed (embedded.Read('k3s/flannel.json')) and the read failed. Since embedded assets are compiled into the binary, failure indicates a broken build or packaging where the asset was absent — effectively a developer/packaging bug, not a runtime condition.

Source

Thrown at environment/container/kubernetes/cni.go:24

	"path/filepath"

	"github.com/abiosoft/colima/cli"
	"github.com/abiosoft/colima/embedded"
	"github.com/abiosoft/colima/environment"
)

func installCniConfig(guest environment.GuestActions, a *cli.ActiveCommandChain) {
	// fix cni config
	a.Add(func() error {
		flannelFile := "/etc/cni/net.d/10-flannel.conflist"
		cniConfDir := filepath.Dir(flannelFile)
		if err := guest.Run("sudo", "mkdir", "-p", cniConfDir); err != nil {
			return fmt.Errorf("error creating cni config dir: %w", err)
		}

		flannel, err := embedded.Read("k3s/flannel.json")
		if err != nil {
			return fmt.Errorf("error reading embedded flannel config: %w", err)
		}
		return guest.Write(flannelFile, flannel)
	})
}

View on GitHub (pinned to c3a5f9184d)

Solutions

  1. Use an official colima release binary
  2. For source builds, verify embedded/k3s/flannel.json exists, then 'go clean -cache && go build'
  3. Run 'colima version' and file an issue including the build source — this should never fail in a correct build
Defensive patterns

Strategy: validation

Validate before calling

// startup self-check for embedded assets (release builds should pass)
if _, err := embedded.Read("k3s/flannel.json"); err != nil {
    return fmt.Errorf("colima build is missing embedded assets; reinstall: %w", err)
}

Try / catch

flannel, err := embedded.Read("k3s/flannel.json")
if err != nil {
    return fmt.Errorf("error reading embedded flannel config: %w", err)
    // not retryable at runtime — the binary must be rebuilt/reinstalled with assets present
}

Prevention

When it happens

Trigger: embedded.Read cannot locate/decrypt 'k3s/flannel.json': asset missing from the embed FS at build time, binary built from a partial checkout, or an embedded-filesystem path typo in a fork/patch.

Common situations: Building colima from a dirty or shallow checkout, third-party forks that moved embedded files, distribution packages that strip embedded resources.

Related errors


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