{"record":{"id":"e2e866e2fb37810b","repo":"argoproj/argo-workflows","slug":"unable-to-parse-node-field-selector-s-w","errorCode":null,"errorMessage":"unable to parse node field selector '%s': %w","messagePattern":"unable to parse node field selector '(.+?)': %w","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/argo/commands/archive/retry.go","lineNumber":127,"sourceCode":"\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\tcommand.Flags().BoolVar(&retryOpts.forceName, \"name\", false, \"force the argument to be treated as a name\")\n\tcommand.Flags().BoolVar(&retryOpts.forceUID, \"uid\", false, \"force the argument to be treated as a UID\")\n\tcommand.MarkFlagsMutuallyExclusive(\"name\", \"uid\")\n\treturn command\n}\n\n// retryArchivedWorkflows retries workflows by given retryArgs or workflow names/UIDs\nfunc retryArchivedWorkflows(ctx context.Context, archiveServiceClient workflowarchivepkg.ArchivedWorkflowServiceClient, 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 = listArchivedWorkflows(ctx, archiveServiceClient, retryOpts.fieldSelector, retryOpts.labelSelector, 0)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\t// Add workflows from args - auto-detect UID vs NAME\n\tfor _, identifier := range args {\n\t\tvar uid string\n\t\tuid, err = resolveUID(ctx, archiveServiceClient, identifier, retryOpts.namespace, retryOpts.forceUID, retryOpts.forceName)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"resolve UID: %w\", err)\n\t\t}\n\t\twf := wfv1.Workflow{\n\t\t\tObjectMeta: metav1.ObjectMeta{","sourceCodeStart":109,"sourceCodeEnd":145,"githubUrl":"https://github.com/argoproj/argo-workflows/blob/35bff19146f5a6ada77468c431f2624bd577e373/cmd/argo/commands/archive/retry.go#L109-L145","documentation":"Thrown by `argo archive retry` (retryArchivedWorkflows in cmd/argo/commands/archive/retry.go) when the --node-field-selector flag cannot be parsed as a Kubernetes field selector (fields.ParseSelector fails). Argo uses this selector to pick which failed nodes of the archived workflow to retry.","triggerScenarios":"Running `argo archive retry --node-field-selector 'invalid selector ==='` (or similar malformed syntax) with any identifier/selector; fields.ParseSelector rejects the string before any server call.","commonSituations":"Hand-written selector syntax with wrong operators (e.g. '==' vs '=', unsupported keys like status instead of the required metadata.name / status.phase style keys used by the retry API); quoting issues in shells stripping or mangling the selector; copying node-field-selector values intended for `kubectl get` with different field semantics.","solutions":["Fix the selector syntax: valid form is key=value pairs, e.g. `--node-field-selector 'metadata.name=step-name'`.","Verify quoting: wrap the selector in single quotes so the shell does not split on '=' or spaces.","Only use keys supported by node field selectors (metadata.name, metadata.namespace, status.phase, etc.) — arbitrary template field keys are invalid.","Omit --node-field-selector to retry all failed nodes, then narrow once the retry works."],"exampleFix":"// before\nargo archive retry --node-field-selector 'inputs.parameters.x==foo' <wf>\n\n// after\nargo archive retry --node-field-selector 'metadata.name=my-step' <wf>","handlingStrategy":"validation","validationCode":"import \"k8s.io/apimachinery/pkg/fields\"\n\nsel, err := fields.ParseSelector(nodeFieldSelector)\nif err != nil {\n    return fmt.Errorf(\"invalid --node-field-selector %q: %w\", nodeFieldSelector, err)\n}\n// only allow supported keys\nfor _, r := range sel.Requirements() {\n    switch r.Key {\n    case \"metadata.name\", \"metadata.namespace\", \"status.phase\":\n    default:\n        return fmt.Errorf(\"unsupported node field selector key %q\", r.Key)\n    }\n}","typeGuard":null,"tryCatchPattern":"if err := retryArchivedWorkflows(...); err != nil {\n    if strings.Contains(err.Error(), \"unable to parse node field selector\") {\n        // correct the selector syntax (key=value) before retrying\n    }\n    return err\n}","preventionTips":["Use key=value syntax (single =, no ==) in node field selectors.","Quote selectors in shells to protect = and spaces.","Restrict to supported keys: metadata.name, metadata.namespace, status.phase.","Test the selector against `argo get <wf>` output node names first."],"tags":["argo-workflows","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"}