{"record":{"id":"eeae80698fba091b","repo":"GoogleContainerTools/skaffold","slug":"unable-to-start-trigger-w","errorCode":null,"errorMessage":"unable to start trigger: %w","messagePattern":"unable to start trigger: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/skaffold/runner/listen.go","lineNumber":64,"sourceCode":"type SkaffoldListener struct {\n\tMonitor                 filemon.Monitor\n\tTrigger                 trigger.Trigger\n\tsourceDependenciesCache graph.SourceDependenciesCache\n\tintentChan              <-chan bool\n}\n\nfunc (l *SkaffoldListener) LogWatchToUser(out io.Writer) {\n\tl.Trigger.LogWatchToUser(out)\n}\n\n// WatchForChanges listens to a trigger, and when one is received, computes file changes and\n// conditionally runs the dev loop.\nfunc (l *SkaffoldListener) WatchForChanges(ctx context.Context, out io.Writer, devLoop func() error) error {\n\tctxTrigger, cancelTrigger := context.WithCancel(ctx)\n\tdefer cancelTrigger()\n\ttrigger, err := trigger.StartTrigger(ctxTrigger, l.Trigger)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"unable to start trigger: %w\", err)\n\t}\n\n\t// exit if file monitor fails the first time\n\tif err := l.Monitor.Run(l.Trigger.Debounce()); err != nil {\n\t\treturn fmt.Errorf(\"failed to monitor files: %w\", err)\n\t}\n\n\tl.LogWatchToUser(out)\n\n\tfor {\n\t\tselect {\n\t\tcase <-ctx.Done():\n\t\t\treturn nil\n\t\tcase <-l.intentChan:\n\t\t\tif err := l.do(devLoop); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\tcase <-trigger:","sourceCodeStart":46,"sourceCodeEnd":82,"githubUrl":"https://github.com/GoogleContainerTools/skaffold/blob/a1189de023efc32d4b8e11f395acc678aa555011/pkg/skaffold/runner/listen.go#L46-L82","documentation":"SkaffoldListener.WatchForChanges starts the change trigger (manual/polling/notify) that gates the dev loop. If trigger.StartTrigger fails, the listener returns 'unable to start trigger'. The trigger is what decides when the dev loop re-runs (file events, polling interval, or manual Enter).","triggerScenarios":"`trigger.StartTrigger(ctxTrigger, l.Trigger)` returns an error — e.g. the polling trigger cannot initialize its poller, the notify trigger cannot create a file watcher, or trigger configuration (interval, mode) is invalid.","commonSituations":"Filesystem doesn't support notify-based watching (network mounts, containers with limited syscalls) while --trigger=notify is default; invalid --poll-interval value; watch resource exhaustion when creating the trigger's watcher.","solutions":["Fall back to polling: run with `--trigger=poll` (and a sane `--poll-interval`, e.g. 1s)","Fix any invalid trigger flags (e.g. non-numeric --poll-interval)","Raise inotify limits if watcher creation fails (`fs.inotify.max_user_watches/instances`)","Run with --trigger=manual to isolate whether the trigger subsystem is the failure"],"exampleFix":"// before\n$ skaffold dev   # notify trigger fails on network FS\n// after\n$ skaffold dev --trigger=poll --poll-interval=1000","handlingStrategy":"fallback","validationCode":"// prefer polling trigger on filesystems without notify support\ntrigger := \"notify\"\nif onNetworkFilesystem(cwd) { trigger = \"poll\" }\nargs := []string{\"dev\", \"--trigger=\" + trigger, \"--poll-interval=1000\"}","typeGuard":"func isTriggerStartErr(err error) bool {\n    return err != nil && strings.Contains(err.Error(), \"unable to start trigger\")\n}","tryCatchPattern":"if err := listener.WatchForChanges(ctx, out, devLoop); isTriggerStartErr(err) {\n    log.Println(\"notify trigger failed; retrying with poll trigger\")\n    l.Trigger = pollingTrigger\n    return listener.WatchForChanges(ctx, out, devLoop)\n}","preventionTips":["Use --trigger=poll on NFS/network mounts and in restricted containers","Validate --poll-interval values before launching","Raise inotify instance limits for notify mode","Test trigger startup with --trigger=manual to isolate the subsystem"],"tags":["skaffold","trigger","file-watch","dev-loop"],"backgroundTag":"trigger-start-failed","analyzedSha":"a1189de023efc32d4b8e11f395acc678aa555011","analyzedAt":"2026-09-05T12:09:27.064Z","contentChangedAt":"2026-09-05T12:09:27.064Z","schemaVersion":2},"datasetVersion":"2026-09-12T17:17:11.597Z"}