argoproj/argo-workflows · error

--server-dry-run should have an output option

Error message

--server-dry-run should have an output option

What it means

Like --dry-run, --server-dry-run validates the workflow on the server without persisting it, and the validated manifest is only returned to the client. The CLI therefore requires an --output format so the result is actually printed.

Source

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

			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 nil
}

func submitWorkflowFromResource(ctx context.Context, serviceClient workflowpkg.WorkflowServiceClient, namespace string, resourceIdentifier string, submitOpts *wfv1.SubmitOpts, cliOpts *common.CliSubmitOpts) error {
	parts := strings.SplitN(resourceIdentifier, "/", 2)
	if len(parts) != 2 {
		return fmt.Errorf("resource identifier '%s' is malformed. Should be `kind/name`, e.g. cronwf/hello-world-cwf", resourceIdentifier)
	}
	kind := parts[0]
	name := parts[1]

	tempwf := wfv1.Workflow{}

	if err := validateOptions([]wfv1.Workflow{tempwf}, submitOpts, cliOpts); err != nil {
		return err
	}

View on GitHub (pinned to 35bff19146)

Solutions

  1. Add an output flag: `argo submit workflow.yaml --server-dry-run --output yaml` (or json/wide/name).
  2. If you did not intend a dry run, remove --server-dry-run to perform a real submission.
  3. In scripts, always pair dry-run flags with an explicit -o value.

Example fix

// before
argo submit workflow.yaml --server-dry-run
// after
argo submit workflow.yaml --server-dry-run --output json
Defensive patterns

Strategy: validation

Validate before calling

if serverDryRun && output == "" {
    return fmt.Errorf("--server-dry-run requires --output")
}

Prevention

When it happens

Trigger: Running `argo submit workflow.yaml --server-dry-run` without --output; validateOptions (cmd/argo/commands/submit.go:170-174) returns this error before any submission.

Common situations: Users testing server-side validation while forgetting output configuration; CI jobs adding --server-dry-run to a command without an output flag; copying examples of plain submit and only appending --server-dry-run.

Understand the failure class

Background: "--flag is required" and "must specify" CLI errors: how missing-required-flag validation works and how to fix it — this error's family across 20 libraries.

Related errors


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