{"record":{"id":"ff317e1aa732c994","repo":"argoproj/argo-workflows","slug":"invalidargument-ff317e","errorCode":"InvalidArgument","errorMessage":"unsupported requirement %s","messagePattern":"unsupported requirement (.+?)","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/utils/list_options.go","lineNumber":154,"sourceCode":"\t\t\tminStartedAt, err = time.Parse(time.RFC3339, after)\n\t\t\tif err != nil {\n\t\t\t\t// startedAt is populated by us, it should therefore be valid.\n\t\t\t\treturn ListOptions{}, ToStatusError(err, codes.Internal)\n\t\t\t}\n\t\t} else if after, ok := strings.CutPrefix(selector, \"spec.startedAt<\"); ok {\n\t\t\tmaxStartedAt, err = time.Parse(time.RFC3339, after)\n\t\t\tif err != nil {\n\t\t\t\t// no need to use sutils here\n\t\t\t\treturn ListOptions{}, ToStatusError(err, codes.Internal)\n\t\t\t}\n\t\t} else if strings.HasPrefix(selector, \"ext.showRemainingItemCount\") {\n\t\t\tshowRemainingItemCount, err = strconv.ParseBool(strings.TrimPrefix(selector, \"ext.showRemainingItemCount=\"))\n\t\t\tif err != nil {\n\t\t\t\t// populated by us, it should therefore be valid.\n\t\t\t\treturn ListOptions{}, ToStatusError(err, codes.Internal)\n\t\t\t}\n\t\t} else {\n\t\t\treturn ListOptions{}, ToStatusError(fmt.Errorf(\"unsupported requirement %s\", selector), codes.InvalidArgument)\n\t\t}\n\t}\n\trequirements, err := labels.ParseToRequirements(options.LabelSelector)\n\tif err != nil {\n\t\treturn ListOptions{}, ToStatusError(err, codes.InvalidArgument)\n\t}\n\treturn ListOptions{\n\t\tNamespace:              namespace,\n\t\tName:                   name,\n\t\tNamePrefix:             namePrefix,\n\t\tNameFilter:             nameFilter,\n\t\tNamespaceFilter:        namespaceFilter,\n\t\tCreatedAfter:           createdAfterTime,\n\t\tFinishedBefore:         finishedBeforeTime,\n\t\tMinStartedAt:           minStartedAt,\n\t\tMaxStartedAt:           maxStartedAt,\n\t\tLabelRequirements:      requirements,\n\t\tLimit:                  limit,","sourceCodeStart":136,"sourceCodeEnd":172,"githubUrl":"https://github.com/argoproj/argo-workflows/blob/35bff19146f5a6ada77468c431f2624bd577e373/server/utils/list_options.go#L136-L172","documentation":"BuildListOptions parses the list options' field selector; only a known allow-list of selectors (including the internally generated 'ext.showRemainingItemCount=...') is supported. Any unrecognized selector string is rejected with InvalidArgument rather than being silently ignored.","triggerScenarios":"Passing a fieldSelector containing an unknown key like 'metadata.name=foo' or a misspelled 'ext.showremainingitemcount=true' to BuildListOptions via the workflow list API/CLI.","commonSituations":"Copy-pasting kubectl-style field selectors that Argo does not implement; typos in the 'ext.' prefixed selectors; older client versions emitting selectors removed in a newer server.","solutions":["Remove the unsupported field selector and filter client-side after listing.","Use the supported selector keys exactly (case-sensitive, e.g. 'ext.showRemainingItemCount=true').","Express the filter as a labelSelector instead, which goes through labels.ParseToRequirements.","Check the server version's supported selector list; upgrade client and server together."],"exampleFix":"// before\nopts.FieldSelector = \"metadata.name=my-wf\"\n// after\nopts.LabelSelector = \"workflows.argoproj.io/name=my-wf\"","handlingStrategy":"validation","validationCode":"var supportedFieldSelectors = map[string]bool{\"ext.showRemainingItemCount=\": true}\nfunc fieldSelectorSupported(fs string) bool {\n    for k := range supportedFieldSelectors {\n        if strings.HasPrefix(fs, k) {\n            return true\n        }\n    }\n    return fs == \"\"\n}","typeGuard":null,"tryCatchPattern":"opts, err := utils.BuildListOptions(ctx, req, namespace)\nif err != nil {\n    if status.Code(err) == codes.InvalidArgument && strings.Contains(err.Error(), \"unsupported requirement\") {\n        // fall back to listing without the selector and filter client-side\n    }\n    return err\n}","preventionTips":["Only use selectors documented for Argo (the 'ext.' prefixed internal ones); prefer labelSelector for user filtering.","Whitelist field selectors in client code before sending requests.","Keep client SDK and server versions aligned; selector support can change."],"tags":["go","grpc","list-options","validation"],"backgroundTag":"unsupported-field-selector","analyzedSha":"35bff19146f5a6ada77468c431f2624bd577e373","analyzedAt":"2026-09-03T19:34:35.908Z","contentChangedAt":"2026-09-03T19:34:35.908Z","schemaVersion":2},"datasetVersion":"2026-09-08T15:18:49.778Z"}