Uploaded image for project: 'Kafka'
  1. Kafka
  2. KAFKA-3417

Invalid characters in config properties not being validated?

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 0.9.0.1
    • 2.0.0
    • config
    • None

    Description

      I ran into an error using a client.id with invalid characters (per the config validator). I was able to get that exact error using the kafka-console-consumer script, presumably because I supplied a consumer properties file and it validated prior to hitting the server. However, when I use a client library (sarama for Go in this case), an error in the metrics subsystem is thrown here.

      The stacktrace is:

      stack.java
      [2016-03-17 17:43:47,342] ERROR [KafkaApi-0] error when handling request Name: FetchRequest; Version: 0; CorrelationId: 2; ClientId: foo:bar; ReplicaId: -1; MaxWait: 250 ms; MinBytes: 1 bytes; RequestInfo: [foo,0] -> PartitionFetchInfo(0,32768) (kafka.server.KafkaApis)
      org.apache.kafka.common.KafkaException: Error creating mbean attribute for metricName :MetricName [name=throttle-time, group=Fetch, description=Tracking average throttle-time per client, tags={client-id=foo:bar}]
      	at org.apache.kafka.common.metrics.JmxReporter.addAttribute(JmxReporter.java:113)
      	at org.apache.kafka.common.metrics.JmxReporter.metricChange(JmxReporter.java:76)
      	at org.apache.kafka.common.metrics.Metrics.registerMetric(Metrics.java:288)
      	at org.apache.kafka.common.metrics.Sensor.add(Sensor.java:177)
      	at org.apache.kafka.common.metrics.Sensor.add(Sensor.java:162)
          ...
      

      Assuming the cause os related to the invalid characters, when the request header is decoded, the clientId should be validated prior to being used?

      Attachments

        Issue Links

          Activity

            People

              mimaison Mickael Maison
              b@devel.io Byron Ruth
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: