{"record":{"id":"faae3381d6972233","repo":"argoproj/argo-workflows","slug":"dry-run-cannot-be-combined-with-server-dry-run","errorCode":null,"errorMessage":"--dry-run cannot be combined with --server-dry-run","messagePattern":"--dry-run cannot be combined with --server-dry-run","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/argo/commands/submit.go","lineNumber":166,"sourceCode":"\t\t\treturn errors.New(\"--watch cannot be combined with --server-dry-run\")\n\t\t}\n\t}\n\n\tif cliOpts.Wait {\n\t\tif submitOpts.DryRun {\n\t\t\treturn errors.New(\"--wait cannot be combined with --dry-run\")\n\t\t}\n\t\tif submitOpts.ServerDryRun {\n\t\t\treturn errors.New(\"--wait cannot be combined with --server-dry-run\")\n\t\t}\n\t}\n\n\tif submitOpts.DryRun {\n\t\tif cliOpts.Output.String() == \"\" {\n\t\t\treturn errors.New(\"--dry-run should have an output option\")\n\t\t}\n\t\tif submitOpts.ServerDryRun {\n\t\t\treturn errors.New(\"--dry-run cannot be combined with --server-dry-run\")\n\t\t}\n\t}\n\n\tif submitOpts.ServerDryRun {\n\t\tif cliOpts.Output.String() == \"\" {\n\t\t\treturn errors.New(\"--server-dry-run should have an output option\")\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc submitWorkflowFromResource(ctx context.Context, serviceClient workflowpkg.WorkflowServiceClient, namespace string, resourceIdentifier string, submitOpts *wfv1.SubmitOpts, cliOpts *common.CliSubmitOpts) error {\n\tparts := strings.SplitN(resourceIdentifier, \"/\", 2)\n\tif len(parts) != 2 {\n\t\treturn fmt.Errorf(\"resource identifier '%s' is malformed. Should be `kind/name`, e.g. cronwf/hello-world-cwf\", resourceIdentifier)\n\t}\n\tkind := parts[0]\n\tname := parts[1]","sourceCodeStart":148,"sourceCodeEnd":184,"githubUrl":"https://github.com/argoproj/argo-workflows/blob/35bff19146f5a6ada77468c431f2624bd577e373/cmd/argo/commands/submit.go#L148-L184","documentation":"--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.","triggerScenarios":"Running `argo submit` (or submit from a resource) passing both --dry-run and --server-dry-run; detected in validateOptions called from submitWorkflows or submitWorkflowFromResource.","commonSituations":"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.","solutions":["Keep only one flag: use --dry-run for pure client-side rendering, or --server-dry-run to also validate against the server.","Prefer --server-dry-run (with --output) when you need controller/ admission validation of the manifest.","Sanitize flags in scripts so only one dry-run mode is set."],"exampleFix":"// before\nargo submit workflow.yaml --dry-run --server-dry-run --output yaml\n// after\nargo submit workflow.yaml --server-dry-run --output yaml","handlingStrategy":"validation","validationCode":"if dryRun && serverDryRun {\n    return fmt.Errorf(\"choose either --dry-run or --server-dry-run, not both\")\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Pick one validation mode per invocation","Prefer --server-dry-run for admission/controller-level validation","Strip duplicate dry-run flags in scripted flag assembly"],"tags":["cli","flag-conflict","argo"],"backgroundTag":"incompatible-cli-flags","analyzedSha":"35bff19146f5a6ada77468c431f2624bd577e373","analyzedAt":"2026-09-03T19:34:35.908Z","contentChangedAt":"2026-09-03T19:34:35.908Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}