{"record":{"id":"9518459671d327b7","repo":"GoogleContainerTools/skaffold","slug":"unsupported-trigger-s","errorCode":null,"errorMessage":"unsupported trigger: %s","messagePattern":"unsupported trigger: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/skaffold/trigger/triggers.go","lineNumber":63,"sourceCode":"\tWatchPollInterval() int\n}\n\n// NewTrigger creates a new trigger.\nfunc NewTrigger(cfg Config, isActive func() bool) (Trigger, error) {\n\tswitch strings.ToLower(cfg.Trigger()) {\n\tcase \"polling\":\n\t\treturn &pollTrigger{\n\t\t\tInterval: time.Duration(cfg.WatchPollInterval()) * time.Millisecond,\n\t\t\tisActive: isActive,\n\t\t}, nil\n\tcase \"notify\":\n\t\treturn newFSNotifyTrigger(cfg, isActive), nil\n\tcase \"manual\":\n\t\treturn &manualTrigger{\n\t\t\tisActive: isActive,\n\t\t}, nil\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"unsupported trigger: %s\", cfg.Trigger())\n\t}\n}\n\nfunc newFSNotifyTrigger(cfg Config, isActive func() bool) Trigger {\n\tworkspaces := map[string]struct{}{}\n\tfor _, a := range cfg.Artifacts() {\n\t\tworkspaces[a.Workspace] = struct{}{}\n\t}\n\treturn fsNotify.New(workspaces, isActive, cfg.WatchPollInterval())\n}\n\n// pollTrigger watches for changes on a given interval of time.\ntype pollTrigger struct {\n\tInterval time.Duration\n\tisActive func() bool\n}\n\n// Debounce tells the watcher to debounce rapid sequence of changes.","sourceCodeStart":45,"sourceCodeEnd":81,"githubUrl":"https://github.com/GoogleContainerTools/skaffold/blob/a1189de023efc32d4b8e11f395acc678aa555011/pkg/skaffold/trigger/triggers.go#L45-L81","documentation":"NewTrigger creates the file-watch trigger from the configured trigger mode. Only \"polling\", \"notify\" (fsnotify), and \"manual\" are supported; any other value falls to the default case and is rejected. The error echoes the invalid trigger string from the config.","triggerScenarios":"Calling NewTrigger with a Config whose Trigger() returns a string outside {polling, notify, manual} — e.g. from a CLI flag like --trigger=? or an unresolved config value.","commonSituations":"Typo in --trigger flag value (e.g. --trigger=watch); stale scripts passing removed trigger names; env/config plumbing passing empty or localized strings.","solutions":["Use one of the supported values: polling, notify, or manual","Fix the --trigger flag value or the config source feeding Trigger()","Default to \"notify\" if the value is empty/unknown before calling NewTrigger"],"exampleFix":"// before\nskaffold dev --trigger=fswatch\n\n// after\nskaffold dev --trigger=notify","handlingStrategy":"validation","validationCode":"var validTriggers = map[string]bool{\"polling\": true, \"notify\": true, \"manual\": true}\nif !validTriggers[triggerStr] {\n    return fmt.Errorf(\"invalid --trigger %q; use polling, notify, or manual\", triggerStr)\n}","typeGuard":null,"tryCatchPattern":"tr, err := trigger.NewTrigger(cfg, isActive)\nif err != nil && strings.Contains(err.Error(), \"unsupported trigger\") {\n    tr, err = trigger.NewTrigger(defaultTriggerConfig(cfg), isActive) // fall back to notify\n}","preventionTips":["Restrict the --trigger flag to an enum with allowed values polling|notify|manual","Handle empty trigger values by defaulting to notify","Test CLI parsing against the accepted trigger list when upgrading skaffold"],"tags":["skaffold","trigger","config","cli"],"backgroundTag":"unsupported-trigger-value","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"}