temporalio/temporal · error

unknown filter name: %s

Error message

unknown filter name: %s

What it means

The gcloud archive query parser supports a fixed set of filter columns (WorkflowID, RunID, CloseTime, StartTime, WorkflowType, SearchPrecision). Any other column name in the WHERE clause falls to the default branch of the switch and returns this error. The parser does not do fuzzy matching; the column string must match the constant exactly.

Source

Thrown at common/archiver/gcloud/query_parser.go:199

			return err
		}
		if op != "=" {
			return fmt.Errorf("only operation = is support for %s", SearchPrecision)
		}
		if parsedQuery.searchPrecision != nil && *parsedQuery.searchPrecision != val {
			return fmt.Errorf("only one expression is allowed for %s", SearchPrecision)
		}
		switch val {
		case PrecisionDay:
		case PrecisionHour:
		case PrecisionMinute:
		case PrecisionSecond:
		default:
			return fmt.Errorf("invalid value for %s: %s", SearchPrecision, val)
		}
		parsedQuery.searchPrecision = new(val)
	default:
		return fmt.Errorf("unknown filter name: %s", colNameStr)
	}

	return nil
}

View on GitHub (pinned to bde624efd1)

Solutions

  1. Restrict the WHERE clause to supported fields: WorkflowID, RunID, CloseTime, StartTime, WorkflowType, SearchPrecision
  2. Fix the column-name spelling/case to match the parser constants exactly
  3. Remove unsupported search-attribute filters when querying archives
  4. Check the actual error text: it echoes the offending column name; verify against the switch in common/archiver/gcloud/query_parser.go

Example fix

// before
query := `WHERE WorkflowID = "w1" AND ExecutionStatus = "Completed"`
// after
query := `WHERE WorkflowID = "w1"`
Defensive patterns

Strategy: validation

Validate before calling

var archiveFilters = map[string]bool{
	"WorkflowID":true,"RunID":true,"CloseTime":true,
	"StartTime":true,"WorkflowType":true,"SearchPrecision":true,
}
func filterOK(col string) bool { return archiveFilters[col] }

Try / catch

q, err := parseArchiveQuery(raw)
if err != nil {
	return fmt.Errorf("unsupported archive filter: %w", err)
}

Prevention

When it happens

Trigger: A WHERE clause referencing unsupported or misspelled columns, e.g. `WHERE ExecutionStatus = "Completed"`, `WHERE workflowid = "..."` (case/format mismatch), or custom search attributes in an archive query.

Common situations: Queries written for Elasticsearch visibility (which accepts ExecutionStatus and custom search attributes) run against a gcloud archive; typos in column names; case mismatches.

Related errors


AI-assisted analysis of temporalio/temporal@bde624efd1 (2026-09-01). Data as JSON: /api/errors/2482f315aba43147. Report an issue: GitHub.