Description
Since we use URL-safe base64 encoded Uuid's for cluster ID, it is possible for dash ("-") characters to be present in the ID string. When a cluster ID has a leading dash, we can run into problems when running the Kafka bash scripts.
For example, if the ID "-Xflm1nKSfOK8QGt_AXhxw" is generated with "random-uuid" sub-command of kafka-storage.sh, we would then normally format the log directories like:
./bin/kafka-storage.sh format --config ./config/kraft/controller.properties \ --cluster-id -Xflm1nKSfOK8QGt_AXhxw
This will not parse correctly as the argument parsing library will treat the cluster ID as an argument. It leads to the following error:
usage: kafka-storage format [-h] --config CONFIG --cluster-id CLUSTER_ID [--ignore-formatted] kafka-storage: error: argument --cluster-id/-t: expected one argument
This can be worked around by putting the ID in quotes, or by using an "=" between the "--cluster-id" and the Uuid.
We can solve this going forward by not generating random Uuid's that contain a leading dash.
Attachments
Issue Links
- links to