[Bug] sbin/replace-conf-from-env.sh word-splits the whole environment and corrupts iotdb-system.properties
Les mainteneurs répondent en général sous 1 jour
Évaluation
- Difficulté
- 2/5
- Temps estimé
- 1-3 heures
- Accessibilité débutants
- 82/100
Piste de recherche
Lisez sbin/replace-conf-from-env.sh autour des lignes 56-58, puis exécutez la reproduction docker fournie et inspectez la fin de conf/iotdb-system.properties. La correction est terminée lorsque les valeurs d’environnement comportant plusieurs mots ne sont pas découpées en lignes inutilisables, que les variables internes sont ignorées et que dn_rpc_address=0.0.0.0 reste appliqué de manière fiable.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
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!
- Langage dominant
- Java
- Étoiles
- 6.4k
- Forks
- 1.2k
- Merge moyen
- 1 j 11 h
- PR mergées (30 j)
- 149
Préparer son environnement
- Aucun Dockerfile ni fichier Docker Compose
- Propose un modèle de pull request
- Lire le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de apache/iotdb
-
Difficulté 2/5 1-3 heures Accessibilité débutants 65/100
Les mainteneurs répondent en général sous 1 jour
-
IoTDB Edge: stop-edge.sh does not stop its own process when IOTDB_HOME is set, and reports successPeut-être pris @PDGGK l’a pris il y a 37 jours. Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
Les mainteneurs répondent en général sous 1 jour
-
[Bug] 执行start-all.sh后无法启动集群问题Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
Les mainteneurs répondent en général sous 1 jour
-
[Bug] findColumn throws NullPointerException instead of SQLException for an unknown column namePeut-être pris @PDGGK l’a pris il y a 78 jours. Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
Les mainteneurs répondent en général sous 1 jour
-
[Bug] ResultSetMetaData.getCatalogName throws IndexOutOfBoundsException instead of SQLException for out-of-range columnsPeut-être pris @PDGGK l’a pris il y a 80 jours. Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
Les mainteneurs répondent en général sous 1 jour
Toutes les issues de apache/iotdb
Issues similaires
-
Clock.MakeTime fails to validate hour, minute, and second ranges due to inert Calendar.set try-catchOuverte
Difficulté 2/5 1-3 heures Accessibilité débutants 84/100
mit-cml/appinventor-sources#4139 ·
Les mainteneurs répondent en général sous 1 jour
-
[LOOTHUNT] Player Sleep % ToggleOuverte
Difficulté 2/5 1-3 heures Accessibilité débutants 62/100
Vakore/ZappierGames#81 ·
-
proposal
Difficulté 2/5 1-3 heures Accessibilité débutants 85/100
beemdevelopment/Aegis#1843 · 1 réaction ·
-
[Bug] Logo style setting missing and `classic` style not applied across multiple platforms (v3.1.0)Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 75/100
Stirling-Tools/Stirling-PDF#8382 · 1 réaction ·
Les mainteneurs répondent en général sous 2 jours
-
>enhancement needs:triage
Difficulté 2/5 1-3 heures Accessibilité débutants 70/100
elastic/elasticsearch#161191 ·
Les mainteneurs répondent en général sous 1 jour