Falha ao Aplicar atualizações do Windows [HRESULT = 0x800f0831 – CBS_E_STORE_CORRUPTION]

 

Resultado de imagem para 0x800f0831 update22

Olá Pessoal

Recentemente, trabalhei em uma situação onde durante a aplicação de atualizações do Windows ocorria falha, retornando o erro abaixo no arquivo c:\windows\Windowsupdate.log:

2017-05-02 13:50:24:608 7632 1d8c Handler :: START :: Handler: CBS Install

2017-05-02 13:50:24:608 7632 1d8c Handler :::::::::

2017-05-02 13:50:24:608 7632 1d8c Handler Starting install of CBS update 23E7E3D7-62C0-4FE1-BB24-60B802A301DC

2017-05-02 13:50:24:608 7632 1d8c Handler CBS session identity: 30589796_834771356

2017-05-02 13:50:24:623 7632 1d8c Handler CBS package identity: Package_for_RollupFix~31bf3856ad364e35~amd64~~9600.18654.1.4

2017-05-02 13:50:24:623 7632 1d8c Handler Installing express with source=C:\Windows\SoftwareDistribution\Download\7db7e54b669c01b4827f3f07c7e62175, workingdir=C:\Windows\SoftwareDistribution\Download\7db7e54b669c01b4827f3f07c7e62175

2017-05-02 13:50:29:514 408 1ef0 Report REPORT EVENT: {8F5E0C61-2596-4322-8937-ED3A55D1A160} 2017-05-02 13:50:24:514-0300 1 181 [AGENT_INSTALLING_STARTED] 101 {DD2D22CE-79D3-4E63-9E08-6C0A794CFD99} 213 0 AutomaticUpdatesWuApp Success Content Install Installation Started: Windows has started installing the following update: April, 2017 Security Monthly Quality Rollup for Windows Server 2012 R2 (KB4015550)

2017-05-02 13:50:29:514 408 1ef0 Report CWERReporter finished handling 2 events. (00000000)

2017-05-02 13:50:57:452 7632 1dcc Handler FATAL: CBS called Error with 0x800f0831, 

2017-05-02 13:50:57:452 7632 1d8c Handler FATAL: Completed install of CBS update with type=0, requiresReboot=0, installerError=1, hr=0x800f0831

2017-05-02 13:50:57:452 408 1c48 AU >>## RESUMED ## AU: Installing update [UpdateId = {DD2D22CE-79D3-4E63-9E08-6C0A794CFD99}]

2017-05-02 13:50:57:452 408 1c48 AU # WARNING: Install failed, error = 0x800F0831 / 0x800F0831

2017-05-02 13:50:57:452 7632 1d8c Handler :::::::::

2017-05-02 13:50:57:452 7632 1d8c Handler :: END :: Handler: CBS Install

 

Traduzindo o erro 0x800F0831 utilizando a ferramenta ERR.EXE:

Err.exe   800f0831

# for hex 0x800f0831 / decimal -2146498511

CBS_E_STORE_CORRUPTION                                         cbsapi.h

# CBS store is corrupted.

# 1 matches found for “800f0831”

Partimos então para análise do arquivo c:\windows\logs\CBS.LOG, e identificamos o erro a seguir:

2017-05-02 14:45:44, Info                  CBS    Store corruption, manifest missing for package: Package_333_for_KB3197874~31bf3856ad364e35~amd64~~6.3.1.5

2017-05-02 14:45:44, Error                 CBS    Failed to resolve package 'Package_333_for_KB3197874~31bf3856ad364e35~amd64~~6.3.1.5' [HRESULT = 0x800f0831 - CBS_E_STORE_CORRUPTION]

2017-05-02 14:45:44, Info                  CBS    Mark store corruption flag because of package: Package_333_for_KB3197874~31bf3856ad364e35~amd64~~6.3.1.5. [HRESULT = 0x800f0831 - CBS_E_STORE_CORRUPTION]

2017-05-02 14:45:44, Info                  CBS    Failed to resolve package [HRESULT = 0x800f0831 - CBS_E_STORE_CORRUPTION]

2017-05-02 14:45:44, Info                  CBS    Failed to get next package to re-evaluate [HRESULT = 0x800f0831 - CBS_E_STORE_CORRUPTION]

2017-05-02 14:45:44, Info                  CBS    Failed to process component watch list. [HRESULT = 0x800f0831 - CBS_E_STORE_CORRUPTION]

2017-05-02 14:45:44, Info                  CBS    Perf: InstallUninstallChain complete.

2017-05-02 14:45:44, Info                  CSI    000001fc@2017/5/2:17:45:44.967 CSI Transaction @0x9eff36b4a0 destroyed

2017-05-02 14:45:44, Info                  CBS    Exec: Store corruption found during execution, attempting auto repair.

2017-05-02 14:45:44, Info                  CBS    Exec: Automatic repair feasibility evaluation:

2017-05-02 14:45:44, Info                  CBS    Exec: Network Cost API is not available on this SKU, continue.

2017-05-02 14:45:44, Info                  CBS    Exec: Network detected as Unknown, continue

2017-05-02 14:45:44, Info                  CBS    Exec: Windows Update Auto Update option not available, not using WU to download

2017-05-02 14:45:44, Info                  CBS    Exec: Installation fails with store corruption, but there is no local source available and WU download cannot be used, skip repair.

2017-05-02 14:45:44, Info                  CBS    Failed to execute execution chain. [HRESULT = 0x800f0831 - CBS_E_STORE_CORRUPTION]

2017-05-02 14:45:44, Error                 CBS    Failed to process single phase execution. [HRESULT = 0x800f0831 - CBS_E_STORE_CORRUPTION]

2017-05-02 14:45:44, Info                  CBS    WER: Generating failure report for package: Package_for_RollupFix~31bf3856ad364e35~amd64~~9600.18654.1.4, status: 0x800f0831, failure source: Execute, start state: Staged, target state: Installed, client id: WindowsUpdateAgent


Ficou claro aqui a corrupção de um payload dentro da CBS Store.

 

Para cenários de corrupção, o mais indicado é realizar uma verificação completa da Store utilizando os comandos abaixo:

DISM /ONLINE /CLEANUP-IMAGE /SCANHEALTH

Este comando irá validar se a imagem do SO está corrompida. No meu caso, este foi o retorno identificado no arquivo CBS.LOG:


=================================

Checking System Update Readiness.

(p) CSI Payload Corrupt   amd64_netfx-system.security_b03f5f7f11d50a3a_6.3.9600.20708_none_616013fdbb13cd58\System.Security.dll

(p) CSI Payload Corrupt   msil_system.security_b03f5f7f11d50a3a_6.3.9600.20708_none_a03e42a8abfb8fdd\System.Security.dll

Summary:

Operation: Detect only

Operation result: 0x0

Last Successful Step: CSI store detection completes.

Total Detected Corruption: 2

 CBS Manifest Corruption: 0

 CBS Metadata Corruption: 0

 CSI Manifest Corruption: 0

 CSI Metadata Corruption: 0

 CSI Payload Corruption: 2

Total Repaired Corruption: 0

 CBS Manifest Repaired: 0

 CSI Manifest Repaired: 0

 CSI Payload Repaired: 0

 CSI Store Metadata refreshed: True

Realizei então uma reparação utilizando o comando abaixo:

DISM /ONLINE /CLEANUP-IMAGE /RESTOREHEALTH

Infelizmente não obtive sucesso na solução, conforme pode ser visto no CBS.log:

2017-05-03 15:55:56, Info                  CBS    SQM: CheckSur: hrStatus: 0x800f0906 [CBS_E_DOWNLOAD_FAILURE], download Result: 0x800f0940 [CBS_E_WUSUS_MAPPING_UNAVAILABLE]

2017-05-03 15:55:56, Info                  CBS    Count of times corruption detected: 1

2017-05-03 15:55:56, Info                  CBS    Seconds between initial corruption detections: -1

2017-05-03 15:55:56, Info                  CBS    Seconds between corruption and repair: -1

2017-05-03 15:55:57, Info                  CBS    IOCTL_STORAGE_QUERY_PROPERTY query failed

2017-05-03 15:55:57, Info                  CBS    SQM: Upload requested for report: CheckSurSqm, session id: 142858, sample type: Standard

2017-05-03 15:55:57, Info                  CBS    SQM: Ignoring upload request because the sample type is not enabled: Standard

2017-05-03 15:55:57, Info                  CBS    Failed to run Detect and repair. [HRESULT = 0x800f0906 – CBS_E_DOWNLOAD_FAILURE]

2017-05-03 15:55:58, Info                  CBS    Reboot mark cleared

2017-05-03 15:55:58, Info                  CBS    Winlogon: Deregistering for CreateSession notifications

2017-05-03 15:55:58, Info                  CBS    Winlogon: Stopping notify server

2017-05-03 15:55:58, Info                  CBS    Winlogon: Unloading SysNotify DLL

2017-05-03 15:55:58, Info                  CBS    Exec: Processing complete, session(Corruption Repairing): 30590013_1786715622 [HRESULT = 0x800f0906 – CBS_E_DOWNLOAD_FAILURE]

2017-05-03 15:55:58, Error                 CBS    Session: 30590013_1786715622 failed to perform store corruption detect and repair operation. [HRESULT = 0x800f0906 – CBS_E_DOWNLOAD_FAILURE]

2017-05-03 15:55:58, Info                  CBS    Session: 30590013_1786715622 finalized. Download error: 0x800f0940 [CBS_E_WUSUS_MAPPING_UNAVAILABLE], Reboot required: no [HRESULT = 0x800f0906 – CBS_E_DOWNLOAD_FAILURE]

2017-05-03 15:55:58, Info                  CBS    Failed to FinalizeEx using worker session [HRESULT = 0x800f0906]

Neste ponto, o ideal é definer as expectativas corretamente, pois dependendo do nível de corrupção, não existem muitas alternativas a serem tomadas além do Inplace Upgrade ou Rebuild do servidor. Tendo isto em mente, parti para interpretação do problema, para definição de novas ações.

 

  1. KB Sendo Instalado: KB4015550
  1. Erro identificado:
    2017-05-02 14:45:44, Error                 CBS    Failed to resolve package ‘Package_333_for_KB3197874~31bf3856ad364e35~amd64~~6.3.1.5’ [HRESULT = 0x800f0831 – CBS_E_STORE_CORRUPTION]
  1. KB KB3197874 é um pré requisite para o kb KB4015550

 

Resolvi então baixar o KB3197874 direto do Windows Update Catalog, e utilizei o SEVENZIP para descompactar o pacote, e ter acesso ao .cab contendo os payloads. Descompactei tambem o arquivo .cab, exportando todos os payloads para um diretório temporario.

 

Identifiquei então, a presença do payload original que se encontra corrompido no servidor: ‘Package_333_for_KB3197874~31bf3856ad364e35~amd64~~6.3.1.5.MUM

 

Utilizei o comando DISM para substituir este payload:

Dism.exe /Online /Add-Package /PackagePath: package: Package_333_for_KB3197874~31bf3856ad364e35~amd64~~6.3.1.5.MUM

 

Deployment Image Servicing and Management tool

Version: 6.3.9600.17031




Image Version: 6.3.9600.17031




Processing 1 of 1 - Adding package Package_333_for_KB3197874~31bf3856a

d64~~6.3.1.5

[==========================100.0%==========================]

The operation completed successfully.

Restart Windows to complete this operation.

Do you want to restart the computer now? (Y/N) Y

 

 

Após o restart, a atualização pode ser instalada sem problemas! Neste caso ocorreu a corrupção de um único payload, após sua substituição, tudo voltou a funcionar!

 

Para a substituição de todos os componentes do KB, podemos também indicar o .CAB na sintaxe do comando.

 

 

Espero ter ajudado!

Marcado com , ,

Deixe uma resposta

%d blogueiros gostam disto: