argoproj/argo-workflows · error

operation %v is not supported

Error message

operation %v is not supported

What it means

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.

Source

Thrown at persist/sqldb/archived_workflow_labels.go:112

		return 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
	case selection.NotIn:
		return 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
	case selection.Exists:
		return db.Raw(fmt.Sprintf("exists (select 1 from %s where %s uid = %s.uid and name = '%s')", labelTableName, clusterNameSelector, tableName, r.Key())), nil
	case selection.GreaterThan:
		i, err := strconv.Atoi(r.Values().List()[0])
		if err != nil {
			return nil, err
		}
		return 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
	case selection.LessThan:
		i, err := strconv.Atoi(r.Values().List()[0])
		if err != nil {
			return nil, err
		}
		return 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
	}
	return nil, fmt.Errorf("operation %v is not supported", r.Operator())
}

View on GitHub (pinned to 35bff19146)

Solutions

  1. Rewrite the label selector to use supported operators (equals, In, and the supported numeric comparisons).
  2. If you need negation, fetch with the supported filter and post-filter results client-side.
  3. If the operator should be supported, implement it in requirementToCondition (persist/sqldb/archived_workflow_labels.go) and add tests.
  4. Check the requirement passed by the caller (CLI flag vs API field) to ensure no unintended default operator is used.

Example fix

// before
// argo archive list -l workflows.argoproj.io/phase!=Succeeded
// after
// argo archive list -l workflows.argoproj.io/phase=Failed,workflows.argoproj.io/phase=Error
Defensive patterns

Strategy: validation

Validate before calling

// reject unsupported operators before querying the archive
func supported(r labels.Requirement) bool {
    switch r.Operator() {
    case selection.Equals, selection.In, selection.GreaterThan, selection.LessThan:
        return true
    }
    return false
}

Type guard

func isSupportedRequirement(r labels.Requirement) bool {
    op := r.Operator()
    return op == selection.Equals || op == selection.In || op == selection.GreaterThan || op == selection.LessThan
}

Try / catch

conds, err := requirementToCondition(tableName, clusterName, r)
if err != nil {
    return nil, fmt.Errorf("archive label filter uses unsupported operator %v; use = or In: %w", r.Operator(), err)
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of argoproj/argo-workflows@35bff19146 (2026-09-03). Data as JSON: /api/errors/996f033599a8db3f. Report an issue: GitHub.