[Bug] sbin/replace-conf-from-env.sh word-splits the whole environment and corrupts iotdb-system.properties
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 82/100
Línea de trabajo
Lee sbin/replace-conf-from-env.sh alrededor de las líneas 56-58, después ejecuta la reproducción proporcionada con docker e inspecciona el final de conf/iotdb-system.properties. La corrección estará terminada cuando los valores de entorno de varias palabras no se dividan en líneas basura, se omitan las variables internas y dn_rpc_address=0.0.0.0 siga aplicándose de forma fiable.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Search before asking
- I searched in the issues and found nothing similar.
Version
- IoTDB Version 2.0.11
- Containerized deployment
Describe the bug and provide the minimal reproduce step
At container startup, replace-conf-from-env.sh regenerates iotdb-system.properties from the live environment. It iterates over env unquoted (for v in $(env), ~line 56), so any variable whose value contains spaces gets word-split into individual tokens. Every lowercase token then passes the key filter and is appended as a junk line, which shifts the script's delete-line-N / append-after-N sed math and can displace or drop legitimate overrides such as dn_rpc_address.
Minimal reproduce:
docker run --rm \
-e "SOME_VAR=this is a multi word value" \
-e "dn_rpc_address=0.0.0.0" \
apache/iotdb:2.0.11-standalone
Then inspect the tail of the generated config inside the container:
tail conf/iotdb-system.properties
What did you expect to see?
- Only real config keys patched from the environment.
- Multi-word env values ignored (or handled intact), never split and appended as junk.
dn_rpc_address=0.0.0.0reliably applied, so the DataNode binds0.0.0.0and accepts network connections.
What did you see instead?
The multi-word value was split and appended to iotdb-system.properties as separate lines, one word per line:
# dn_metric_reporter_list=
dn_metric_prometheus_reporter_port=9092
is
a
multi
word
value
_=/usr/bin/env
- Multi-word env values split into word-tokens, each appended as a junk property line (log symptoms: stray
append …lines andgrep: Unmatched [errors). - The trailing
_=/usr/bin/envline shows the internal-var guard is dead (see "Anything else?"). - The
sedline math shifted by the junk, dropping thedn_rpc_addressoverride so the DataNode fell back to the packaged default127.0.0.1and bound loopback-only. - Nondeterministic output: the same intended config produces different files depending on unrelated env values (and even
envordering).
Anything else?
Second bug in the same loop: the internal-var guard ! 2w$key_name =~ ^_ (~line 58) has a 2w typo, so the "skip internal vars" check never fires (e.g. append _=/usr/bin/env).
Suggested fix:
- Iterate with
env -0+read -r -d ''(or equivalent) so values are never word-split. - Restrict patching to an allowlist of known keys (
dn_*/cn_*/wal_*). - Fix the
2wtypo in the internal-var guard.
Are you willing to submit a PR?
- I'm willing to submit a PR!
- Lenguaje dominante
- Java
- Estrellas
- 6.4k
- Forks
- 1.2k
- Merge medio
- 1 d 8 h
- PR fusionados (30 d)
- 129
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de apache/iotdb
-
IoTDB Edge: stop-edge.sh does not stop its own process when IOTDB_HOME is set, and reports success Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
-
[Bug] 执行start-all.sh后无法启动集群问题 Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
-
[Bug] findColumn throws NullPointerException instead of SQLException for an unknown column name Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Todos los issues de apache/iotdb
Issues similares
-
awaiting triage bug Causes friction Hop Gui P1 P2 Transforms
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
apache/flink-agents#1152 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
jenkinsci/blueocean-plugin#5417 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
objectionary/eo-graphs#75 ·