argoproj/argo-workflows · error

--dry-run cannot be combined with --server-dry-run

Error message

--dry-run cannot be combined with --server-dry-run

What it means

--dry-run (client-side render, no API call) and --server-dry-run (server-side validation, no persistence) are mutually exclusive validation modes. The CLI cannot perform both, so validateOptions rejects the combination.

Source

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

			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 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]

View on GitHub (pinned to 35bff19146)

Solutions

  1. Keep only one flag: use --dry-run for pure client-side rendering, or --server-dry-run to also validate against the server.
  2. Prefer --server-dry-run (with --output) when you need controller/ admission validation of the manifest.
  3. Sanitize flags in scripts so only one dry-run mode is set.

Example fix

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

Strategy: validation

Validate before calling

if dryRun && serverDryRun {
    return fmt.Errorf("choose either --dry-run or --server-dry-run, not both")
}

Prevention

When it happens

Trigger: Running `argo submit` (or submit from a resource) passing both --dry-run and --server-dry-run; detected in validateOptions called from submitWorkflows or submitWorkflowFromResource.

Common situations: Users unsure which dry-run mode to use and passing both; scripted flag accumulation where different pipeline stages append their own dry-run flag; misunderstanding of the two validation levels.

Related errors


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