xai-org/x-algorithm · error · ConfigFailure

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

Error message

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

What it means

ConfigFailure thrown when adding an event type whose inputFeatures contain duplicate fieldName values. Uniqueness is checked by comparing the set of names to the list size before the event type is registered.

Source

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

    config
  }
}

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)
      }

View on GitHub (pinned to 24c60942c5)

Solutions

  1. Deduplicate or rename the conflicting feature names in the event type config
  2. Check for accidental duplicate entries after merging feature lists

Example fix

# before
input_features: [{fieldName: text}, {fieldName: text_lang}, {fieldName: text}]
# after
input_features: [{fieldName: text}, {fieldName: text_lang}]
Defensive patterns

Strategy: validation

Validate before calling

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

Try / catch

catch { case e: ConfigFailure => print the duplicate name groups to speed up fixing }

Prevention

When it happens

Trigger: Declaring an event type with two input features both named e.g. "text" in config or in an addEventType call.

Common situations: Merging feature lists that each contain a common feature (like userId); renaming a feature but leaving the old one; copy-pasted feature blocks.

Related errors


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