console icon indicating copy to clipboard operation
console copied to clipboard

Yaml parsing fails on comma in any property (also password)

Open ThimoTollmien1002 opened this issue 2 years ago • 1 comments

Hello,

when trying to run the container with a randomly generated password we came across an issue with commas. If a comma exists in the username or password (probably in any property) it gets parsed as a list. We are not sure wether this is an issue of the console docker container when it generates the yaml configuration or the redpanda backend as such.

We can reproduce the problem with the following run command:

docker run -i --rm -p 8080:8080 \ 
    -e KAFKA_BROKERS="localhost:9096" \
    -e KAFKA_TLS_ENABLED=true \
    -e KAFKA_SASL_ENABLED=true \
    -e KAFKA_SASL_USERNAME="abc,test" \
    -e KAFKA_SASL_PASSWORD="password,test2" \
    -e KAFKA_SASL_MECHANISM="SCRAM-SHA-512" \
    -e SERVER_BASEPATH="test-local" \
    -e SERVER_SETBASEPATHFROMXFORWARDEDPREFIX=true \
    -e SERVER_STRIPPREFIX=true \
    "vectorized/console:v2.2.5"
{"level":"info","msg":"config filepath is not set, proceeding with options set from env variables and flags"}
{"level":"fatal","msg":"failed to load yaml config","error":"2 error(s) decoding:\n\n* 'kafka.sasl.password' expected type 'string', got unconvertible type '[]string', value: '[password test2]'\n* 'kafka.sasl.username' expected type 'string', got unconvertible type '[]string', value: '[abc test]'"}

We would expect that any special character is accepted in passwords (or any property).

Thank you!

Regards, Thimo

ThimoTollmien1002 avatar Jul 13 '23 11:07 ThimoTollmien1002

Hey Thimo, indeed this is expected so that users can provide a list of values (e.g. for seedbrokers). You are right, that this should only be the case for properties that have a slice defined in the config struct.

weeco avatar Jul 13 '23 12:07 weeco