xai-org/x-algorithm · error · ConfigFailure

unknown value class ${config.valueThriftClass}

Error message

unknown value class ${config.valueThriftClass}

What it means

ConfigFailure thrown by KafkaProducerConfigs.addKafkaProducer when class loading/validation of the value class throws an UncheckedExecutionException — i.e. the class named by config.valueThriftClass could not be loaded at all (vs. 789 where it loads but is the wrong type).

Source

Thrown at botmaker/botmaker_eventbus/src/main/scala/com/twitter/botmaker/runtime/config/KafkaProducerConfigs.scala:58

      !Strings.isNullOrEmpty(config.topicName),
      s"topicName has to be configured in KafkaProducer ${config.funcName}"
    )

    validate(
      !Strings.isNullOrEmpty(config.dest),
      s"dest has to be configured in KafkaProducer ${config.funcName}"
    )

    try {
      val classObject = ClassCache.forName(config.valueThriftClass)
      validate(
        (classOf[Thrift[_, _]].isAssignableFrom(classObject)) || (classOf[String].isAssignableFrom(
          classObject)),
        s"The value class ${config.valueThriftClass}, is not supported"
      )
    } catch {
      case e: UncheckedExecutionException => {
        throw ConfigFailure(s"unknown value class ${config.valueThriftClass}")
      }
    }

    validateTypeName(config.keyType)

    kafkaProducers = kafkaProducers :+ config
  }

  override def debug(dbg: RuntimeDebugger): Unit = {
    super.debug(dbg)

    dbg.open("kafkaProducers", kafkaProducers) foreach { d =>
      kafkaProducers foreach { eb => d.info(eb.funcName, eb.toString) }
    }
  }

  override def compilerBuilder[E <: ServiceContainer: ClassTag]: CompilerBuilder[E] = {
    val builder = super.compilerBuilder[E]

View on GitHub (pinned to 24c60942c5)

Solutions

  1. Verify the fully-qualified class name is correct and the containing jar is a runtime dependency
  2. Add the missing thrift-scala artifact to the botmaker_eventbus deployment
  3. After fixing, if a different error appears (789), the class loads but is not Thrift/String — replace it

Example fix

# before
value_thrift_class: "com.acme.thriftscala.MissingEvent"
# after (add dep + correct name)
value_thrift_class: "com.acme.events.thriftscala.MissingEvent"
Defensive patterns

Strategy: validation

Validate before calling

try ClassCache.forName(config.valueThriftClass)
catch { case e: Exception => throw new ConfigFailure(s"cannot load ${config.valueThriftClass}") }

Try / catch

catch { case e: ConfigFailure => log classpath and dependency tree (sbt evicted/coursier) }

Prevention

When it happens

Trigger: value_thrift_class set to a class name that fails to load: typo in FQCN, missing jar dependency, wrong package, or class only present in another artifact version.

Common situations: Missing generated thrift-scala artifact on the classpath; renamed/moved Thrift classes between versions; fat-jar shading dropping the class.

Related errors


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