Windows Update Offload: "Fetch Windows Updates" task is killed after 72h and never restarts until reboot
@LordHepipud がすでに取り組んでいます。
2026年10月28日 から。
評価
- 難易度
- 3/5
- 見積もり時間
- 半日
- 初心者へのやさしさ
- 70/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- powershell
調査の方向性
The task is registered in lib/provider/updates/Register-IcingaWindowsScheduledTaskWindowsUpdates.psm1, where New-ScheduledTaskSettingsSet has no execution time limit and the only trigger is -AtStartup. The loop it starts lives in jobs\FetchWindowsUpdates.ps1. Done means the registered task has no 72-hour limit and a recurring trigger, which you can confirm with Get-ScheduledTask on a Windows host. Testing needs a Windows machine and a wait or a time-shifted check.
索引モデルが issue の本文から書いたものです。
説明
Description
When Windows Update Offload is enabled (Enable-IcingaWindowsUpdateOffload), the scheduled task
\Icinga\Icinga for Windows\Fetch Windows Updates is registered without an explicit
ExecutionTimeLimit, so Windows applies its default limit of 72 hours.
jobs\FetchWindowsUpdates.ps1 is designed to run forever (endless loop that refreshes the cache
every 10 minutes). After 72 hours the Task Scheduler terminates the process, and since the task
only has an At startup trigger, it is never started again until the next reboot.
From then on the cache file is no longer refreshed and Invoke-IcingaCheckUpdates goes
WARNING/CRITICAL on every host, e.g.:
Last Update Check: Value 5.98h is greater than threshold 30m
In our environment this happened on all Windows hosts at the same time.
Steps to reproduce
- Run
Enable-IcingaWindowsUpdateOffload - Wait more than 72 hours without rebooting the host
- The task is in state
Ready(notRunning) and theLast Update Checkof
Invoke-IcingaCheckUpdatesexceeds the 20m/30m thresholds
Evidence
PS> $t = Get-ScheduledTask -TaskName 'Fetch Windows Updates' -TaskPath '\Icinga\Icinga for Windows\'
PS> $t.Settings.ExecutionTimeLimit
PT72H
PS> $t.Triggers | Select-Object CimClass
Root/Microsoft/Windows/TaskScheduler:MSFT_TaskBootTrigger
Starting the task manually (Start-ScheduledTask) fixes the check until the next 72h limit is hit.
Cause
In lib/provider/updates/Register-IcingaWindowsScheduledTaskWindowsUpdates.psm1:
$TaskSettings = New-ScheduledTaskSettingsSet -DontStopIfGoingOnBatteries -AllowStartIfOnBatteries -StartWhenAvailable;
No -ExecutionTimeLimit is passed, so the Windows default (PT72H) is used, and the only trigger is
New-ScheduledTaskTrigger -AtStartup.
Suggested fix
Disable the execution time limit and add a recurring trigger, so the job is restarted if it ever
stops for any reason (IgnoreNew prevents parallel instances while it is running):
$TaskSettings = New-ScheduledTaskSettingsSet -DontStopIfGoingOnBatteries -AllowStartIfOnBatteries -StartWhenAvailable `
-ExecutionTimeLimit (New-TimeSpan -Seconds 0) -MultipleInstances IgnoreNew;
$TaskTrigger = @(
(New-ScheduledTaskTrigger -AtStartup),
(New-ScheduledTaskTrigger -Once -At (Get-Date).Date -RepetitionInterval (New-TimeSpan -Minutes 30) -RepetitionDuration (New-TimeSpan -Days 3650))
);
Workaround
Patch the existing task (we enforce this via Puppet):
$t = Get-ScheduledTask -TaskName 'Fetch Windows Updates' -TaskPath '\Icinga\Icinga for Windows\'
Set-ScheduledTask -TaskName $t.TaskName -TaskPath $t.TaskPath `
-Settings (New-ScheduledTaskSettingsSet -DontStopIfGoingOnBatteries -AllowStartIfOnBatteries -StartWhenAvailable -ExecutionTimeLimit (New-TimeSpan -Seconds 0) -MultipleInstances IgnoreNew) `
-Trigger @((New-ScheduledTaskTrigger -AtStartup), (New-ScheduledTaskTrigger -Once -At (Get-Date).Date -RepetitionInterval (New-TimeSpan -Minutes 30) -RepetitionDuration (New-TimeSpan -Days 3650)))
Start-ScheduledTask -TaskName $t.TaskName -TaskPath $t.TaskPath
Environment
- Icinga PowerShell Framework: 1.16.0
- Icinga PowerShell Plugins: 1.16.1
- Icinga 2 agent: 2.14.10
- OS: [p. ex. Windows Server 2022]
- Icinga 2 service user: NT AUTHORITY\NetworkService (reason for using the offload feature)
- 主要言語
- PowerShell
- スター
- 86
- フォーク
- 34
- 平均マージ
- 14分
- マージ済み PR(30日)
- 1
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
Icinga/icinga-powershell-framework のほかの issue
-
Custom stable repo has no effect対応中かも @LordHepipud が 7 日前に担当しました。 オープンInvestigation
難易度 3/5 1〜2日 初心者へのやさしさ 52/100
Icinga/icinga-powershell-framework#888 · コメント 1 件 · 担当者 1 名 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 42/100
Icinga/icinga-powershell-framework#883 · リアクション 1 件 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 55/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
-
難易度 3/5 1〜2日 初心者へのやさしさ 55/100
Icinga/icinga-powershell-framework の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
-
tsuru_app_cname and tsuru_app_router don't handle removal outside terraform対応中かも @lbarrosby が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
-
難易度 1/5 1時間未満 初心者へのやさしさ 72/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
fairagro/m4.2_infrastructure#68 · コメント 3 件 ·
メンテナーはふだん 1 日以内に返信