{"record":{"id":"350978c2f496f882","repo":"argoproj/argo-workflows","slug":"unable-to-parse-node-field-selector-s-w-350978","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/stop.go","lineNumber":87,"sourceCode":"\t\t\tserviceClient := apiClient.NewWorkflowServiceClient(ctx)\n\t\t\tstopArgs.namespace = client.Namespace(ctx)\n\n\t\t\treturn stopWorkflows(ctx, serviceClient, stopArgs, args)\n\t\t},\n\t}\n\tcommand.Flags().StringVar(&stopArgs.message, \"message\", \"\", \"Message to add to previously running nodes\")\n\tcommand.Flags().StringVar(&stopArgs.nodeFieldSelector, \"node-field-selector\", \"\", \"selector of node to stop, eg: --node-field-selector inputs.parameters.myparam.value=abc\")\n\tcommand.Flags().StringVarP(&stopArgs.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(&stopArgs.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(&stopArgs.dryRun, \"dry-run\", false, \"If true, only print the workflows that would be stopped, without stopping them.\")\n\treturn command\n}\n\n// stopWorkflows stops workflows by given stopArgs or workflow names\nfunc stopWorkflows(ctx context.Context, serviceClient workflowpkg.WorkflowServiceClient, stopArgs stopOps, args []string) error {\n\tselector, err := fields.ParseSelector(stopArgs.nodeFieldSelector)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"unable to parse node field selector '%s': %w\", stopArgs.nodeFieldSelector, err)\n\t}\n\tvar wfs wfv1.Workflows\n\tif stopArgs.hasSelector() {\n\t\twfs, err = listWorkflows(ctx, serviceClient, listFlags{\n\t\t\tnamespace: stopArgs.namespace,\n\t\t\tfields:    stopArgs.fieldSelector,\n\t\t\tlabels:    stopArgs.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: stopArgs.namespace,","sourceCodeStart":69,"sourceCodeEnd":105,"githubUrl":"https://github.com/argoproj/argo-workflows/blob/35bff19146f5a6ada77468c431f2624bd577e373/cmd/argo/commands/stop.go#L69-L105","documentation":"`argo stop` parses --node-field-selector with fields.ParseSelector inside stopWorkflows before listing/stopping workflows; an invalid selector is rejected client-side with this wrapped error, before any API call.","triggerScenarios":"Running `argo stop` with a malformed --node-field-selector, e.g. `--node-field-selector 'displayName'` (missing '=value') or invalid operators unsupported by field selectors.","commonSituations":"Using label-selector operators (in, notin, exists) in a field selector; quoting stripped the '='; typo producing a bare key with no value.","solutions":["Provide key=value form, e.g. --node-field-selector displayName=approve.","Drop the flag to stop the entire workflow(s).","Quote the selector to protect '=' in the shell."],"exampleFix":"// before\nargo stop my-wf --node-field-selector 'displayName'\n// after\nargo stop my-wf --node-field-selector displayName=approve","handlingStrategy":"validation","validationCode":"if _, err := fields.ParseSelector(stopArgs.nodeFieldSelector); err != nil {\n    return fmt.Errorf(\"bad --node-field-selector %q\", stopArgs.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    // fall back: stop entire workflow without selector\n}","preventionTips":["Always key=value for --node-field-selector.","Quote selectors in shell.","Do not mix label-selector operators into field selectors."],"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"}