{"record":{"id":"12fce9c9c5c54425","repo":"argoproj/argo-workflows","slug":"wait-cannot-be-combined-with-dry-run","errorCode":null,"errorMessage":"--wait cannot be combined with --dry-run","messagePattern":"--wait cannot be combined with --dry-run","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/argo/commands/submit.go","lineNumber":154,"sourceCode":"func validateOptions(workflows []wfv1.Workflow, submitOpts *wfv1.SubmitOpts, cliOpts *common.CliSubmitOpts) error {\n\tif cliOpts.Watch {\n\t\tif len(workflows) > 1 {\n\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\")","sourceCodeStart":136,"sourceCodeEnd":172,"githubUrl":"https://github.com/argoproj/argo-workflows/blob/35bff19146f5a6ada77468c431f2624bd577e373/cmd/argo/commands/submit.go#L136-L172","documentation":"--wait blocks until the workflow finishes, which is meaningless with --dry-run since nothing is ever created or run. validateOptions in cmd/argo/commands/submit.go rejects --wait with --dry-run (and symmetrically with --server-dry-run) after the --watch checks.","triggerScenarios":"`argo submit my-wf.yaml --dry-run --wait` (or --server-dry-run --wait); CI wrappers that always append --wait to guarantee completion.","commonSituations":"Shared CI submit functions that hardcode --wait; adding --dry-run to debug a failing pipeline that always waits.","solutions":["Remove --wait when using --dry-run or --server-dry-run","Use --dry-run alone for local rendering validation","In shared wrappers, conditionally append --wait only when no dry-run flag is present"],"exampleFix":"// before\nargo submit my-wf.yaml --dry-run --wait\n// after\nargo submit my-wf.yaml --dry-run","handlingStrategy":"validation","validationCode":"if [ -n \"$DRY_RUN\" ] || [ -n \"$SERVER_DRY_RUN\" ]; then\n  WAIT_FLAG=\"\"  # drop --wait for dry-run modes\nfi","typeGuard":null,"tryCatchPattern":null,"preventionTips":["--wait only makes sense for real submissions","Conditionally append --wait only when neither dry-run flag is set","In CI wrappers, branch: dry-run path vs submit-and-wait path"],"tags":["cli","flag-conflict","argo-cli","submit","dry-run"],"backgroundTag":"mutually-exclusive-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"}