argoproj/argo-workflows · error

--wait cannot be combined with --watch

Error message

--wait cannot be combined with --watch

What it means

--watch (live streaming TUI-style progress) and --wait (block until completion, no stream) are two different completion-tracking modes and are mutually exclusive. validateOptions in cmd/argo/commands/submit.go rejects the combination before submitting.

Source

Thrown at cmd/argo/commands/submit.go:142

		return err
	}

	var workflows []wfv1.Workflow
	for _, body := range fileContents {
		wfs := unmarshalWorkflows(ctx, body, cliOpts.Strict)
		workflows = append(workflows, wfs...)
	}

	return submitWorkflows(ctx, serviceClient, namespace, workflows, submitOpts, cliOpts)
}

func validateOptions(workflows []wfv1.Workflow, submitOpts *wfv1.SubmitOpts, cliOpts *common.CliSubmitOpts) error {
	if cliOpts.Watch {
		if len(workflows) > 1 {
			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")
		}
	}

View on GitHub (pinned to 35bff19146)

Solutions

  1. Keep only --watch (it already blocks and shows progress)
  2. Or keep only --wait for non-interactive CI usage
  3. In wrappers, make the flags mutually exclusive

Example fix

// before
argo submit my-wf.yaml --wait --watch
// after
argo submit my-wf.yaml --watch
Defensive patterns

Strategy: validation

Validate before calling

case " $FLAGS " in *' --watch '*)( [ -n "$WAIT" ] && echo "--wait cannot be combined with --watch" >&2 && exit 2 ) ;; esac
# pass only one of --wait / --watch to argo submit

Prevention

When it happens

Trigger: `argo submit my-wf.yaml --wait --watch` — cliOpts.Watch && cliOpts.Wait both true.

Common situations: Appending --wait to a scripted command that already uses --watch; assuming the flags are additive; CI wrappers that always add --wait.

Understand the failure class

Background: "mutually exclusive" flag errors: what "can't supply both nx and xx", "--raw is not compatible with -i" and "cannot be used with" mean, and how to fix them — this error's family across 29 libraries.

Related errors


AI-assisted analysis of argoproj/argo-workflows@35bff19146 (2026-09-03). Data as JSON: /api/errors/35ea44747409ae71. Report an issue: GitHub.