{"record":{"id":"996f033599a8db3f","repo":"argoproj/argo-workflows","slug":"operation-v-is-not-supported","errorCode":null,"errorMessage":"operation %v is not supported","messagePattern":"operation (.+?) is not supported","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"persist/sqldb/archived_workflow_labels.go","lineNumber":112,"sourceCode":"\t\treturn db.Raw(fmt.Sprintf(\"not exists (select 1 from %s where %s uid = %s.uid and name = '%s' and value = '%s')\", labelTableName, clusterNameSelector, tableName, r.Key(), r.Values().List()[0])), nil\n\tcase selection.NotIn:\n\t\treturn db.Raw(fmt.Sprintf(\"not exists (select 1 from %s where %s uid = %s.uid and name = '%s' and value in ('%s'))\", labelTableName, clusterNameSelector, tableName, r.Key(), strings.Join(r.Values().List(), \"', '\"))), nil\n\tcase selection.Exists:\n\t\treturn db.Raw(fmt.Sprintf(\"exists (select 1 from %s where %s uid = %s.uid and name = '%s')\", labelTableName, clusterNameSelector, tableName, r.Key())), nil\n\tcase selection.GreaterThan:\n\t\ti, err := strconv.Atoi(r.Values().List()[0])\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn db.Raw(fmt.Sprintf(\"exists (select 1 from %s where %s uid = %s.uid and name = '%s' and cast(value as %s) > %d)\", labelTableName, clusterNameSelector, tableName, r.Key(), t.IntType(), i)), nil\n\tcase selection.LessThan:\n\t\ti, err := strconv.Atoi(r.Values().List()[0])\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn db.Raw(fmt.Sprintf(\"exists (select 1 from %s where %s uid = %s.uid and name = '%s' and cast(value as %s) < %d)\", labelTableName, clusterNameSelector, tableName, r.Key(), t.IntType(), i)), nil\n\t}\n\treturn nil, fmt.Errorf(\"operation %v is not supported\", r.Operator())\n}\n","sourceCodeStart":94,"sourceCodeEnd":114,"githubUrl":"https://github.com/argoproj/argo-workflows/blob/35bff19146f5a6ada77468c431f2624bd577e373/persist/sqldb/archived_workflow_labels.go#L94-L114","documentation":"requirementToCondition translates a labels.Requirement (from a workflow label selector) into a SQL condition when querying archived workflow labels. Operators like In/NotIn/Equals and the shown numeric comparisons are supported; any other requirement operator reaches the fallthrough and returns this error.","triggerScenarios":"A label selector requirement uses an operator the SQL mapping doesn't implement (e.g. NotIn, DoesNotExist, Exists, or another unhandled operator) when listing archived workflows via BuildWorkflowSelector / labelsClause.","commonSituations":"CLI/API queries like `argo archive list -l key!=value` or archived-workflow filters using unsupported operators; newer client selectors sent to an older backend implementation.","solutions":["Rewrite the label selector to use supported operators (equals, In, and the supported numeric comparisons).","If you need negation, fetch with the supported filter and post-filter results client-side.","If the operator should be supported, implement it in requirementToCondition (persist/sqldb/archived_workflow_labels.go) and add tests.","Check the requirement passed by the caller (CLI flag vs API field) to ensure no unintended default operator is used."],"exampleFix":"// before\n// argo archive list -l workflows.argoproj.io/phase!=Succeeded\n// after\n// argo archive list -l workflows.argoproj.io/phase=Failed,workflows.argoproj.io/phase=Error","handlingStrategy":"validation","validationCode":"// reject unsupported operators before querying the archive\nfunc supported(r labels.Requirement) bool {\n    switch r.Operator() {\n    case selection.Equals, selection.In, selection.GreaterThan, selection.LessThan:\n        return true\n    }\n    return false\n}","typeGuard":"func isSupportedRequirement(r labels.Requirement) bool {\n    op := r.Operator()\n    return op == selection.Equals || op == selection.In || op == selection.GreaterThan || op == selection.LessThan\n}","tryCatchPattern":"conds, err := requirementToCondition(tableName, clusterName, r)\nif err != nil {\n    return nil, fmt.Errorf(\"archive label filter uses unsupported operator %v; use = or In: %w\", r.Operator(), err)\n}","preventionTips":["Use only = and In (plus supported numeric comparisons) in archived-workflow label selectors.","Post-filter negated conditions client-side instead of using != / NotIn.","Add a unit test per new operator implemented in requirementToCondition.","Surface supported operators in CLI help/API docs."],"tags":["database","archive","label-selector"],"backgroundTag":"unsupported-operator","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"}