{"record":{"id":"12187ba7b2ecad64","repo":"xai-org/x-algorithm","slug":"regex-timeoutmilis-must-be-greater-than-0","errorCode":null,"errorMessage":"Regex timeoutMilis must be greater than 0","messagePattern":"Regex timeoutMilis must be greater than 0","errorType":"validation","errorClass":"ConfigFailure","httpStatus":null,"severity":"error","filePath":"botmaker/src/scala/com/twitter/botmaker/runtime/config/RegexConfigs.scala","lineNumber":35,"sourceCode":"\ntrait RegexOptionConfigs extends ServiceConfigs {\n\n  private final var regexOptions = new RegexConfig()\n    .setTimeoutMilis(1000L)\n    .setMaximumPendingRequests(20L)\n\n  final def getRegexOptions: RegexConfig = regexOptions\n\n  final def addRegexOptions(config: RegexConfig): Unit = {\n\n    if (config.maximumPendingRequests <= 0) {\n      throw ConfigFailure(\n        s\"Regex maximumPendingRequests must be greater than 0\"\n      )\n    }\n\n    if (config.timeoutMilis <= 0) {\n      throw ConfigFailure(\n        s\"Regex timeoutMilis must be greater than 0\"\n      )\n    }\n\n    if (config.maximumCacheItems <= 0) {\n      throw ConfigFailure(\n        s\"Regex maximumCacheItems must be greater than 0\"\n      )\n    }\n\n    if (config.cacheExpirationMillis <= 0) {\n      throw ConfigFailure(\n        s\"Regex cacheExpirationMillis must be greater than 0\"\n      )\n    }\n\n    regexOptions = config\n  }","sourceCodeStart":17,"sourceCodeEnd":53,"githubUrl":"https://github.com/xai-org/x-algorithm/blob/24c60942c5c5fdad3a6addffb4c6e6d2f228f04f/botmaker/src/scala/com/twitter/botmaker/runtime/config/RegexConfigs.scala#L17-L53","documentation":"ConfigFailure thrown by RegexConfigs.addRegexOptions when timeoutMilis <= 0 (note the typo 'Milis' is part of the API). The regex evaluation timeout must be positive to be meaningful.","triggerScenarios":"Registering regex options with timeout_milis: 0 or negative, or the field missing in a context with no default and defaulting through as 0.","commonSituations":"Placeholder zeros in generated config; users writing timeoutMillis (correct spelling) so the typo'd field is never set and a 0 default is validated.","solutions":["Set timeoutMilis (exact spelling) to a positive millisecond value","Confirm you're populating the typo'd field name timeoutMilis, not timeoutMillis"],"exampleFix":"# before\nregex:\n  timeoutMillis: 0\n# after\nregex:\n  timeoutMilis: 500","handlingStrategy":"validation","validationCode":"require(config.timeoutMilis > 0, \"timeoutMilis must be positive\")","typeGuard":null,"tryCatchPattern":"catch { case e: ConfigFailure => fail fast at config load, not at request time }","preventionTips":["Remember the API field is spelled timeoutMilis (typo) — set it explicitly","Lint for common misspellings of config keys in code review"],"tags":["scala","config-validation","timeout"],"backgroundTag":"invalid-timeout-config","analyzedSha":"24c60942c5c5fdad3a6addffb4c6e6d2f228f04f","analyzedAt":"2026-08-28T11:40:14.686Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}