{"record":{"id":"b3b94269d495eb7a","repo":"temporalio/temporal","slug":"invalid-search-attribute-type-s","errorCode":null,"errorMessage":"invalid search attribute type: %s","messagePattern":"invalid search attribute type: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"temporal/fx.go","lineNumber":692,"sourceCode":"\t\tMetricsHandler:             metricsHandler,\n\t\tLogger:                     logger,\n\t\tSerializer:                 serializer,\n\t})\n\tdefer factory.Close()\n\n\tclusterMetadataManager, err := factory.NewClusterMetadataManager()\n\tif err != nil {\n\t\treturn svc.ClusterMetadata, svc.Persistence, fmt.Errorf(\"error initializing cluster metadata manager: %w\", err)\n\t}\n\tdefer clusterMetadataManager.Close()\n\n\tvisCSAOverride := map[enumspb.IndexedValueType]int{}\n\tfor tpName, value := range svc.Visibility.PersistenceCustomSearchAttributes {\n\t\tsaType, ok := enumspb.IndexedValueType_shorthandValue[tpName]\n\t\tif !ok {\n\t\t\treturn svc.ClusterMetadata,\n\t\t\t\tsvc.Persistence,\n\t\t\t\tfmt.Errorf(\"invalid search attribute type: %s\", tpName)\n\t\t}\n\t\tif value < 0 || value > 99 {\n\t\t\treturn svc.ClusterMetadata,\n\t\t\t\tsvc.Persistence,\n\t\t\t\tfmt.Errorf(\n\t\t\t\t\t\"invalid number of custom search attributes for type %s (must be between 0 and 99)\",\n\t\t\t\t\ttpName,\n\t\t\t\t)\n\t\t}\n\t\tvisCSAOverride[enumspb.IndexedValueType(saType)] = value\n\t}\n\n\tvisDataStores := []config.DataStore{\n\t\tsvc.Persistence.GetVisibilityStoreConfig(),\n\t\tsvc.Persistence.GetSecondaryVisibilityStoreConfig(),\n\t}\n\tindexSearchAttributes := make(map[string]*persistencespb.IndexSearchAttributes)\n\tfor _, ds := range visDataStores {","sourceCodeStart":674,"sourceCodeEnd":710,"githubUrl":"https://github.com/temporalio/temporal/blob/bde624efd13fbd3843654058db6d9c716166318b/temporal/fx.go#L674-L710","documentation":"Validation error when a PersistenceCustomSearchAttributes entry in the visibility config names a type that is not a known enumspb.IndexedValueType shorthand. The server maps config type names to IndexedValueType enums and aborts if the name is unrecognized.","triggerScenarios":"Configuring Visibility.PersistenceCustomSearchAttributes with a key that is not a valid IndexedValueType name (e.g. misspelling, or Elasticsearch-style names like 'keyword' instead of 'Keyword').","commonSituations":"Typos in YAML config; copying type names from Elasticsearch mapping terminology ('keyword', 'long') instead of Temporal's enum names ('Keyword','Int'); upgrading Temporal and using a removed type name.","solutions":["Use exact IndexedValueType names: Int, Float, Bool, Keyword, Text, Datetime, KeywordList","Check the key spelling against enumspb.IndexedValueType_shorthandValue","Validate config in CI before deploying"],"exampleFix":"// before\nvisibility:\n  persistenceCustomSearchAttributes:\n    CustomKeywordField: \"keyword\"\n// after\nvisibility:\n  persistenceCustomSearchAttributes:\n    CustomKeywordField: \"Keyword\"","handlingStrategy":"validation","validationCode":"valid := map[string]bool{\n  \"Int\": true, \"Float\": true, \"Bool\": true,\n  \"Keyword\": true, \"Text\": true, \"Datetime\": true, \"KeywordList\": true,\n}\nfor name := range cfg.Visibility.PersistenceCustomSearchAttributes {\n    if !valid[name] { return fmt.Errorf(\"bad SA type: %s\", name) }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use enumspb IndexedValueType names exactly","Lint YAML config against a schema listing valid SA types","Copy type names from Temporal docs, not Elasticsearch terminology"],"tags":["config","search-attributes","validation"],"backgroundTag":"invalid-search-attribute-type","analyzedSha":"bde624efd13fbd3843654058db6d9c716166318b","analyzedAt":"2026-09-01T07:18:39.080Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}