Agent Upgrade Fails with Fatal Error During Installation - There was an error creating a temporary file
search cancel

Agent Upgrade Fails with Fatal Error During Installation - There was an error creating a temporary file

book

Article ID: 286492

calendar_today

Updated On:

Products

Carbon Black App Control (formerly Cb Protection)

Issue/Introduction

  • An upgrade of the Agent fails with the error:
    Agent upgrade: Failed executing Installer[C:\ProgramData\Bit9\Parity Agent\ParityHostAgent.msi] Cmdline[/qN /i "C:\ProgramData\Bit9\Parity Agent\ParityHostAgent.msi" /l*v+ "\\?\globalroot\device\harddiskvolume2\programdata\bit9\parity agent\logs\ParityHostAgentInstall_2023-04-27_10-09-43.log"]. Fatal error during installation.
  • Upgrade log shows:
    Warning: Local cached package 'C:\Windows\Installer\d767960.msi' is missing.
    ....
    Move a existing file failed: 3.
    Error 1336.There was an error creating a temporary file that is needed to complete this installation. Folder: C:\Program Files (x86)\Bit9\Parity Agent\. System error code: 5

Environment

  • App Control Agent: All Supported Versions
  • Microsoft Windows: All Supported Versions

Cause

The expected cached agent MSI file from a previous install or upgrade is missing; this can be caused by:

  • Accidental deletion -e.g. disk space cleanup
  • Third party tools like SCCM or Intune not caching the MSI files used during for deployment

Typically, such files are cached by the Windows installer in "C:\Windows\Installer\" folder or, if deployed via SCCM in the "C:\Windows\Ccmcache" folder.

If the previous cached MSI was removed, on the next agent upgrade attempt, the Windows Installer only partially removes the previous agent which will result in a corruption and inability to upgrade successfully going forward. 

Resolution

  1. Open the Agent Install log from the unsuccessful upgrade attempt, and locate the line:
    • Warning: Local cached package 'C:\Windows\Installer\d767960.msi' is missing.
  2. Alternatevely, find the name of the cached .msi file via PowerShell:
    $loc = Get-ChildItem -Recurse HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Products\
    $loc | ForEach-Object { Get-ItemProperty $_.PsPath } | Where LocalPackage -ne $null | Sort DisplayName | Select DisplayName,LocalPackage
    
    Example result:
    DisplayName                                                    LocalPackage
    -----------                                                    ------------
    Bit9 Agent                                                     C:\Windows\Installer\d767960.msi
    
  3. Confirm the relevant file does not exist in "C:\Windows\Installer"
  4. Obtain a copy of ParityHostAgent.msi that matches the version of the agent currently installed:
  5. Rename ParityHostAgent.msi to match the name of the cached msi file (for example: "d767960.msi")
  6. Place the renamed file into "C:\windows\Installer"
  7. Attempt the upgrade again

Additional Information

Future Agent Upgrades can fail due to the presence of leftover Registry Keys.