{"record":{"id":"502075daffa4657b","repo":"temporalio/temporal","slug":"registrable-component-validation-error-chasm-sear-502075","errorCode":null,"errorMessage":"registrable component validation error: CHASM search attribute alias %q is a reserved search attribute","messagePattern":"registrable component validation error: CHASM search attribute alias %q is a reserved search attribute","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"chasm/registrable_component.go","lineNumber":140,"sourceCode":"\t\t\t\tif !sadefs.IsChasmOverridableSystem(field) {\n\t\t\t\t\t//nolint:forbidigo\n\t\t\t\t\tpanic(fmt.Sprintf(\"registrable component validation error: system search attribute %q cannot be overridden by a CHASM component\", field))\n\t\t\t\t}\n\t\t\t\tif _, ok := rc.searchAttributesMapper.overriddenSystemFields[field]; ok {\n\t\t\t\t\t//nolint:forbidigo\n\t\t\t\t\tpanic(fmt.Sprintf(\"registrable component validation error: system search attribute override %q is already defined\", field))\n\t\t\t\t}\n\t\t\t\trc.searchAttributesMapper.overriddenSystemFields[field] = valueType\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tif sadefs.IsChasmSystem(alias) {\n\t\t\t\t//nolint:forbidigo\n\t\t\t\tpanic(fmt.Sprintf(\"registrable component validation error: CHASM search attribute alias %q is a CHASM system search attribute\", alias))\n\t\t\t}\n\t\t\tif !sadefs.IsSystem(alias) && sadefs.IsReserved(alias) {\n\t\t\t\t//nolint:forbidigo\n\t\t\t\tpanic(fmt.Sprintf(\"registrable component validation error: CHASM search attribute alias %q is a reserved search attribute\", alias))\n\t\t\t}\n\n\t\t\tif _, ok := rc.searchAttributesMapper.systemAliasToField[alias]; ok {\n\t\t\t\t//nolint:forbidigo\n\t\t\t\tpanic(fmt.Sprintf(\"registrable component validation error: CHASM search attribute alias %q is already defined as a system search attribute alias\", alias))\n\t\t\t}\n\t\t\tif _, ok := rc.searchAttributesMapper.aliasToField[alias]; ok {\n\t\t\t\t//nolint:forbidigo\n\t\t\t\tpanic(fmt.Sprintf(\"registrable component validation error: search attribute alias %q is already defined\", alias))\n\t\t\t}\n\t\t\tif _, ok := rc.searchAttributesMapper.fieldToAlias[field]; ok {\n\t\t\t\t//nolint:forbidigo\n\t\t\t\tpanic(fmt.Sprintf(\"registrable component validation error: search attribute field %q is already defined\", field))\n\t\t\t}\n\n\t\t\trc.searchAttributesMapper.aliasToField[alias] = field\n\t\t\trc.searchAttributesMapper.fieldToAlias[field] = alias\n\t\t\trc.searchAttributesMapper.saTypeMap[field] = valueType","sourceCodeStart":122,"sourceCodeEnd":158,"githubUrl":"https://github.com/temporalio/temporal/blob/bde624efd13fbd3843654058db6d9c716166318b/chasm/registrable_component.go#L122-L158","documentation":"This panic comes from the CHASM component registration option WithSearchAttributes: the alias given to a custom search attribute collides with a name that Temporal reserves for platform-defined search attributes. Reserved names are rejected because they would be ambiguous or would shadow built-in columns used by visibility queries. It fires at registration time (process startup) as an intentional fail-fast panic, not a runtime error.","triggerScenarios":"Calling chasm.WithSearchAttributes on a RegistrableComponent with a SearchAttribute whose alias passes !sadefs.IsSystem(alias) && sadefs.IsReserved(alias) — i.e. a user-defined alias equal to a reserved (but not core-system) search attribute name such as 'StartTime' or another reserved keyword.","commonSituations":"A developer names a custom attribute something like 'ExecutionStatus' or a formerly-custom alias that a newer Temporal SDK promoted to reserved status; copy-pasting attribute definitions from non-CHASM workflow code that used reserved names; upgrading Temporal where the reserved list grew and a previously accepted alias now panics at startup.","solutions":["Rename the component search attribute alias to a non-reserved, namespaced name (e.g. prefix with your component name)","Check sadefs.IsReserved / the Temporal search attribute docs for the reserved list before choosing aliases","If you truly need the reserved name semantics, use the built-in system attribute directly instead of redefining it in CHASM","If the panic appeared after a Temporal upgrade, find which alias newly became reserved and rename it"],"exampleFix":"// before\nchasm.WithSearchAttributes(chasm.NewSearchAttribute(\"StartTime\", \"start_time\", enumspb.INDEXED_VALUE_TYPE_DATETIME))\n// after\nchasm.WithSearchAttributes(chasm.NewSearchAttribute(\"MyComponentStartTime\", \"my_component_start_time\", enumspb.INDEXED_VALUE_TYPE_DATETIME))","handlingStrategy":"validation","validationCode":"// at package init, before registering\nif !sadefs.IsSystem(alias) && sadefs.IsReserved(alias) {\n    return fmt.Errorf(\"alias %q is reserved; choose another\", alias)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Prefix custom aliases with your component/domain name to guarantee uniqueness","Check the Temporal reserved search attribute list when adding attributes","Treat registration panics at startup as config errors and fix before deploy","Add a unit test that registers each component's options in a test library"],"tags":["chasm","search-attributes","registration","panic"],"backgroundTag":"reserved-search-attribute-alias","analyzedSha":"bde624efd13fbd3843654058db6d9c716166318b","analyzedAt":"2026-09-01T07:18:39.080Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}