[
https://issues.apache.org/jira/browse/KAFKA-3417?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15201387#comment-15201387
]
Byron Ruth commented on KAFKA-3417:
-----------------------------------
Looking at the source a bit more, the `group.id` appears to be restricted to
same character set as `client.id`, but group ids with invalid characters are
being permitted. For example:
{code}
./kafka-console-consumer --new-consumer --consumer.config consumer.properties
--topic foo --bootstrap-server 192.168.99.100:9092
foobar
^CProcessed a total of 1 messages
{code}
where `consumer.properties` contains:
{code}
group.id=foo:bar
{code}
The logs appear to have accepts that `group.id`:
{code}
[2016-03-18 11:59:15,859] INFO [GroupCoordinator 0]: Preparing to restabilize
group foo:bar with old generation 0 (kafka.coordinator.GroupCoordinator)
[2016-03-18 11:59:15,875] INFO [GroupCoordinator 0]: Stabilized group foo:bar
generation 1 (kafka.coordinator.GroupCoordinator)
[2016-03-18 11:59:15,905] INFO [GroupCoordinator 0]: Assignment received from
leader for group foo:bar for generation 1 (kafka.coordinator.GroupCoordinator)
[2016-03-18 12:02:29,094] INFO [GroupCoordinator 0]: Preparing to restabilize
group foo:bar with old generation 1 (kafka.coordinator.GroupCoordinator)
[2016-03-18 12:02:29,106] INFO [GroupCoordinator 0]: Group foo:bar generation 1
is dead and removed (kafka.coordinator.GroupCoordinator)
{code}
> Invalid characters in config properties not being validated?
> ------------------------------------------------------------
>
> Key: KAFKA-3417
> URL: https://issues.apache.org/jira/browse/KAFKA-3417
> Project: Kafka
> Issue Type: Bug
> Components: config
> Affects Versions: 0.9.0.1
> Reporter: Byron Ruth
> Priority: Minor
>
> I ran into an error using a {{client.id}} with invalid characters (per the
> [config
> validator|https://github.com/apache/kafka/blob/trunk/core/src/main/scala/kafka/common/Config.scala#L25-L35]).
> 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|https://github.com/apache/kafka/blob/977ebbe9bafb6c1a6e1be69620f745712118fe80/clients/src/main/java/org/apache/kafka/common/metrics/Metrics.java#L380].
> The stacktrace is:
> {code:title=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)
> ...
> {code}
> Assuming the cause os related to the invalid characters, when the request
> header is decoded, the {{clientId}} should be validated prior to being used?
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)