xai-org/x-algorithm · error · ConfigFailure

invalid session timeout value ${config.sessionTimeoutMillis}

Error message

invalid session timeout value ${config.sessionTimeoutMillis} in thrift endpoint ${config.endpoint}

What it means

ConfigFailure thrown when a ThriftEndpointConfig explicitly sets sessionTimeoutMillis to a value <= 0. The check only applies when the field is set (isSetSessionTimeoutMillis), so it catches negative/zero overrides rather than unset defaults.

Source

Thrown at botmaker/botmaker_thrift/src/main/scala/com/twitter/botmaker/runtime/config/ThriftEndpointConfigs.scala:55

  }
}

trait ThriftEndpointConfigs extends ServiceConfigs {

  private final val thriftEndpoints = ArrayBuffer[ThriftEndpointConfig]()

  final def getThriftEndpoints: Seq[ThriftEndpointConfig] = thriftEndpoints.toSeq

  final def getThriftEndpoint(endpoint: String): Option[ThriftEndpointConfig] =
    thriftEndpoints.filter(_.endpoint == endpoint).headOption

  final def addThriftEndpoint(config: ThriftEndpointConfig): Unit = {

    unique(Endpoint, config.endpoint)

    validateEndpoint(config.endpoint)
    if (config.isSetSessionTimeoutMillis && config.sessionTimeoutMillis <= 0) {
      throw ConfigFailure(
        s"invalid session timeout value ${config.sessionTimeoutMillis} in thrift endpoint ${config.endpoint}"
      )
    }

    if (config.isSetRequestTimeoutMillis && config.requestTimeoutMillis <= 0) {
      throw ConfigFailure(
        s"invalid request timeout value ${config.requestTimeoutMillis} in thrift endpoint ${config.endpoint}"
      )
    }

    config.methods.asScala foreach { tm =>
      unique(FuncName, config.endpoint, tm.funcName)
      validateFuncName(tm.funcName)
      if (tm.isSetTimeoutMillis && tm.timeoutMillis <= 0) {
        throw ConfigFailure(
          s"invalid timeout value ${tm.timeoutMillis} in thrift method ${tm.funcName} of ${config.endpoint}"
        )
      }

View on GitHub (pinned to 24c60942c5)

Solutions

  1. Set sessionTimeoutMillis to a positive millisecond value, or remove the field entirely to use the default
  2. Grep config files for session_timeout_millis: 0 / negative values

Example fix

# before
session_timeout_millis: 0
# after
session_timeout_millis: 10000  # or omit the field
Defensive patterns

Strategy: validation

Validate before calling

require(!config.isSetSessionTimeoutMillis || config.sessionTimeoutMillis > 0)

Try / catch

catch { case e: ConfigFailure => point operators at the endpoint's session_timeout_millis value }

Prevention

When it happens

Trigger: Adding a thrift endpoint with session_timeout_millis: 0 or a negative number in config or in the addThriftEndpoint call.

Common situations: Copy-pasted config with a 0 placeholder meant to mean 'default'; arithmetic computing the timeout that underflows to 0/negative.

Understand the failure class

Related errors


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