Report failed upgrades with a non-zero exit status (mintupdate-cli, mint-refresh-cache, automatic upgrades)
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 76/100
調査の方向性
issue に記載された 3 つのエントリーポイントから始めます。usr/lib/linuxmint/mintUpdate/mintupdate-cli.py、mint-refresh-cache、system_automatic_upgrades.py それぞれについて、サブプロセスの結果とエラー分岐の処理を追います。次に、これらのコマンドを対象とする既存のテストがあるか確認します。失敗時にゼロ以外のステータスを返し、自動アップグレードが失敗をログに記録し、成功時は現在の動作を維持すれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Is your feature request related to a problem? Please describe.
When an upgrade or a cache refresh fails, every entry point still reports success, so the failure is invisible to anything that checks exit codes: cron, Ansible, scripts, systemctl --failed or fleet monitoring.
mintupdate-cli upgraderuns apt-get withsubprocess.call(arguments + packages, env=environment)(usr/lib/linuxmint/mintUpdate/mintupdate-cli.py, line 95 on master) and discards its return code.mint-refresh-cacheprints an error and exits 0 when the update fails or when it is run without root.system_automatic_upgrades.pyignores the result ofsubprocess.run(cmd, ...)(line 44) and always logs-- Automatic Upgrade completed(line 57), somintupdate-automation-upgrade.servicenever fails.
Reproduced on Linux Mint 22.2 with mintupdate 7.1.1, using a fake apt-get on PATH that exits 100:
$ PATH=/tmp/fakebin:$PATH mintupdate-cli upgrade --dry-run; echo $?
E: Could not get lock /var/lib/dpkg/lock-frontend (simulated)
0
$ mint-refresh-cache; echo $?
Error: mint-refresh-cache requires admin privileges
0
Related: #1097 (a failed scheduled cache refresh goes unnoticed) and #1043 (automatic updates silently not installing).
Describe the solution you'd like
Propagate the failure:
mintupdate-cli:sys.exit(subprocess.call(...))so apt-get's status is returned.mint-refresh-cache:sys.exit(1)in the error branches.system_automatic_upgrades.py: check the return code, log-- Automatic Upgrade failed (exit N)and exit non-zero so the systemd unit is marked failed.
Successful runs behave exactly as today.
Describe alternatives you've considered
Parsing the log in /var/log/mintupdate.log, which is fragile and only works on machines someone is watching.
Additional context
Happy to send a pull request if this direction is acceptable.
- 主要言語
- Python
- スター
- 424
- フォーク
- 191
- 平均マージ
- 23日 14時間
- マージ済み PR(30日)
- 1
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
linuxmint/mintupdate のほかの issue
-
BUG
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
linuxmint/mintupdate#1089 · コメント 1 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
linuxmint/mintupdate#1041 · コメント 1 件 ·
-
FEATURE REQUEST
難易度 1/5 1時間未満 初心者へのやさしさ 65/100
linuxmint/mintupdate#910 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 65/100
linuxmint/mintupdate#903 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
linuxmint/mintupdate#1102 ·
linuxmint/mintupdate の issue をすべて見る
似ている issue
-
bug P1
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
Toloka/tolokaforge#1947 ·
メンテナーはふだん 1 日以内に返信
-
SageMaker provider: streaming fails with NoStreamDataError on DJL Serving (LMI) endpoints対応中かも @balajiaru が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
UKGovernmentBEIS/inspect_ai#6127 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 67/100
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
letsencrypt/cp-cps#361 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100