Windows 10 1607 ed errore 0x80244022 durante aggiornamento tramite WSUS

L’errore 0x80244022 restituito da un client Windows durante la ricerca degli aggiornamenti tramite un server WSUS indica che il servizio WSUS non riesce a servire le richieste come indicato nella KB938205 Windows Update error code list:

“0x80244022 WU_E_PT_HTTP_STATUS_SERVICE_UNAVAIL Same as HTTP status 503 – the service is temporarily overloaded.”

Recentemente mi è successo di riscontrare tale problema con client Windows 10 1607 e WSUS installato su Windows Server 2016, analizzando il registro eventi Applicazioni sul server WSUS a conferma dell’indisponibilità del servizio WSUS erano infatti registrati gli errori 12072, 12052, 12042, 12022, 12032, 12012 e 13042 che indicano appunto l’indisponibilità dei servizi WSUS

Anche nel registro eventi di sistema risultavano una serie di errori e avvisi relativi al fatto che il pool di applicazioni WsusPool ha richiesto un riciclo perché ha raggiunto il limite di memoria dei byte privati (evento 5117) e che a causa di errori nei processi del pool di applicazioni WsusPool quest’ultimo è stato automaticamente disattivato (evento 5002).

Andando poi a controllare il pool di applicazioni WsusPool questo risultava effettivamente arrestato e anche riavviandolo dopo alcuni minuti veniva nuovamente arrestato.

La causa di questo issue, come indicato nel post ConfigMgr 2012 Support Tip: WSUS sync fails with HTTP 503 errors, può essere legato al fatto che la memoria privata del pool WsusPool impostata per default a 1843200 KB può non essere sufficiente ed occorre aumentarla per far fronte alle richieste dei client.

“If you encounter this problem, increase the Private Memory Limit to 4GB (4000000 KB) and restart the Application Pool. To increase the Private Memory Limit, select the WsusPool Application Pool and click Advanced Settings under Edit Application Pool. Then set the Private Memory Limit to 4GB (4000000 KB).

After the Application Pool has been restarted, monitor the SMS_WSUS_SYNC_MANAGER component status, wcm.log and wsyncmgr.log for failures. Please note that it may be necessary to increase the Private Memory Limit to 8GB (8000000 KB) or higher depending on the environment.”

A riguardo si veda anche il post High CPU/High Memory in WSUS following Update Tuesdays:

“Another issue that can occur is the WSUS application pool keeps recycling because it exceeds the private memory threshold (which it is very likely to do if the limit is still the default of 1843200). This recycles the app pool, and thus the cached updates, and forces WSUS to go back through retrieving updates from the database and caching them.”

Nel mio caso il WSUS era installato su una macchina virtuale in Hyper-V con 4GB di Ram statica e la memoria privata del pool WsusPool a 1843200 KB ed ho aumentato la Ram statica della VM a 6 GB e la memoria privata del pool WsusPool a 4194304 KB (4 GB).

Ho monitorato per alcune ore il server WSUS senza più rilevare errori.

Per evitare future interruzioni prolungate dei servizi WSUS è anche possibile schedulare uno script PowerShell che controlla lo stato del pool WsusPool e se arrestato lo avvia:

Start-WsusIISAppPool.ps1:

If ((Get-WebAppPoolState WsusPool).Value -ne ‘Started’)
{
Start-WebAppPool WsusPool
}

Per avviare lo script PowerShell è possibile utilizzare il seguente script DOS:

Start-WsusIISAppPool.cmd:

PowerShell -ExecutionPolicy RemoteSigned -File %~dp0Start-WsusIISAppPool.ps1

Gli script sono disponibili nel mio repository su GitHub dedicato a PowerShell al seguente link https://github.com/ermannog/PowerShell.

[Update 01]

Nel caso gli errori siano molto frequenti è anche possibile povarte ad impostare la memoria privata del pool WsusPool a 7843200 KB (7,8432 GB) e aumentare la memoria statica dedicata alla VM che ospita WSUS ad almeno 8 GB.