{"record":{"id":"a5bb5ece8b8c1a98","repo":"abiosoft/colima","slug":"error-watching-container-volumes-w","errorCode":null,"errorMessage":"error watching container volumes: %w","messagePattern":"error watching container volumes: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"daemon/process/inotify/events.go","lineNumber":25,"sourceCode":"\t\"time\"\n)\n\ntype modEvent struct {\n\tpath string // filename\n\tfs.FileMode\n}\n\nfunc (m modEvent) Mode() string { return fmt.Sprintf(\"%o\", m.FileMode) }\n\nfunc (f *inotifyProcess) handleEvents(ctx context.Context, watcher dirWatcher) error {\n\tlog := f.log\n\tlog.Trace(\"begin inotify event handler\")\n\n\tmod := make(chan modEvent)\n\tvols := make(chan []string)\n\n\tif err := f.monitorContainerVolumes(ctx, vols); err != nil {\n\t\treturn fmt.Errorf(\"error watching container volumes: %w\", err)\n\t}\n\n\tvar last time.Time\n\tvar cancelWatch context.CancelFunc\n\tvar currentVols []string\n\n\tvolsChanged := func(vols []string) bool {\n\t\tif len(currentVols) != len(vols) {\n\t\t\treturn true\n\t\t}\n\t\tfor i := range vols {\n\t\t\tif vols[i] != currentVols[i] {\n\t\t\t\treturn true\n\t\t\t}\n\t\t}\n\t\treturn false\n\t}\n","sourceCodeStart":7,"sourceCodeEnd":43,"githubUrl":"https://github.com/abiosoft/colima/blob/c3a5f9184d83a197184f897a9f07eb3c01b3bc88/daemon/process/inotify/events.go#L7-L43","documentation":"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.","triggerScenarios":"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: \"\"}.","commonSituations":"custom scripts invoking `colima daemon start <profile> --inotify` manually; automation that drops flags; mismatched colima/daemon versions after a partial upgrade.","solutions":["pass the runtime explicitly: colima daemon start <profile> --inotify --inotify-runtime docker (or containerd)","if reached via normal `colima start --mount-inotify`, upgrade colima — the CLI is responsible for setting the flag","verify conf.Runtime in the profile config names a supported runtime (docker or containerd)"],"exampleFix":"// before\n$ colima daemon start default --inotify\nerror watching container volumes: empty runtime\n\n// after\n$ colima daemon start default --inotify --inotify-runtime docker","handlingStrategy":"validation","validationCode":"if runtime := conf.Runtime; runtime != docker.Name && runtime != containerd.Name {\n    return fmt.Errorf(\"--mount-inotify needs runtime docker or containerd, got %q\", runtime)\n}","typeGuard":"func isInotifyRuntimeErr(err error) bool {\n\treturn err != nil && strings.Contains(err.Error(), \"error watching container volumes\")\n}","tryCatchPattern":"if err := proc.Start(ctx); err != nil {\n    if strings.Contains(err.Error(), \"empty runtime\") {\n        // configuration bug: re-invoke with --inotify-runtime; do not retry as-is\n    }\n}","preventionTips":["always pair --inotify with --inotify-runtime docker|containerd in manual daemon calls","rely on `colima start --mount-inotify` rather than driving `colima daemon` by hand","unit-test Args wiring so Runtime is never empty when the process starts"],"tags":["inotify","runtime","daemon","configuration"],"backgroundTag":null,"analyzedSha":"c3a5f9184d83a197184f897a9f07eb3c01b3bc88","analyzedAt":"2026-08-15T18:58:08.334Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}