argoproj/argo-workflows · error
--wait cannot be combined with --server-dry-run
Error message
--wait cannot be combined with --server-dry-run
What it means
The argo CLI rejects flag combinations where --wait is used together with --server-dry-run. --wait blocks until the workflow completes, while --server-dry-run only validates the workflow server-side without actually creating it, so waiting would block forever. validateOptions enforces this before any API call is made.
Source
Thrown at cmd/argo/commands/submit.go:157
return errors.New("cannot watch more than one workflow")
}
if cliOpts.Wait {
return errors.New("--wait cannot be combined with --watch")
}
if submitOpts.DryRun {
return errors.New("--watch cannot be combined with --dry-run")
}
if submitOpts.ServerDryRun {
return errors.New("--watch cannot be combined with --server-dry-run")
}
}
if cliOpts.Wait {
if submitOpts.DryRun {
return errors.New("--wait cannot be combined with --dry-run")
}
if submitOpts.ServerDryRun {
return errors.New("--wait cannot be combined with --server-dry-run")
}
}
if submitOpts.DryRun {
if cliOpts.Output.String() == "" {
return errors.New("--dry-run should have an output option")
}
if submitOpts.ServerDryRun {
return errors.New("--dry-run cannot be combined with --server-dry-run")
}
}
if submitOpts.ServerDryRun {
if cliOpts.Output.String() == "" {
return errors.New("--server-dry-run should have an output option")
}
}
return nilView on GitHub (pinned to 35bff19146)
Solutions
- Remove --wait when using --server-dry-run (a dry run finishes immediately; there is nothing to wait for).
- If you want both validation and watching a real run, do two invocations: first `argo submit --server-dry-run --output yaml`, then `argo submit --wait`.
- Remove --server-dry-run instead if the intent was a real submission that the CLI waits on.
- If flags come from a script/template, gate them so only one of --wait / --server-dry-run is ever passed.
Example fix
// before argo submit workflow.yaml --wait --server-dry-run // after argo submit workflow.yaml --server-dry-run --output yaml
Defensive patterns
Strategy: validation
Validate before calling
if wait && serverDryRun {
return fmt.Errorf("drop either --wait or --server-dry-run before submitting")
} Prevention
- Never combine --wait with any dry-run flag
- Use --output with dry-run runs and inspect results instead of waiting
- Centralize submit flag construction in scripts to avoid conflicting flags
When it happens
Trigger: Running `argo submit` (or `argo submit --from resource/name` via submitWorkflowFromResource) with both --wait and --server-dry-run flags set; validateOptions returns this error immediately before contacting the server.
Common situations: Users copying a submit command that already had --wait and adding --server-dry-run to test the manifest; CI scripts templating flags where both options can be enabled simultaneously; misunderstanding that server-dry-run creates anything to wait on.
Related errors
- --dry-run should have an output option
- --dry-run cannot be combined with --server-dry-run
- --server-dry-run should have an output option
- --since-time and --since cannot be used together
- cannot combine --from with file arguments
AI-assisted analysis of argoproj/argo-workflows@35bff19146 (2026-09-03).
Data as JSON: /api/errors/fb2e606c740c7d32.
Report an issue: GitHub.