abiosoft/colima · error

error watching container volumes: %w

Error message

error watching container volumes: %w

What it means

handleEvents (the inotify event loop) begins by calling monitorContainerVolumes, which only fails synchronously when f.runtime is empty — everything else happens inside a polling goroutine that logs instead of returning. So this wrapper in practice means the inotify process was started without a runtime: the daemon ran with --inotify but Args.Runtime/--inotify-runtime was empty.

Source

Thrown at daemon/process/inotify/events.go:25

	"time"
)

type modEvent struct {
	path string // filename
	fs.FileMode
}

func (m modEvent) Mode() string { return fmt.Sprintf("%o", m.FileMode) }

func (f *inotifyProcess) handleEvents(ctx context.Context, watcher dirWatcher) error {
	log := f.log
	log.Trace("begin inotify event handler")

	mod := make(chan modEvent)
	vols := make(chan []string)

	if err := f.monitorContainerVolumes(ctx, vols); err != nil {
		return fmt.Errorf("error watching container volumes: %w", err)
	}

	var last time.Time
	var cancelWatch context.CancelFunc
	var currentVols []string

	volsChanged := func(vols []string) bool {
		if len(currentVols) != len(vols) {
			return true
		}
		for i := range vols {
			if vols[i] != currentVols[i] {
				return true
			}
		}
		return false
	}

View on GitHub (pinned to c3a5f9184d)

Solutions

  1. pass the runtime explicitly: colima daemon start <profile> --inotify --inotify-runtime docker (or containerd)
  2. if reached via normal `colima start --mount-inotify`, upgrade colima — the CLI is responsible for setting the flag
  3. verify conf.Runtime in the profile config names a supported runtime (docker or containerd)

Example fix

// before
$ colima daemon start default --inotify
error watching container volumes: empty runtime

// after
$ colima daemon start default --inotify --inotify-runtime docker
Defensive patterns

Strategy: validation

Validate before calling

if runtime := conf.Runtime; runtime != docker.Name && runtime != containerd.Name {
    return fmt.Errorf("--mount-inotify needs runtime docker or containerd, got %q", runtime)
}

Type guard

func isInotifyRuntimeErr(err error) bool {
	return err != nil && strings.Contains(err.Error(), "error watching container volumes")
}

Try / catch

if err := proc.Start(ctx); err != nil {
    if strings.Contains(err.Error(), "empty runtime") {
        // configuration bug: re-invoke with --inotify-runtime; do not retry as-is
    }
}

Prevention

When it happens

Trigger: starting the daemon process with `--inotify` but without `--inotify-runtime` (the CLI flag defaults to "docker", so this points to programmatic invocation or a version that fails to forward the flag); calling inotifyProcess.Start with Args{Runtime: ""}.

Common situations: custom scripts invoking `colima daemon start <profile> --inotify` manually; automation that drops flags; mismatched colima/daemon versions after a partial upgrade.

Related errors


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