{"record":{"id":"fb2e606c740c7d32","repo":"argoproj/argo-workflows","slug":"wait-cannot-be-combined-with-server-dry-run","errorCode":null,"errorMessage":"--wait cannot be combined with --server-dry-run","messagePattern":"--wait cannot be combined with --server-dry-run","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/argo/commands/submit.go","lineNumber":157,"sourceCode":"\t\t\treturn errors.New(\"cannot watch more than one workflow\")\n\t\t}\n\t\tif cliOpts.Wait {\n\t\t\treturn errors.New(\"--wait cannot be combined with --watch\")\n\t\t}\n\t\tif submitOpts.DryRun {\n\t\t\treturn errors.New(\"--watch cannot be combined with --dry-run\")\n\t\t}\n\t\tif submitOpts.ServerDryRun {\n\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","sourceCodeStart":139,"sourceCodeEnd":175,"githubUrl":"https://github.com/argoproj/argo-workflows/blob/35bff19146f5a6ada77468c431f2624bd577e373/cmd/argo/commands/submit.go#L139-L175","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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."],"exampleFix":"// before\nargo submit workflow.yaml --wait --server-dry-run\n// after\nargo submit workflow.yaml --server-dry-run --output yaml","handlingStrategy":"validation","validationCode":"if wait && serverDryRun {\n    return fmt.Errorf(\"drop either --wait or --server-dry-run before submitting\")\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["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"],"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"}