Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

[Bug] sbin/replace-conf-from-env.sh word-splits the whole environment and corrupts iotdb-system.properties

オープン 初心者向け
#18,655 コメント 0 件 リアクション 1 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
82/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
shell
領域
devops

調査の方向性

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.0 reliably applied, so the DataNode binds 0.0.0.0 and 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 and grep: Unmatched [ errors).
  • The trailing _=/usr/bin/env line shows the internal-var guard is dead (see "Anything else?").
  • The sed line math shifted by the junk, dropping the dn_rpc_address override so the DataNode fell back to the packaged default 127.0.0.1 and bound loopback-only.
  • Nondeterministic output: the same intended config produces different files depending on unrelated env values (and even env ordering).
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 2w typo 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

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

apache/iotdb のほかの issue

apache/iotdb の issue をすべて見る

似ている issue

Java の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。