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 returns an error to the Console similar to:
    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.
  • The Agent Upgrade/Install Log includes errors similar to:
    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. Determine the name of the missing MSI cache using one of the following methods:
    • via Agent Install/Upgrade Log:
      1. Open the Agent Install log from the unsuccessful upgrade attempt, and search for the line:
        Warning: Local cached package
      2. Note the filename included in the line, example:
        Warning: Local cached package 'C:\Windows\Installer\d767960.msi' is missing.
    • via PowerShell
      1. Launch an administrative PowerShell and issue the command:
        $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
        
      2. Note the filename included for the Bit9 Agent LocalPackage, example:
        DisplayName                                                    LocalPackage
        -----------                                                    ------------
        Bit9 Agent                                                     C:\Windows\Installer\d767960.msi
        
  2. Confirm the relevant file does not exist in "C:\Windows\Installer"
  3. Obtain a copy of ParityHostAgent.msi that matches the version of the Agent currently installed:
  4. Rename ParityHostAgent.msi to match the name of the cached MSI file (for example: "d767960.msi")
  5. Place the renamed file into "C:\Windows\Installer"
  6. Attempt the upgrade again

Additional Information

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