Inventory Solution failing to upgrade. Failed to install product. Access to the path 'AeXAgentDiagnostics.dll' is denied.
search cancel

Inventory Solution failing to upgrade. Failed to install product. Access to the path 'AeXAgentDiagnostics.dll' is denied.

book

Article ID: 196261

calendar_today

Updated On:

Products

Inventory Solution

Issue/Introduction

The customer is upgrading from CMS 8.5 RU2 to RU4.

Inventory Solution is failing to upgrade. 

The logs show the following errors while trying to configure Inventory:

Entry 1:

Failed to install product.

Access to the path 'AeXAgentDiagnostics.dll' is denied.
[System.UnauthorizedAccessException @ mscorlib]
at System.IO.Directory.DeleteHelper(String fullPath, String userPath, Boolean recursive, Boolean throwOnTopLevelDirectoryNotFound, WIN32_FIND_DATA& data)
at System.IO.Directory.Delete(String fullPath, String userPath, Boolean recursive, Boolean checkHost)
at Altiris.Inventory.InventoryInstallation.CopyPlatformFilesX(String platform)
at Altiris.Inventory.InventoryInstallation.OnInstallProduct(XmlNode installationNode)
at Altiris.NS.StandardItems.Product.ProductInstallation.InstallProduct()

Exception logged from:
at Altiris.NS.StandardItems.Product.ProductInstallation.InstallProduct()
at Altiris.NS.Installation.ProductConfigurationWorker.ConfigureProductInternal(String, Boolean, Altiris.NS.Serialization.SerializationMode)
at Altiris.NS.Installation.ProductConfigurationWorker.ConfigureProduct()
at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, Object, Boolean)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, Object, Boolean)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, Object)
at System.Threading.ThreadHelper.ThreadStart()

-----------------------------------------------------------------------------------------------------
Date: 7/22/2020 12:17:14 PM, Tick Count: 17037125 (04:43:57.1250000),Size: 1.74 KB
Process: AeXSvc (12804), Thread ID: 25, Module: Altiris.NS.StandardItems.dll
Priority: 1, Source: Altiris.NS.StandardItems.Product.ProductInstallation.InstallProduct

Entry 2:

Failed to install the product from the file: C:\Program Files\Altiris\Inventory\Config\Inventory.config

Access to the path 'AeXAgentDiagnostics.dll' is denied.
[System.UnauthorizedAccessException @ mscorlib]
at System.IO.Directory.DeleteHelper(String fullPath, String userPath, Boolean recursive, Boolean throwOnTopLevelDirectoryNotFound, WIN32_FIND_DATA& data)
at System.IO.Directory.Delete(String fullPath, String userPath, Boolean recursive, Boolean checkHost)
at Altiris.Inventory.InventoryInstallation.CopyPlatformFilesX(String platform)
at Altiris.Inventory.InventoryInstallation.OnInstallProduct(XmlNode installationNode)
at Altiris.NS.StandardItems.Product.ProductInstallation.InstallProduct()
at Altiris.NS.Installation.ProductConfigurationWorker.ConfigureProductInternal(String configFile, Boolean ownsProgressContext, SerializationMode serializationMode)

Exception logged from:
at Altiris.NS.Installation.ProductConfigurationWorker.ConfigureProductInternal(String, Boolean, Altiris.NS.Serialization.SerializationMode)
at Altiris.NS.Installation.ProductConfigurationWorker.ConfigureProduct()
at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, Object, Boolean)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, Object, Boolean)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, Object)
at System.Threading.ThreadHelper.ThreadStart()

-----------------------------------------------------------------------------------------------------
Date: 7/22/2020 12:17:14 PM, Tick Count: 17037218 (04:43:57.2180000), Size: 1.90 KB
Process: AeXSvc (12804), Thread ID: 25, Module: Altiris.NS.dll
Priority: 1, Source: Altiris.NS.Installation.ProductConfigurationWorker.ConfigureProductInternal

Entry 3:

Failed to configure: C:\Program Files\Altiris\Inventory\Config\Inventory.config

Access to the path 'AeXAgentDiagnostics.dll' is denied.
[System.UnauthorizedAccessException @ mscorlib]
at System.IO.Directory.DeleteHelper(String fullPath, String userPath, Boolean recursive, Boolean throwOnTopLevelDirectoryNotFound, WIN32_FIND_DATA& data)
at System.IO.Directory.Delete(String fullPath, String userPath, Boolean recursive, Boolean checkHost)
at Altiris.Inventory.InventoryInstallation.CopyPlatformFilesX(String platform)
at Altiris.Inventory.InventoryInstallation.OnInstallProduct(XmlNode installationNode)
at Altiris.NS.StandardItems.Product.ProductInstallation.InstallProduct()
at Altiris.NS.Installation.ProductConfigurationWorker.ConfigureProductInternal(String configFile, Boolean ownsProgressContext, SerializationMode serializationMode)
at Altiris.NS.Installation.ProductConfigurationWorker.ConfigureProduct()

Exception logged from:
at Altiris.NS.Installation.ProductConfigurationWorker.ConfigureProduct()
at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, Object, Boolean)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, Object, Boolean)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, Object)
at System.Threading.ThreadHelper.ThreadStart()

-----------------------------------------------------------------------------------------------------
Date: 7/22/2020 12:17:14 PM, Tick Count: 17037218 (04:43:57.2180000), Size: 1.80 KB
Process: AeXSvc (12804), Thread ID: 25, Module: Altiris.NS.dll
Priority: 1, Source: Altiris.NS.Installation.ProductConfigurationWorker.ConfigureProduct

 

Similar errors can be also seen:

Failed to configure: D:\Program Files\Altiris\Inventory\Config\Inventory.config
The directory is not empty.

Failed to install the product from the file: D:\Program Files\Altiris\Inventory\Config\Inventory.config
The directory is not empty.

Environment

ITMS 8.x

Cause

The problem appears when we try to delete temporary files/folder under User's temporary folder (created to store extracted SMA agent binaries).  We extract the content of aexnsc.exe (aexnsc.exe /extract:"<path_to_temp_folder>" in order to collect some binaries that are required for Standalone package, then we just delete created temporary folder.

However, it looks that something does not allow to delete at least one of the extracted files  'AeXAgentDiagnostics.dll'. Theoretically such "not deleted" files should remain under the User's temporary folder (just search AeXAgentDiagnostics.dll under user's temporary folder).

There was a permission issue on the "C:\Users\<AppIDaccount>\AppData\Local\Temp" and some hidden files on that directory. The customer added full control to their AppID account to the Temp folder and that solved the issue.

Resolution

This issue should be addressed with our ITMS 8.6 Release. 
We have fixes for this issue that were included in ITMS 8.6. In 8.6, it will throw a warning when it cannot remove this folder and indicate which folder/file was the one causing the issue. Something like this:
Warning is now displayed like "Failed to delete temporary directory 'C:\Users\Administrator\AppData\Local\Temp\uyiueoep.bou': Access to the path 'AeXAgentDiagnostics.dll' is denied."

 

Prior to ITMS 8.6:

Find out if there is another process (like anti-virus, real-time scanner, etc) that could be preventing for deleting the temporary files or if you need to grant more permissions to the Account that you are using to install/upgrade.

In order to verify what could be causing the "Access Denied" (it seems that something does not allow to delete files exactly when our code tries to do it), try the following:

  1. In order to see what really happens with files, capture file operations using Process Monitor tool (https://docs.microsoft.com/en-us/sysinternals/downloads/procmon).
  2. Configure tool to monitor only temp folder where problematic files are located. For example:



  3. Start it before reproducing the issue and stop capturing as soon as it is reproduced.

    See what is missing for example in regard to permissions for the account that you are using (you could add Full Control to the account used to install/upgrade) or if something is blocking the access to the Temp folder.