{"record":{"id":"a0d1595b2319f2b8","repo":"xai-org/x-algorithm","slug":"event-type-eventtype-does-not-match-eventtyper","errorCode":null,"errorMessage":"Event type '$eventType' does not match $eventTypeRegex.","messagePattern":"Event type '\\$eventType' does not match \\$eventTypeRegex\\.","errorType":"validation","errorClass":"ConfigFailure","httpStatus":null,"severity":"error","filePath":"botmaker/src/scala/com/twitter/botmaker/runtime/config/ServiceConfigs.scala","lineNumber":64,"sourceCode":"  def unique(names: Any*): Unit = synchronized {\n    val nameSeq = names.toSeq\n    if (uniqueNames.contains(nameSeq)) {\n      throw ConfigFailure(\n        s\"Conflict config name:${nameSeq.mkString}\"\n      )\n    }\n    uniqueNames += nameSeq\n  }\n\n  def validate(condition: Boolean, err: String): Unit = {\n    if (!condition) {\n      throw ConfigFailure(err)\n    }\n  }\n\n  def validateEventType(eventType: String): Unit = {\n    if (eventTypeRegex.findFirstIn(eventType).isEmpty) {\n      throw ConfigFailure(\n        s\"Event type '$eventType' does not match $eventTypeRegex.\"\n      )\n    }\n  }\n\n  def validateFieldName(fieldName: String): Unit = {\n    if (fieldNameRegex.findFirstIn(fieldName).isEmpty) {\n      throw ConfigFailure(\n        s\"Field name '$fieldName' does not match $fieldNameRegex.\"\n      )\n    }\n  }\n\n  def validateFuncName(funcName: String): Unit = {\n    if (funcNameRegex.findFirstIn(funcName).isEmpty) {\n      throw ConfigFailure(\n        s\"Func name '$funcName' does not match $funcNameRegex.\"\n      )","sourceCodeStart":46,"sourceCodeEnd":82,"githubUrl":"https://github.com/xai-org/x-algorithm/blob/24c60942c5c5fdad3a6addffb4c6e6d2f228f04f/botmaker/src/scala/com/twitter/botmaker/runtime/config/ServiceConfigs.scala#L46-L82","documentation":"Event type names in BotMaker must match eventTypeRegex. validateEventType runs during config registration and throws ConfigFailure (with the offending value and the regex in the message) when the eventType string fails to match, keeping event names uniformly parseable/generatable.","triggerScenarios":"Registering an event/endpoint whose eventType string does not satisfy eventTypeRegex (typically lowerCamelCase alphanumerics; check the eventTypeRegex value in ServiceConfigs for the exact pattern) — e.g. names with dashes, leading digits, spaces, or empty strings.","commonSituations":"Using kebab-case or snake_case event names; generating event types from dataset names or strings containing punctuation; trailing whitespace from config files.","solutions":["Read the exact pattern from eventTypeRegex in ServiceConfigs and rename the eventType to conform (usually UpperCamel or lowerCamel alphanumeric)","Sanitize generated names (strip whitespace/punctuation) before registration","Add a startup assertion that all event types pass the regex before the config is registered"],"exampleFix":"// before\nendpoint(\"content-scan-v2\")\n\n// after\nendpoint(\"ContentScanV2\") // matches eventTypeRegex e.g. ^[A-Z][a-zA-Z0-9_]*$","handlingStrategy":"type-guard","validationCode":"import re\nEVENT_TYPE_RE = re.compile(r'^[A-Z][a-zA-Z0-9_]*$')  # mirror eventTypeRegex\ndef validEventType(t): return bool(EVENT_TYPE_RE.match(t))","typeGuard":"def isValidEventType(name: str) -> bool:\n    import re\n    return bool(re.match(r'^[A-Z][a-zA-Z0-9_]*$', name))","tryCatchPattern":"try:\n    registerEvent(evt)\nexcept ConfigFailure as e:\n    if \"does not match\" in str(e):\n        registerEvent(toUpperCamelCase(evt))\n    else:\n        raise","preventionTips":["Run names through a normalizer before registration","Keep event type constants in one enum-like object"],"tags":["botmaker","scala","naming-convention","config-validation"],"backgroundTag":"identifier-validation-failed","analyzedSha":"24c60942c5c5fdad3a6addffb4c6e6d2f228f04f","analyzedAt":"2026-08-28T11:40:14.686Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}