redpanda-data / redpanda-data/console

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

Open
#762 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

backend bug
Dominant language
TypeScript
Stars
4.3k
Forks
432
Avg merge
3d 6h
Merged PRs (30d)
40

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the failure with the documented docker run command and the comma-containing KAFKA_SASL_USERNAME and KAFKA_SASL_PASSWORD values. Trace the environment-variable configuration path after the log says it is proceeding without a config file, then verify that these values remain strings rather than lists. Done means the command starts without the reported YAML decoding errors and special characters are accepted.

Written by the indexing model from the issue text.

Assessment

Tech stack
yaml
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.