{"record":{"id":"5b7aa3f75638caf2","repo":"argoproj/argo-workflows","slug":"requires-either-node-field-selector-or-workflow","errorCode":null,"errorMessage":"requires either node field selector or workflow","messagePattern":"requires either node field selector or workflow","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/argo/commands/resume.go","lineNumber":42,"sourceCode":"\t\tExample: `# Resume a workflow that has been suspended:\n\n  argo resume my-wf\n\n# Resume multiple workflows:\n\t\t\n  argo resume my-wf my-other-wf my-third-wf\t\t\n\t\t\n# Resume the latest workflow:\n\t\t\n  argo resume @latest\n\t\t\n# Resume multiple workflows by node field selector:\n\t\t\n  argo resume --node-field-selector inputs.parameters.myparam.value=abc\t\t\n`,\n\t\tArgs: func(cmd *cobra.Command, args []string) error {\n\t\t\tif len(args) == 0 && resumeArgs.nodeFieldSelector == \"\" {\n\t\t\t\treturn errors.New(\"requires either node field selector or workflow\")\n\t\t\t}\n\t\t\treturn nil\n\t\t},\n\t\tRunE: func(cmd *cobra.Command, args []string) error {\n\t\t\tctx := cmd.Context()\n\t\t\tctx, apiClient, err := client.NewAPIClient(ctx)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tserviceClient := apiClient.NewWorkflowServiceClient(ctx)\n\t\t\tnamespace := client.Namespace(ctx)\n\n\t\t\tselector, err := fields.ParseSelector(resumeArgs.nodeFieldSelector)\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"unable to parse node field selector '%s': %w\", resumeArgs.nodeFieldSelector, err)\n\t\t\t}\n\n\t\t\tfor _, wfName := range args {","sourceCodeStart":24,"sourceCodeEnd":60,"githubUrl":"https://github.com/argoproj/argo-workflows/blob/35bff19146f5a6ada77468c431f2624bd577e373/cmd/argo/commands/resume.go#L24-L60","documentation":"`argo resume` must know what to resume: either one or more workflow names as positional args, or a --node-field-selector to target nodes across workflows. The cobra Args validator rejects the command when both are absent, because the underlying resume API has no target to act on.","triggerScenarios":"Running bare `argo resume` (or `argo resume` with only unrelated flags like --namespace) with no workflow name and no --node-field-selector at cmd/argo/commands/resume.go:42.","commonSituations":"Typing `argo resume` expecting it to resume everything; forgetting the workflow name after switching flags around; scripting where the workflow-name variable is empty.","solutions":["Pass the workflow name: `argo resume my-wf`","Or supply a node field selector: `argo resume --node-field-selector inputs.parameters.myparam.value=abc`","In scripts, guard: fail fast if WF_NAME is empty before calling argo resume"],"exampleFix":"// before\nWF_NAME=\"\"; argo resume $WF_NAME\n// after\nWF_NAME=\"my-wf\"; [ -n \"$WF_NAME\" ] && argo resume \"$WF_NAME\"","handlingStrategy":"validation","validationCode":"if [ -z \"$WF_NAME\" ] && [ -z \"$NODE_FIELD_SELECTOR\" ]; then\n  echo \"argo resume: requires either node field selector or workflow\" >&2; exit 2\nfi\n# ${WF_NAME:+\"$WF_NAME\"} ${NODE_FIELD_SELECTOR:+--node-field-selector \"$NODE_FIELD_SELECTOR\"}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always pass an explicit workflow name in scripts","Empty shell variables silently disappear — check with [ -n ... ] first","Use argo resume <wf> as the default pattern; reserve --node-field-selector for bulk ops"],"tags":["cli","argument-validation","argo-cli","resume"],"backgroundTag":"missing-required-argument","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"}