{"record":{"id":"f2ed9a5282104bb2","repo":"xai-org/x-algorithm","slug":"field-names-in-event-type-config-eventtype-are","errorCode":null,"errorMessage":"Field names in event type ${config.eventType} are not unique.","messagePattern":"Field names in event type (.+?) are not unique\\.","errorType":"validation","errorClass":"ConfigFailure","httpStatus":null,"severity":"error","filePath":"botmaker/src/scala/com/twitter/botmaker/runtime/config/EventTypeConfigs.scala","lineNumber":55,"sourceCode":"    config\n  }\n}\n\ntrait EventTypeConfigs extends ServiceConfigs {\n\n  final private val eventTypes = mutable.Map[String, BotMakerEventTypeConfig]()\n\n  final def getEventTypes: Map[String, BotMakerEventTypeConfig] = eventTypes.toMap\n\n  final def addEventType(config: BotMakerEventTypeConfig): Option[BotMakerEventTypeConfig] = {\n\n    unique(EventType, config.eventType)\n    validateEventType(config.eventType)\n\n    config.inputFeatures.asScala foreach { fc => validateFieldName(fc.fieldName) }\n\n    if (config.inputFeatures.asScala.map(_.fieldName).toSet.size != config.inputFeatures.size) {\n      throw ConfigFailure(s\"Field names in event type ${config.eventType} are not unique.\")\n    }\n\n    if (config.inputFeatures.asScala.map(_.fieldId).toSet.size != config.inputFeatures.size) {\n      throw ConfigFailure(s\"Field Ids in event type ${config.eventType} are not unique.\")\n    }\n\n    eventTypes.put(config.eventType, config)\n  }\n\n  override def debug(dbg: RuntimeDebugger): Unit = {\n\n    super.debug(dbg)\n\n    dbg.open(\"eventTypes\", eventTypes) foreach { d =>\n      eventTypes foreach {\n        case (name, config) =>\n          d.info(name, config.toString)\n      }","sourceCodeStart":37,"sourceCodeEnd":73,"githubUrl":"https://github.com/xai-org/x-algorithm/blob/24c60942c5c5fdad3a6addffb4c6e6d2f228f04f/botmaker/src/scala/com/twitter/botmaker/runtime/config/EventTypeConfigs.scala#L37-L73","documentation":"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.","triggerScenarios":"Declaring an event type with two input features both named e.g. \"text\" in config or in an addEventType call.","commonSituations":"Merging feature lists that each contain a common feature (like userId); renaming a feature but leaving the old one; copy-pasted feature blocks.","solutions":["Deduplicate or rename the conflicting feature names in the event type config","Check for accidental duplicate entries after merging feature lists"],"exampleFix":"# before\ninput_features: [{fieldName: text}, {fieldName: text_lang}, {fieldName: text}]\n# after\ninput_features: [{fieldName: text}, {fieldName: text_lang}]","handlingStrategy":"validation","validationCode":"val names = config.inputFeatures.asScala.map(_.fieldName)\nrequire(names.size == names.toSet.size, s\"duplicate fieldNames: ${names.groupBy(identity).filter(_._2.size>1).keys}\")","typeGuard":null,"tryCatchPattern":"catch { case e: ConfigFailure => print the duplicate name groups to speed up fixing }","preventionTips":["Generate event type configs from typed sources, not hand-edited lists","Diff feature lists after merges"],"tags":["config-validation","scala","duplicate-keys"],"backgroundTag":"duplicate-field-names","analyzedSha":"24c60942c5c5fdad3a6addffb4c6e6d2f228f04f","analyzedAt":"2026-08-28T11:40:14.686Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}