{"record":{"id":"494f67f200478da7","repo":"argoproj/argo-workflows","slug":"server-dry-run-should-have-an-output-option","errorCode":null,"errorMessage":"--server-dry-run should have an output option","messagePattern":"--server-dry-run should have an output option","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/argo/commands/submit.go","lineNumber":172,"sourceCode":"\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]\n\n\ttempwf := wfv1.Workflow{}\n\n\tif err := validateOptions([]wfv1.Workflow{tempwf}, submitOpts, cliOpts); err != nil {\n\t\treturn err\n\t}","sourceCodeStart":154,"sourceCodeEnd":190,"githubUrl":"https://github.com/argoproj/argo-workflows/blob/35bff19146f5a6ada77468c431f2624bd577e373/cmd/argo/commands/submit.go#L154-L190","documentation":"Like --dry-run, --server-dry-run validates the workflow on the server without persisting it, and the validated manifest is only returned to the client. The CLI therefore requires an --output format so the result is actually printed.","triggerScenarios":"Running `argo submit workflow.yaml --server-dry-run` without --output; validateOptions (cmd/argo/commands/submit.go:170-174) returns this error before any submission.","commonSituations":"Users testing server-side validation while forgetting output configuration; CI jobs adding --server-dry-run to a command without an output flag; copying examples of plain submit and only appending --server-dry-run.","solutions":["Add an output flag: `argo submit workflow.yaml --server-dry-run --output yaml` (or json/wide/name).","If you did not intend a dry run, remove --server-dry-run to perform a real submission.","In scripts, always pair dry-run flags with an explicit -o value."],"exampleFix":"// before\nargo submit workflow.yaml --server-dry-run\n// after\nargo submit workflow.yaml --server-dry-run --output json","handlingStrategy":"validation","validationCode":"if serverDryRun && output == \"\" {\n    return fmt.Errorf(\"--server-dry-run requires --output\")\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Pair --server-dry-run with -o json/yaml every time","In CI, capture server-dry-run output to a file for audit","Don't rely on default output when dry-running"],"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"}