argoproj/argo-workflows · error
unable to parse node field selector '%s': %w
Error message
unable to parse node field selector '%s': %w
What it means
`argo resume` accepts --node-field-selector to resume only matching nodes; the value is parsed with fields.ParseSelector and rejected client-side with this wrapped error if invalid. This happens once before iterating over the workflow names in args.
Source
Thrown at cmd/argo/commands/resume.go:57
`,
Args: func(cmd *cobra.Command, args []string) error {
if len(args) == 0 && resumeArgs.nodeFieldSelector == "" {
return errors.New("requires either node field selector or workflow")
}
return nil
},
RunE: func(cmd *cobra.Command, args []string) error {
ctx := cmd.Context()
ctx, apiClient, err := client.NewAPIClient(ctx)
if err != nil {
return err
}
serviceClient := apiClient.NewWorkflowServiceClient(ctx)
namespace := client.Namespace(ctx)
selector, err := fields.ParseSelector(resumeArgs.nodeFieldSelector)
if err != nil {
return fmt.Errorf("unable to parse node field selector '%s': %w", resumeArgs.nodeFieldSelector, err)
}
for _, wfName := range args {
_, err := serviceClient.ResumeWorkflow(ctx, &workflowpkg.WorkflowResumeRequest{
Name: wfName,
Namespace: namespace,
NodeFieldSelector: selector.String(),
})
if err != nil {
return fmt.Errorf("failed to resume %s: %w", wfName, err)
}
fmt.Printf("workflow %s resumed\n", wfName)
}
return nil
},
}
command.Flags().StringVar(&resumeArgs.nodeFieldSelector, "node-field-selector", "", "selector of node to resume, eg: --node-field-selector inputs.parameters.myparam.value=abc")
return commandView on GitHub (pinned to 35bff19146)
Solutions
- Provide a valid key=value selector, e.g. --node-field-selector displayName=approve.
- Remove the flag entirely to resume the whole workflow(s).
- Quote the selector in the shell to preserve '=' characters.
Example fix
// before argo resume my-wf --node-field-selector 'displayName in (approve)' // after argo resume my-wf --node-field-selector displayName=approve
Defensive patterns
Strategy: validation
Validate before calling
if sel := resumeArgs.nodeFieldSelector; sel != "" {
if _, err := fields.ParseSelector(sel); err != nil {
return fmt.Errorf("bad selector %q: %w", sel, err)
}
} Type guard
func isValidFieldSelector(s string) bool { _, err := fields.ParseSelector(s); return err == nil } Try / catch
out, err := exec.Command("argo", "resume", wf, "--node-field-selector", sel).CombinedOutput()
if err != nil && strings.Contains(err.Error(), "unable to parse node field selector") {
// fall back to resuming whole workflow without selector
} Prevention
- Use key=value field-selector syntax only.
- Omit the flag to resume the entire workflow.
- Quote selectors to protect '=' from the shell.
When it happens
Trigger: Running `argo resume` with a malformed --node-field-selector, e.g. `--node-field-selector 'displayName'` (missing '=value') or `--node-field-selector '=foo'`.
Common situations: Copy-pasting label-selector syntax (key in (v1,v2)) into a field selector; shell quoting stripping '='; typos like double '=='.
Understand the failure class
- Parsing and encoding errors: unexpected token, malformed input — why parsers reject input and how to find the real culprit.
Related errors
- unable to parse node field selector '%s': %w
- unable to parse node field selector '%s': %w
- unable to parse node field selector '%s': %w
- unable to parse node field selector '%s': %w
- scheduled-time contains invalid time.RFC3339 format. (e.g.:
AI-assisted analysis of argoproj/argo-workflows@35bff19146 (2026-09-03).
Data as JSON: /api/errors/457682ac9d258fae.
Report an issue: GitHub.