argoproj/argo-workflows · error
cannot combine --from with file arguments
Error message
cannot combine --from with file arguments
What it means
`argo submit --from <kind>/<name>` submits a workflow from an existing resource, so it cannot also take file arguments (including `-` for stdin). validateOptions-level Args validation at cmd/argo/commands/submit.go:62 rejects the combination up front because the two input sources are mutually exclusive.
Source
Thrown at cmd/argo/commands/submit.go:62
# Submit and watch until completion:
argo submit --watch my-wf.yaml
# Submit and tail logs until completion:
argo submit --log my-wf.yaml
# Submit a single workflow from an existing resource
argo submit --from cronwf/my-cron-wf
# Submit multiple workflows from stdin:
cat my-wf.yaml | argo submit -
`,
Args: func(cmd *cobra.Command, args []string) error {
if from != "" && len(args) != 0 {
return errors.New("cannot combine --from with file arguments")
}
return nil
},
RunE: func(cmd *cobra.Command, args []string) error {
ctx := cmd.Context()
if cmd.Flag("priority").Changed {
cliSubmitOpts.Priority = &priority
}
ctx, apiClient, err := client.NewAPIClient(ctx)
if err != nil {
return err
}
if !cliSubmitOpts.Watch && len(cliSubmitOpts.GetArgs.Status) > 0 {
logging.RequireLoggerFromContext(ctx).Warn(ctx, "--status should only be used with --watch")
}
View on GitHub (pinned to 35bff19146)
Solutions
- Drop the file arguments when using --from
- Or drop --from and submit from the file/stdin directly
- In scripts, choose one path: if FROM is set, pass no positional args
Example fix
// before cat my-wf.yaml | argo submit --from workflowtmpl/my-tmpl - // after cat my-wf.yaml | argo submit - # or argo submit --from workflowtmpl/my-tmpl
Defensive patterns
Strategy: validation
Validate before calling
if [ -n "$FROM" ] && [ ${#FILE_ARGS[@]} -gt 0 ]; then
echo "argo submit: cannot combine --from with file arguments" >&2; exit 2
fi Prevention
- Treat --from as a complete alternative input path — no positional files, no stdin
- In wrappers: if FROM is set, clear the file-args array
- Remember '-' (stdin) counts as a file argument
When it happens
Trigger: Running `argo submit --from cronwf/my-cron-wf my-wf.yaml`; also `cat wf.yaml | argo submit --from workflow/x -` (args contains "-").
Common situations: Mixing examples for resource-submit and file-submit; scripts that append a default file argument; piping YAML out of habit while also using --from.
Understand the failure class
Background: "mutually exclusive" flag errors: what "can't supply both nx and xx", "--raw is not compatible with -i" and "cannot be used with" mean, and how to fix them — this error's family across 29 libraries.
Related errors
- cannot watch more than one workflow
- --wait cannot be combined with --watch
- --watch cannot be combined with --dry-run
- --watch cannot be combined with --server-dry-run
- --wait cannot be combined with --dry-run
AI-assisted analysis of argoproj/argo-workflows@35bff19146 (2026-09-03).
Data as JSON: /api/errors/1a790606b16e8bc1.
Report an issue: GitHub.