{"record":{"id":"74b35374a9f76325","repo":"abiosoft/colima","slug":"error-setting-up-inotify-dependencies-w","errorCode":null,"errorMessage":"error setting up inotify dependencies: %w","messagePattern":"error setting up inotify dependencies: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"environment/vm/lima/daemon.go","lineNumber":44,"sourceCode":"\t\treturn ctx, nil\n\t}\n\n\tctxKeyVmnet := daemon.CtxKey(vmnet.Name)\n\tctxKeyInotify := daemon.CtxKey(inotify.Name)\n\n\t// use a nested chain for convenience\n\ta := l.Init(ctx)\n\tlog := a.Logger()\n\n\tnetworkInstalledKey := struct{ key string }{key: \"network_installed\"}\n\n\t// add inotify to daemon\n\tif conf.MountINotify {\n\t\ta.Add(func() error {\n\t\t\tctx = context.WithValue(ctx, ctxKeyInotify, true)\n\t\t\tdeps, _ := l.daemon.Dependency(ctx, conf, inotify.Name)\n\t\t\tif err := deps.Install(l.host); err != nil {\n\t\t\t\treturn fmt.Errorf(\"error setting up inotify dependencies: %w\", err)\n\t\t\t}\n\t\t\treturn nil\n\t\t})\n\t}\n\n\t// add network processes to daemon\n\tif useVmnet {\n\t\ta.Add(func() error {\n\t\t\tif conf.Network.Address {\n\t\t\t\ta.Stage(\"preparing network\")\n\t\t\t\tctx = context.WithValue(ctx, ctxKeyVmnet, true)\n\t\t\t}\n\t\t\tdeps, root := l.daemon.Dependency(ctx, conf, vmnet.Name)\n\t\t\tif deps.Installed() {\n\t\t\t\tctx = context.WithValue(ctx, networkInstalledKey, true)\n\t\t\t\treturn nil\n\t\t\t}\n","sourceCodeStart":26,"sourceCodeEnd":62,"githubUrl":"https://github.com/abiosoft/colima/blob/c3a5f9184d83a197184f897a9f07eb3c01b3bc88/environment/vm/lima/daemon.go#L26-L62","documentation":"Thrown in the VM daemon setup chain when conf.MountINotify is enabled and deps.Install(l.host) fails for the inotify dependency inside the guest (l.daemon.Dependency(ctx, conf, inotify.Name) then Install). Colima runs a daemon in the VM that forwards host file-change events (fsevents→inotify) so bind-mounted volumes trigger inotify inside containers; installing its dependencies is a hard step of 'colima start --mount-inotify'.","triggerScenarios":"Starting with 'colima start --mount-inotify' (or a config with mountInotify: true) while the guest cannot install/prepare the inotify dependency: apt/apk fetch failure inside the VM during provisioning, guest not fully booted, downloader failing to fetch binaries, or the daemon context wiring failing.","commonSituations":"First start with inotify forwarding enabled on a fresh VM while offline or behind a corporate proxy; slow networks making the dependency fetch exceed limits; partial previous provisioning leaving the daemon in a bad state; macOS hosts where users enable --mount-inotify for webpack/vite HMR in bind mounts.","solutions":["Retry 'colima stop && colima start --mount-inotify' — transient network failures during dependency fetch often clear.","Check VM connectivity from inside: 'colima ssh -- curl -sI https://github.com' and fix proxy/DNS in the host environment before restarting.","Disable the feature to unblock: 'colima start --mount-inotify=false' (lose inotify forwarding; file watching in containers degrades to polling).","If the guest is wedged, recreate: 'colima delete -f && colima start --mount-inotify'."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// only enable inotify mounting when the guest can reach the internet\ncanFetch := guest.Run(\"sh\", \"-c\", \"command -v curl\") == nil\nif conf.MountINotify && !canFetch {\n    log.Warnln(\"skipping inotify dependency install; guest offline\")\n    conf.MountINotify = false\n}","typeGuard":null,"tryCatchPattern":"if err := deps.Install(l.host); err != nil {\n    // degrade gracefully: continue start without inotify forwarding\n    log.Warnln(fmt.Errorf(\"error setting up inotify dependencies: %w\", err))\n    return nil\n}","preventionTips":["Ensure network/proxy works inside the VM before first start with --mount-inotify.","If tooling tolerates polling (many bundlers do), skip --mount-inotify entirely.","Retry start once after transient fetch failures; installs are idempotent."],"tags":["inotify","daemon","mounts","vm","network"],"backgroundTag":null,"analyzedSha":"c3a5f9184d83a197184f897a9f07eb3c01b3bc88","analyzedAt":"2026-08-15T18:58:08.334Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}