{"record":{"id":"c4462574a6e20d09","repo":"argoproj/argo-workflows","slug":"dry-run-should-have-an-output-option","errorCode":null,"errorMessage":"--dry-run should have an output option","messagePattern":"--dry-run should have an output option","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/argo/commands/submit.go","lineNumber":163,"sourceCode":"\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\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)","sourceCodeStart":145,"sourceCodeEnd":181,"githubUrl":"https://github.com/argoproj/argo-workflows/blob/35bff19146f5a6ada77468c431f2624bd577e373/cmd/argo/commands/submit.go#L145-L181","documentation":"--dry-run submits the workflow locally (client-side validation only, nothing is sent to the server), so the rendered workflow must be printed somewhere. The CLI requires an --output format whenever --dry-run is given, otherwise the result would be silently discarded.","triggerScenarios":"Running `argo submit workflow.yaml --dry-run` without --output (e.g. --output json|yaml|wide|name); validateOptions checks cliOpts.Output.String() == \"\" and returns this error.","commonSituations":"Users adding --dry-run to an existing submit command that relied on default output behavior; scripts that pipe output but omit the --output flag; docs/examples showing --dry-run alone.","solutions":["Add an --output flag, e.g. `argo submit workflow.yaml --dry-run --output yaml`.","Use `-o json` if the result is consumed by another tool.","If you actually wanted server-side validation, use --server-dry-run (also with --output) instead of --dry-run.","Drop --dry-run if you intended a real submission."],"exampleFix":"// before\nargo submit workflow.yaml --dry-run\n// after\nargo submit workflow.yaml --dry-run --output yaml","handlingStrategy":"validation","validationCode":"if dryRun && output == \"\" {\n    return fmt.Errorf(\"--dry-run requires --output (yaml|json|wide|name)\")\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always pass -o yaml or -o json with --dry-run","Remember dry-run only renders locally; output is the only result","Add dry-run+output pairs in CI templates, not separately"],"tags":["cli","flag-conflict","argo"],"backgroundTag":"missing-required-flag","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"}