[Bug] sbin/replace-conf-from-env.sh word-splits the whole environment and corrupts iotdb-system.properties
まだ誰も着手していません。
評価
調査の方向性
sbin/replace-conf-from-env.sh の56〜58行付近を読み、次に提供されている docker の再現手順を実行して、conf/iotdb-system.properties の末尾を確認してください。複数の単語からなる環境値が不要な行に分割されず、内部変数がスキップされ、dn_rpc_address=0.0.0.0 が確実に適用されたままになれば、修正は完了です。
索引モデルが issue の本文から書いたものです。
説明
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!
- 主要言語
- Java
- スター
- 6.4k
- フォーク
- 1.2k
- 平均マージ
- 1日 8時間
- マージ済み PR(30日)
- 129
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
apache/iotdb のほかの issue
-
IoTDB Edge: stop-edge.sh does not stop its own process when IOTDB_HOME is set, and reports success オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
[Bug] findColumn throws NullPointerException instead of SQLException for an unknown column name オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
似ている issue
-
bug untriaged
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
opensearch-project/ml-commons#5094 ·
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
-
emitter:client:csharp feature
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
-
affects/8.10 affects/8.9 component/clients kind/bug likelihood/mid severity/mid
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
Two open-case totals on one screen: the Programs tile says 15,858 and the nav badge says 15,868 オープンbug frontend maui-pilot
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100