{"record":{"id":"71cfc637a94d5180","repo":"argoproj/argo-workflows","slug":"unable-to-parse-node-field-selector-s-w-71cfc6","errorCode":null,"errorMessage":"unable to parse node field selector '%s': %w","messagePattern":"unable to parse node field selector '(.+?)': %w","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/argo/commands/retry.go","lineNumber":112,"sourceCode":"\t\t},\n\t}\n\tcommand.Flags().StringArrayVarP(&cliSubmitOpts.Parameters, \"parameter\", \"p\", []string{}, \"input parameter to override on the original workflow spec\")\n\tcommand.Flags().VarP(&cliSubmitOpts.Output, \"output\", \"o\", \"Output format. \"+cliSubmitOpts.Output.Usage())\n\tcommand.Flags().BoolVarP(&cliSubmitOpts.Wait, \"wait\", \"w\", false, \"wait for the workflow to complete, only works when a single workflow is retried\")\n\tcommand.Flags().BoolVar(&cliSubmitOpts.Watch, \"watch\", false, \"watch the workflow until it completes, only works when a single workflow is retried\")\n\tcommand.Flags().BoolVar(&cliSubmitOpts.Log, \"log\", false, \"log the workflow until it completes\")\n\tcommand.Flags().BoolVar(&retryOpts.restartSuccessful, \"restart-successful\", false, \"indicates to restart successful nodes matching the --node-field-selector\")\n\tcommand.Flags().StringVar(&retryOpts.nodeFieldSelector, \"node-field-selector\", \"\", \"selector of nodes to reset, eg: --node-field-selector inputs.parameters.myparam.value=abc\")\n\tcommand.Flags().StringVarP(&retryOpts.labelSelector, \"selector\", \"l\", \"\", \"Selector (label query) to filter on, not including uninitialized ones, supports '=', '==', and '!='.(e.g. -l key1=value1,key2=value2)\")\n\tcommand.Flags().StringVar(&retryOpts.fieldSelector, \"field-selector\", \"\", \"Selector (field query) to filter on, supports '=', '==', and '!='.(e.g. --field-selector key1=value1,key2=value2). The server only supports a limited number of field queries per type.\")\n\treturn command\n}\n\n// retryWorkflows retries workflows by given retryArgs or workflow names\nfunc retryWorkflows(ctx context.Context, serviceClient workflowpkg.WorkflowServiceClient, retryOpts retryOps, cliSubmitOpts common.CliSubmitOpts, args []string) error {\n\tselector, err := fields.ParseSelector(retryOpts.nodeFieldSelector)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"unable to parse node field selector '%s': %w\", retryOpts.nodeFieldSelector, err)\n\t}\n\tvar wfs wfv1.Workflows\n\tif retryOpts.hasSelector() {\n\t\twfs, err = listWorkflows(ctx, serviceClient, listFlags{\n\t\t\tnamespace: retryOpts.namespace,\n\t\t\tfields:    retryOpts.fieldSelector,\n\t\t\tlabels:    retryOpts.labelSelector,\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tfor _, n := range args {\n\t\twfs = append(wfs, wfv1.Workflow{\n\t\t\tObjectMeta: metav1.ObjectMeta{\n\t\t\t\tName:      n,\n\t\t\t\tNamespace: retryOpts.namespace,","sourceCodeStart":94,"sourceCodeEnd":130,"githubUrl":"https://github.com/argoproj/argo-workflows/blob/35bff19146f5a6ada77468c431f2624bd577e373/cmd/argo/commands/retry.go#L94-L130","documentation":"`argo retry` parses --node-field-selector with fields.ParseSelector inside retryWorkflows before listing/retrying workflows; an invalid selector string is rejected client-side with this wrapped error. It occurs once up front, before any workflow lookup.","triggerScenarios":"Running `argo retry` with a malformed --node-field-selector such as `--node-field-selector 'displayName'` (no '=value') or an empty-but-set value `--node-field-selector ''`... note empty string actually parses; real triggers are syntactically invalid selectors like '=x' or unbalanced quotes.","commonSituations":"Confusing label-selector syntax with field-selector syntax; shell quoting issues; copy-paste errors from docs intended for --selector (label selector) instead.","solutions":["Use key=value field-selector syntax, e.g. --node-field-selector displayName=approve.","If you meant label selection, use the --selector flag instead of --node-field-selector.","Quote the argument in the shell and avoid stray spaces around '='."],"exampleFix":"// before\nargo retry my-wf --node-field-selector 'displayName approve'\n// after\nargo retry my-wf --node-field-selector displayName=approve","handlingStrategy":"validation","validationCode":"if _, err := fields.ParseSelector(retryOpts.nodeFieldSelector); err != nil {\n    return fmt.Errorf(\"bad --node-field-selector %q\", retryOpts.nodeFieldSelector)\n}","typeGuard":"func isValidFieldSelector(s string) bool { _, err := fields.ParseSelector(s); return err == nil }","tryCatchPattern":"err := cmd.Run()\nif err != nil && strings.Contains(err.Error(), \"unable to parse node field selector\") {\n    // retry without --node-field-selector to retry entire workflow\n}","preventionTips":["Use key=value syntax for --node-field-selector; use --selector for label selectors.","Quote the selector in scripts.","Validate selectors with fields.ParseSelector before invoking the CLI."],"tags":["cli","argo-cli","field-selector","validation"],"backgroundTag":"invalid-field-selector","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"}