xai-org/x-algorithm · error · ConfigFailure

Field Ids in event type ${config.eventType} are not unique.

Error message

Field Ids in event type ${config.eventType} are not unique.

What it means

ConfigFailure thrown when an event type's inputFeatures contain duplicate fieldId values (the numeric IDs), analogous to the field-name check. Field IDs must be unique within an event type so encoding is unambiguous.

Source

Thrown at botmaker/src/scala/com/twitter/botmaker/runtime/config/EventTypeConfigs.scala:59

trait EventTypeConfigs extends ServiceConfigs {

  final private val eventTypes = mutable.Map[String, BotMakerEventTypeConfig]()

  final def getEventTypes: Map[String, BotMakerEventTypeConfig] = eventTypes.toMap

  final def addEventType(config: BotMakerEventTypeConfig): Option[BotMakerEventTypeConfig] = {

    unique(EventType, config.eventType)
    validateEventType(config.eventType)

    config.inputFeatures.asScala foreach { fc => validateFieldName(fc.fieldName) }

    if (config.inputFeatures.asScala.map(_.fieldName).toSet.size != config.inputFeatures.size) {
      throw ConfigFailure(s"Field names in event type ${config.eventType} are not unique.")
    }

    if (config.inputFeatures.asScala.map(_.fieldId).toSet.size != config.inputFeatures.size) {
      throw ConfigFailure(s"Field Ids in event type ${config.eventType} are not unique.")
    }

    eventTypes.put(config.eventType, config)
  }

  override def debug(dbg: RuntimeDebugger): Unit = {

    super.debug(dbg)

    dbg.open("eventTypes", eventTypes) foreach { d =>
      eventTypes foreach {
        case (name, config) =>
          d.info(name, config.toString)
      }
    }
  }

  override def compilerBuilder[E <: ServiceContainer: ClassTag]: CompilerBuilder[E] = {

View on GitHub (pinned to 24c60942c5)

Solutions

  1. Assign unique fieldId values to every feature in the event type
  2. Audit the feature ID allocation table after merging event types

Example fix

# before
input_features: [{fieldId: 1, fieldName: a}, {fieldId: 1, fieldName: b}]
# after
input_features: [{fieldId: 1, fieldName: a}, {fieldId: 2, fieldName: b}]
Defensive patterns

Strategy: validation

Validate before calling

val ids = config.inputFeatures.asScala.map(_.fieldId)
require(ids.size == ids.toSet.size, s"duplicate fieldIds: ${ids.toSeq.groupBy(identity).filter(_._2.size>1).keys}")

Try / catch

catch { case e: ConfigFailure => report duplicate IDs and the owning features }

Prevention

When it happens

Trigger: Two input features sharing the same fieldId in one event type — often after renumbering or merging feature definitions.

Common situations: Appending features with IDs copied from another event type; thrift ID renumbering collisions during schema evolution.

Related errors


AI-assisted analysis of xai-org/x-algorithm@24c60942c5 (2026-08-28). Data as JSON: /api/errors/2587c2cdb7b2a5ad. Report an issue: GitHub.