Kafka broker pods CrashLoopBackOff after upgrading to Streams for Apache Kafka 3.2 with custom logging configuration: “ConfigurationException: No type attribute provided for component kafka”

Issue

  • After upgrading Red Hat Streams for Apache Kafka from 3.1 to 3.2 (Kafka 4.1.0 to 4.2.0), Kafka broker pods enter CrashLoopBackOff. The pod log shows:
  Exception in thread "main" java.lang.ExceptionInInitializerError
        at kafka.tools.StorageTool$.(StorageTool.scala:40)
        at kafka.tools.StorageTool.main(StorageTool.scala)
  Caused by: org.apache.logging.log4j.core.config.ConfigurationException: No type attribute provided for component kafka
        at org.apache.logging.log4j.core.config.properties.PropertiesConfigurationBuilder.createComponent(PropertiesConfigurationBuilder.java:362)
        at org.apache.logging.log4j.core.config.properties.PropertiesConfigurationBuilder.processRemainingProperties(PropertiesConfigurationBuilder.java:206)
        ...
        at kafka.utils.Log4jControllerRegistration$.(Logging.scala:25)
  • This occurs on a Kafka CR that carries a custom logging configuration with an inline type and a loggers list, for example:
  spec:
    kafka:
      logging:
        type: inline
        loggers:
          kafka.authorizer.logger: INFO
          kafka.request.logger: INFO
          org.apache.kafka.common.security: INFO
          org.apache.kafka.metadata.authorizer: INFO
          rootLogger.level: INFO
  • The crash occurs before the Kafka broker process itself starts, the ConfigurationException is thrown while Log4j2 is still building its LoggerContext, so the broker never reaches its normal startup.

Read more here: Source link