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"

Solution Verified - Updated -

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$.<clinit>(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$.<clinit>(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.

Environment

  • Red Hat Streams for Apache Kafka 3.2
  • Red Hat OpenShift Container Platform, OCP 4.X

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content