{"record":{"id":"61fb2036cae5f8f6","repo":"abiosoft/colima","slug":"empty-runtime","errorCode":null,"errorMessage":"empty runtime","messagePattern":"empty runtime","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"daemon/process/inotify/volumes.go","lineNumber":20,"sourceCode":"\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"sort\"\n\t\"strings\"\n\t\"time\"\n\n\t\"github.com/abiosoft/colima/environment/container/containerd\"\n\t\"github.com/abiosoft/colima/environment/container/docker\"\n)\n\nfunc (f *inotifyProcess) monitorContainerVolumes(ctx context.Context, c chan<- []string) error {\n\tlog := f.log\n\n\tif f.runtime == \"\" {\n\t\treturn fmt.Errorf(\"empty runtime\")\n\t}\n\n\tfetch := func() ([]string, error) {\n\t\tvar vols []string\n\n\t\tswitch f.runtime {\n\n\t\tcase docker.Name:\n\t\t\tvols, err := f.fetchVolumes(docker.Name)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"error fetching docker volumes: %w\", err)\n\t\t\t}\n\t\t\treturn vols, nil\n\n\t\tcase containerd.Name:\n\t\t\tvar namespaces []string\n\t\t\tout, err := f.guest.RunOutput(\"sudo\", \"nerdctl\", \"namespace\", \"list\", \"-q\")\n\t\t\tif err != nil {","sourceCodeStart":2,"sourceCodeEnd":38,"githubUrl":"https://github.com/abiosoft/colima/blob/c3a5f9184d83a197184f897a9f07eb3c01b3bc88/daemon/process/inotify/volumes.go#L2-L38","documentation":"monitorContainerVolumes requires a container runtime name in f.runtime (populated from Args.Runtime / --inotify-runtime). Empty string aborts immediately, before the 5-second polling goroutine starts — this is the raw check that error 104 wraps. Note the switch has no default: any runtime name other than docker/containerd silently produces no volumes rather than an error.","triggerScenarios":"the daemon's inotify process constructed/started with Runtime=\"\"; context Args missing the Runtime field; custom embedding of the inotify process without wiring the flag.","commonSituations":"manual daemon invocations skipping --inotify-runtime; colima versions or wrappers that forward an empty runtime; test harnesses reusing inotify.New() directly.","solutions":["always pass --inotify-runtime docker or --inotify-runtime containerd when enabling --inotify","stick to the two recognized runtime names — they are the only branches in volumes.go","upgrade colima if the standard `colima start --mount-inotify` path leaves the runtime empty"],"exampleFix":"// before\ncolima daemon start default --inotify            // runtime empty\n\n// after\ncolima daemon start default --inotify --inotify-runtime containerd","handlingStrategy":"validation","validationCode":"switch args.Runtime {\ncase docker.Name, containerd.Name:\ndefault:\n    return fmt.Errorf(\"unsupported inotify runtime %q (want docker|containerd)\", args.Runtime)\n}\nf.runtime = args.Runtime","typeGuard":"func supportedRuntime(r string) bool { return r == docker.Name || r == containerd.Name }","tryCatchPattern":"if err := f.monitorContainerVolumes(ctx, vols); err != nil {\n    if strings.Contains(err.Error(), \"empty runtime\") {\n        return fmt.Errorf(\"inotify misconfigured: set --inotify-runtime\") // config error, no retry\n    }\n}","preventionTips":["default --inotify-runtime in your own tooling the way cmd/daemon does (\"docker\")","validate Args.Runtime at daemon startup, not deep inside the volume monitor","add a test that Start fails fast with a clear message when Runtime is empty"],"tags":["inotify","runtime","validation"],"backgroundTag":null,"analyzedSha":"c3a5f9184d83a197184f897a9f07eb3c01b3bc88","analyzedAt":"2026-08-15T18:58:08.334Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}