[Bug] sbin/replace-conf-from-env.sh word-splits the whole environment and corrupts iotdb-system.properties
Maintainer antworten meist innerhalb von 1 Tag
Bewertung
- Schwierigkeit
- 2/5
- Geschätzter Aufwand
- 1-3 Stunden
- Anfängerfreundlichkeit
- 82/100
Rechercherichtung
Lies sbin/replace-conf-from-env.sh um die Zeilen 56–58 herum, führe dann die bereitgestellte docker-Reproduktion aus und prüfe das Ende von conf/iotdb-system.properties. Die Behebung ist abgeschlossen, wenn Umgebungswerte mit mehreren Wörtern nicht in unbrauchbare Zeilen aufgeteilt werden, interne Variablen übersprungen werden und dn_rpc_address=0.0.0.0 zuverlässig angewendet bleibt.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
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!
- Vorherrschende Sprache
- Java
- Sterne
- 6.4k
- Forks
- 1.2k
- Ø Merge
- 1 T. 11 Std.
- Gemergte PRs (30 T.)
- 149
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus apache/iotdb
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 65/100
Maintainer antworten meist innerhalb von 1 Tag
-
IoTDB Edge: stop-edge.sh does not stop its own process when IOTDB_HOME is set, and reports successEvtl. vergeben @PDGGK hat das vor 35 Tagen übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
Maintainer antworten meist innerhalb von 1 Tag
-
[Bug] findColumn throws NullPointerException instead of SQLException for an unknown column nameEvtl. vergeben @PDGGK hat das vor 77 Tagen übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
Maintainer antworten meist innerhalb von 1 Tag
-
[Bug] ResultSetMetaData.getCatalogName throws IndexOutOfBoundsException instead of SQLException for out-of-range columnsEvtl. vergeben @PDGGK hat das vor 78 Tagen übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
Maintainer antworten meist innerhalb von 1 Tag
Ähnliche Issues
-
new feature
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 62/100
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
apache/rocketmq-dashboard#5594 ·
Maintainer antworten meist innerhalb von 3 Tagen
-
bug pkg:sdk
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
aws/aws-durable-execution-sdk-java#773 ·
Maintainer antworten meist innerhalb von 1 Tag
-
[C#]:主页联网更新的提示投稿横幅指向错误Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
PCL-Community/PCL-CE#3652 ·
Maintainer antworten meist innerhalb von 1 Tag
-
TaskSecret.vue: replace explicit `any` with real typesEvtl. vergeben @prayas-bit hat das heute übernommen. Offenarea/frontend good first issue kind/cooldown
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
kestra-io/kestra#20352 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag