temporalio/temporal · error

registrable component validation error: CHASM search attribu

Error message

registrable component validation error: CHASM search attribute alias %q is already defined as a system search attribute alias

What it means

This panic fires when a CHASM component's WithSearchAttributes option defines an alias that already maps to a system search attribute (alias is present in systemAliasToField, e.g. previously bound via the business-ID/system alias registration paths). Allowing it would make alias resolution ambiguous between the system column mapping and the custom mapping, so registration fails fast with a panic.

Source

Thrown at chasm/registrable_component.go:145

					//nolint:forbidigo
					panic(fmt.Sprintf("registrable component validation error: system search attribute override %q is already defined", field))
				}
				rc.searchAttributesMapper.overriddenSystemFields[field] = valueType
				continue
			}

			if sadefs.IsChasmSystem(alias) {
				//nolint:forbidigo
				panic(fmt.Sprintf("registrable component validation error: CHASM search attribute alias %q is a CHASM system search attribute", alias))
			}
			if !sadefs.IsSystem(alias) && sadefs.IsReserved(alias) {
				//nolint:forbidigo
				panic(fmt.Sprintf("registrable component validation error: CHASM search attribute alias %q is a reserved search attribute", alias))
			}

			if _, ok := rc.searchAttributesMapper.systemAliasToField[alias]; ok {
				//nolint:forbidigo
				panic(fmt.Sprintf("registrable component validation error: CHASM search attribute alias %q is already defined as a system search attribute alias", alias))
			}
			if _, ok := rc.searchAttributesMapper.aliasToField[alias]; ok {
				//nolint:forbidigo
				panic(fmt.Sprintf("registrable component validation error: search attribute alias %q is already defined", alias))
			}
			if _, ok := rc.searchAttributesMapper.fieldToAlias[field]; ok {
				//nolint:forbidigo
				panic(fmt.Sprintf("registrable component validation error: search attribute field %q is already defined", field))
			}

			rc.searchAttributesMapper.aliasToField[alias] = field
			rc.searchAttributesMapper.fieldToAlias[field] = alias
			rc.searchAttributesMapper.saTypeMap[field] = valueType
		}
	}
}

// WithContextValues allows specifying key-value pairs that will be available in the Context

View on GitHub (pinned to bde624efd1)

Solutions

  1. Pick a distinct alias for the custom search attribute
  2. Audit all RegistrableComponentOption calls on the component for overlapping aliases
  3. If you want to query the system field, reference the system attribute directly instead of redeclaring it

Example fix

// before
chasm.WithBusinessID("WorkflowID"),
chasm.WithSearchAttributes(chasm.NewSearchAttribute("WorkflowID", ...)) // duplicate
// after
chasm.WithBusinessID("WorkflowID"),
chasm.WithSearchAttributes(chasm.NewSearchAttribute("OrderID", ...))
Defensive patterns

Strategy: validation

Validate before calling

// ensure the alias isn't a system-registered alias before registering
if _, ok := mapper.SystemAliasToField[alias]; ok {
    return fmt.Errorf("alias %q is a system alias", alias)
}

Prevention

When it happens

Trigger: Calling chasm.WithSearchAttributes with a SearchAttribute whose alias was already registered as a system alias on the same RegistrableComponent (e.g. reusing the business ID alias or a system alias set up by WithBusinessID or prior options).

Common situations: Defining a custom search attribute with the same alias as a system-registered attribute (like the business ID alias) in the same component; combining two option functions that both reference the same alias; copy-pasting option lists between components.

Related errors


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