monitoring image: dm-initializer crash-loops because /tmp/dm_worker.rules.yml is missing from the image bundle

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

メンテナーはふだん 1 日以内に返信

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

評価

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

調査の方向性

まず monitor-snapshot/release-8.5/operator/rules/ を master スナップショットと比較し、dm_worker.rules.yml がそこに欠けているかを確認します。次に cmd/Dockerfile を確認して、rules/*.rules.yml がどのように /tmp にコピーされ、init.sh がどのように dm_worker.rules.yml を Prometheus のルールパスにインストールするかを見ます。release-8.5 のイメージバンドルに DM worker ルールが含まれ、dm-initializer コンテナが 1 で終了せずに起動すれば、修正は完了です。

索引モデルが issue の本文から書いたものです。

説明

Summary

The DM branch of init.sh hard-fails with exit code 1 because /tmp/dm_worker.rules.yml is
missing from the monitoring image. As a result, the dm-initializer container in the monitor
pod crash-loops and any TidbCluster with .spec.monitor.dm enabled fails to become ready.

Observed on our HA test platform (azure-west-us-3) with monitoring/image:v8.5.9-pre
(image built ~Nov 19): testbed setup consistently fails (2/2 runs, Nov 21 and Nov 24) with:

Back-off restarting failed container dm-initializer in pod downstream-monitor-0

Root cause

  1. cmd/Dockerfile copies dashboards/*.json rules/*.rules.yml datasources/*.yaml into /tmp.
    On the release-8.5 branch, monitor-snapshot/release-8.5/operator/rules/ does not
    contain dm_worker.rules.yml (the master snapshot has it), so the image bundle lacks it.
    The file has actually been missing from images since v7.5.x (v6.5.5 still had it;
    v7.5.8 / v8.1.0 / v8.5.0 / v8.5.7 / v8.5.8 all missing).

  2. Older init.sh did cp -f /tmp/dm_worker.rules.yml ... without checking the exit code,
    so the missing file was silently tolerated (DM alert rules silently absent).

  3. The rewritten init.sh added a hard failure:

    if ! cp -f -- /tmp/dm_worker.rules.yml "$PROM_CONFIG_PATH/rules"; then
        echo "Failed to install DM alert rules" >&2
        exit 1
    fi
    
    Combined with the missing file, the DM initializer now exits 1 on every start
    -> CrashLoopBackOff -> the cluster's monitor pod never becomes ready.
    
    
    
    
主要言語
Go
スター
29
フォーク
46
平均マージ
8時間 3分
マージ済み PR(30日)
62

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

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

pingcap/monitoring のほかの issue

pingcap/monitoring の issue をすべて見る

似ている issue

Go の issue をもっと見る

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

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