GoogleContainerTools/skaffold · error
unsupported trigger: %s
Error message
unsupported trigger: %s
What it means
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.
Source
Thrown at pkg/skaffold/trigger/triggers.go:63
WatchPollInterval() int
}
// NewTrigger creates a new trigger.
func NewTrigger(cfg Config, isActive func() bool) (Trigger, error) {
switch strings.ToLower(cfg.Trigger()) {
case "polling":
return &pollTrigger{
Interval: time.Duration(cfg.WatchPollInterval()) * time.Millisecond,
isActive: isActive,
}, nil
case "notify":
return newFSNotifyTrigger(cfg, isActive), nil
case "manual":
return &manualTrigger{
isActive: isActive,
}, nil
default:
return nil, fmt.Errorf("unsupported trigger: %s", cfg.Trigger())
}
}
func newFSNotifyTrigger(cfg Config, isActive func() bool) Trigger {
workspaces := map[string]struct{}{}
for _, a := range cfg.Artifacts() {
workspaces[a.Workspace] = struct{}{}
}
return fsNotify.New(workspaces, isActive, cfg.WatchPollInterval())
}
// pollTrigger watches for changes on a given interval of time.
type pollTrigger struct {
Interval time.Duration
isActive func() bool
}
// Debounce tells the watcher to debounce rapid sequence of changes.View on GitHub (pinned to a1189de023)
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
Example fix
// before skaffold dev --trigger=fswatch // after skaffold dev --trigger=notify
Defensive patterns
Strategy: validation
Validate before calling
var validTriggers = map[string]bool{"polling": true, "notify": true, "manual": true}
if !validTriggers[triggerStr] {
return fmt.Errorf("invalid --trigger %q; use polling, notify, or manual", triggerStr)
} Try / catch
tr, err := trigger.NewTrigger(cfg, isActive)
if err != nil && strings.Contains(err.Error(), "unsupported trigger") {
tr, err = trigger.NewTrigger(defaultTriggerConfig(cfg), isActive) // fall back to notify
} Prevention
- 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
When it happens
Trigger: 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.
Common situations: Typo in --trigger flag value (e.g. --trigger=watch); stale scripts passing removed trigger names; env/config plumbing passing empty or localized strings.
Related errors
- `apply` requires at least one manifest argument
- `exec` requires exactly one action to execute
- `config-dependencies add` requires exactly one file path arg
- `jobManifestPaths modify` requires exactly one manifest file
- `inspect namespaces list` requires exactly one manifest file
AI-assisted analysis of GoogleContainerTools/skaffold@a1189de023 (2026-09-05).
Data as JSON: /api/errors/9518459671d327b7.
Report an issue: GitHub.