search cancel

Failing to update and download packages. Getting on the SMP for those packages: Keyset does not exist (Exception from HRESULT: 0x80090016)

book

Article ID: 175409

calendar_today

Updated On:

Products

IT Management Suite

Issue/Introduction

The customer noticed that new packages are not downloading on their client machines. While looking at the agent logs, we can see that the package is been downloaded but stays in a retrying cycle:

Beginning download for package id: {55B45099-9915-4C67-9C9C-336EBBF1D42A}.
-----------------------------------------------------------------------------------------------------
Date: 7/12/2019 11:37:30 AM, Tick Count: 470069343 (5.10:34:29.3430000), Size: 322 B
Process: AeXNSAgent.exe (2240), Thread ID: 6992, Module: AeXNSCPackageServer.dll
Priority: 4, Source: Package Server Agent
 

End download for package: DisplayLink Graphics Driver 9.1.1651.0 English x64 {55B45099-9915-4C67-9C9C-336EBBF1D42A}. Status: retrying. Downloaded 0 bytes at 0 bytes per second, used 0 bytes from cache
-----------------------------------------------------------------------------------------------------
Date: 7/12/2019 11:40:31 AM, Tick Count: 470249640 (5.10:37:29.6400000), Size: 442 B
Process: AeXNSAgent.exe (2240), Thread ID: 6992, Module: AeXPackageDelivery.dll
Priority: 4, Source: PackageDelivery
 

When you inspect the package, you may see that the Source Location is missing.

Querying the database you may see that the package appears as "Package Invalid" status in all package servers.

 

While looking at the package on the SMP Console, if you try to run "Update Distribution Points" for one of those packages, the following errors may be noticed:

[1/3] Unable to map virtual directory for package: 'DisplayLink Graphics Driver 9.1.1651.0 English x64' (55b45099-9915-4c67-9c9c-336ebbf1d42a),
 pkggroup_7itg7cre7cvjibhs3caorwg25y5j3le4

Keyset does not exist (Exception from HRESULT: 0x80090016)
   [System.Runtime.InteropServices.COMException @ Microsoft.Web.Administration]
   at Microsoft.Web.Administration.Interop.AppHostWritableAdminManager.CommitChanges()
   at Microsoft.Web.Administration.ConfigurationManager.CommitChanges()
   at Microsoft.Web.Administration.ServerManager.CommitChanges()
   at Altiris.NS.WebAdmin.WebMetaApplication.SaveChildDefinition(IWebMetaDefinition def)
   at Altiris.NS.StandardItems.SoftwareDelivery.SWDSupport.VirtualDirectories.TryMapHttpVirtualDirectory(VirtualDirectoryDetails vdir, PackageItem packageItem, IAccPackageArea data, String packagesMetabaseUrl, Boolean deleteLegacyVd, Boolean setUncUsernamePassword)
   at Altiris.NS.StandardItems.SoftwareDelivery.SWDSupport.VirtualDirectories.MapHttpVirtualDirectory(VirtualDirectoryDetails vdir, PackageItem packageItem, IAccPackageArea data, String packagesMetabaseUrl, Boolean deleteLegacyVd)

COM Exception errcode: 0x80090016

....

-----------------------------------------------------------------------------------------------------
Date: 7/12/2019 12:55:09 PM, Tick Count: 1082362500 (12.12:39:22.5000000), Size: 3.68 KB
Process: AeXSvc (9324), Thread ID: 71, Module: Altiris.NS.StandardItems.dll
Priority: 2, Source: Altiris.NS.StandardItems.SoftwareDelivery.SWDSupport+VirtualDirectories.MapHttpVirtualDirectory
 

 

Unable to map virtual directory for package: 'DisplayLink Graphics Driver 9.1.1651.0 English x64' (55b45099-9915-4c67-9c9c-336ebbf1d42a),
 pkggroup_7itg7cre7cvjibhs3caorwg25y5j3le4

Keyset does not exist (Exception from HRESULT: 0x80090016)
   [System.Runtime.InteropServices.COMException @ Microsoft.Web.Administration]
   at Microsoft.Web.Administration.Interop.AppHostWritableAdminManager.CommitChanges()
   at Microsoft.Web.Administration.ConfigurationManager.CommitChanges()
   at Microsoft.Web.Administration.ServerManager.CommitChanges()
   at Altiris.NS.WebAdmin.WebMetaApplication.SaveChildDefinition(IWebMetaDefinition def)
   at Altiris.NS.StandardItems.SoftwareDelivery.SWDSupport.VirtualDirectories.TryMapHttpVirtualDirectory(VirtualDirectoryDetails vdir, PackageItem packageItem, IAccPackageArea data, String packagesMetabaseUrl, Boolean deleteLegacyVd, Boolean setUncUsernamePassword)
   at Altiris.NS.StandardItems.SoftwareDelivery.SWDSupport.VirtualDirectories.MapHttpVirtualDirectory(VirtualDirectoryDetails vdir, PackageItem packageItem, IAccPackageArea data, String packagesMetabaseUrl, Boolean deleteLegacyVd)

COM Exception errcode: 0x80090016

....

-----------------------------------------------------------------------------------------------------

Date: 7/12/2019 12:55:09 PM, Tick Count: 1082362546 (12.12:39:22.5460000), Size: 3.67 KB
Process: AeXSvc (9324), Thread ID: 71, Module: Altiris.NS.StandardItems.dll
Priority: 1, Source: Altiris.NS.StandardItems.SoftwareDelivery.SWDSupport+VirtualDirectories.MapHttpVirtualDirectory

 

Entries in the NS logs for the desired package:

Entry 1:

[1/3] Unable to map virtual directory for package: 'DisplayLink Graphics Driver 9.1.1651.0 English x64' (55b45099-9915-4c67-9c9c-336ebbf1d42a),
 pkggroup_7itg7cre7cvjibhs3caorwg25y5j3le4

Keyset does not exist (Exception from HRESULT: 0x80090016)
   [System.Runtime.InteropServices.COMException @ Microsoft.Web.Administration]
   at Microsoft.Web.Administration.Interop.AppHostWritableAdminManager.CommitChanges()
   at Microsoft.Web.Administration.ConfigurationManager.CommitChanges()
   at Microsoft.Web.Administration.ServerManager.CommitChanges()
   at Altiris.NS.WebAdmin.WebMetaApplication.SaveChildDefinition(IWebMetaDefinition def)
   at Altiris.NS.StandardItems.SoftwareDelivery.SWDSupport.VirtualDirectories.TryMapHttpVirtualDirectory(VirtualDirectoryDetails vdir, PackageItem packageItem, IAccPackageArea data, String packagesMetabaseUrl, Boolean deleteLegacyVd, Boolean setUncUsernamePassword)
   at Altiris.NS.StandardItems.SoftwareDelivery.SWDSupport.VirtualDirectories.MapHttpVirtualDirectory(VirtualDirectoryDetails vdir, PackageItem packageItem, IAccPackageArea data, String packagesMetabaseUrl, Boolean deleteLegacyVd)

COM Exception errcode: 0x80090016

Exception logged from:
   at Altiris.NS.StandardItems.SoftwareDelivery.SWDSupport+VirtualDirectories.MapHttpVirtualDirectory(Altiris.NS.StandardItems.SoftwareDelivery.SWDSupport+VirtualDirectories+VirtualDirectoryDetails, Altiris.NS.StandardItems.SoftwareDelivery.PackageItem, Altiris.NS.StandardItems.SoftwareDelivery.SWDSupport+IAccPackageArea, String, Boolean)
   at Altiris.NS.StandardItems.SoftwareDelivery.SWDSupport+VirtualDirectories.CreateDirectory(Altiris.NS.StandardItems.SoftwareDelivery.SWDSupport+VirtualDirectories+VirtualDirectoryDetails, Altiris.NS.StandardItems.SoftwareDelivery.PackageItem, Altiris.NS.StandardItems.SoftwareDelivery.SWDSupport+IAccPackageArea)
   at Altiris.NS.StandardItems.SoftwareDelivery.SWDSupport+VirtualDirectories.CreatePackageVirtualDirectory(Altiris.NS.StandardItems.SoftwareDelivery.PackageItem, Altiris.NS.StandardItems.SoftwareDelivery.SWDSupport+IAccPackageArea)
   at Altiris.NS.StandardItems.SoftwareDelivery.SWDSupport.SetupDirectoriesUnc(Altiris.NS.StandardItems.SoftwareDelivery.SWDSupport+IAccPackageArea, System.Collections.Generic.ICollection<String>)
   at Altiris.NS.StandardItems.SoftwareDelivery.SWDSupport.CreateSharesAndSnapshot(Altiris.NS.StandardItems.SoftwareDelivery.SWDSupport+DistributionPointsPackageArea)
   at Altiris.NS.StandardItems.SoftwareDelivery.SWDSupport.ManageDistributionPoints(Altiris.NS.StandardItems.SoftwareDelivery.PackageItem, Boolean, System.Collections.Generic.ICollection<System.Guid>)
   at Altiris.NS.StandardItems.SoftwareDelivery.SWDSupport.ManageDistributionPoints(System.Guid)
   at Altiris.NS.StandardItems.SoftwareDelivery.PackageManager.ManageDistributionPointsThreadProc(Object)
   at Altiris.Common.Threading.LocalThreadPool.ExecuteWorkerRequest(Altiris.Common.Threading.LocalThreadPool+LocalThreadPoolWorkerState, Altiris.Common.Threading.LocalThreadPool+UserWorkItem)
   at Altiris.NS.Threading.NSThreadPool.ExecuteWorkerRequest(Altiris.Common.Threading.LocalThreadPool+LocalThreadPoolWorkerState, Altiris.Common.Threading.LocalThreadPool+UserWorkItem)
   at Altiris.Common.Threading.LocalThreadPool.ThreadPoolProc(Object)
   at System.Threading.ThreadHelper.ThreadStart(Object)

-----------------------------------------------------------------------------------------------------
Date: 7/12/2019 12:55:09 PM, Tick Count: 1082362500 (12.12:39:22.5000000), Size: 3.68 KB
Process: AeXSvc (9324), Thread ID: 71, Module: Altiris.NS.StandardItems.dll
Priority: 2, Source: Altiris.NS.StandardItems.SoftwareDelivery.SWDSupport+VirtualDirectories.MapHttpVirtualDirectory
 

 

Entry 2:

Unable to map virtual directory for package: 'DisplayLink Graphics Driver 9.1.1651.0 English x64' (55b45099-9915-4c67-9c9c-336ebbf1d42a),
 pkggroup_7itg7cre7cvjibhs3caorwg25y5j3le4

Keyset does not exist (Exception from HRESULT: 0x80090016)
   [System.Runtime.InteropServices.COMException @ Microsoft.Web.Administration]
   at Microsoft.Web.Administration.Interop.AppHostWritableAdminManager.CommitChanges()
   at Microsoft.Web.Administration.ConfigurationManager.CommitChanges()
   at Microsoft.Web.Administration.ServerManager.CommitChanges()
   at Altiris.NS.WebAdmin.WebMetaApplication.SaveChildDefinition(IWebMetaDefinition def)
   at Altiris.NS.StandardItems.SoftwareDelivery.SWDSupport.VirtualDirectories.TryMapHttpVirtualDirectory(VirtualDirectoryDetails vdir, PackageItem packageItem, IAccPackageArea data, String packagesMetabaseUrl, Boolean deleteLegacyVd, Boolean setUncUsernamePassword)
   at Altiris.NS.StandardItems.SoftwareDelivery.SWDSupport.VirtualDirectories.MapHttpVirtualDirectory(VirtualDirectoryDetails vdir, PackageItem packageItem, IAccPackageArea data, String packagesMetabaseUrl, Boolean deleteLegacyVd)

COM Exception errcode: 0x80090016

Exception logged from:
   at Altiris.NS.StandardItems.SoftwareDelivery.SWDSupport+VirtualDirectories.MapHttpVirtualDirectory(Altiris.NS.StandardItems.SoftwareDelivery.SWDSupport+VirtualDirectories+VirtualDirectoryDetails, Altiris.NS.StandardItems.SoftwareDelivery.PackageItem, Altiris.NS.StandardItems.SoftwareDelivery.SWDSupport+IAccPackageArea, String, Boolean)
   at Altiris.NS.StandardItems.SoftwareDelivery.SWDSupport+VirtualDirectories.CreateDirectory(Altiris.NS.StandardItems.SoftwareDelivery.SWDSupport+VirtualDirectories+VirtualDirectoryDetails, Altiris.NS.StandardItems.SoftwareDelivery.PackageItem, Altiris.NS.StandardItems.SoftwareDelivery.SWDSupport+IAccPackageArea)
   at Altiris.NS.StandardItems.SoftwareDelivery.SWDSupport+VirtualDirectories.CreatePackageVirtualDirectory(Altiris.NS.StandardItems.SoftwareDelivery.PackageItem, Altiris.NS.StandardItems.SoftwareDelivery.SWDSupport+IAccPackageArea)
   at Altiris.NS.StandardItems.SoftwareDelivery.SWDSupport.SetupDirectoriesUnc(Altiris.NS.StandardItems.SoftwareDelivery.SWDSupport+IAccPackageArea, System.Collections.Generic.ICollection<String>)
   at Altiris.NS.StandardItems.SoftwareDelivery.SWDSupport.CreateSharesAndSnapshot(Altiris.NS.StandardItems.SoftwareDelivery.SWDSupport+DistributionPointsPackageArea)
   at Altiris.NS.StandardItems.SoftwareDelivery.SWDSupport.ManageDistributionPoints(Altiris.NS.StandardItems.SoftwareDelivery.PackageItem, Boolean, System.Collections.Generic.ICollection<System.Guid>)
   at Altiris.NS.StandardItems.SoftwareDelivery.SWDSupport.ManageDistributionPoints(System.Guid)
   at Altiris.NS.StandardItems.SoftwareDelivery.PackageManager.ManageDistributionPointsThreadProc(Object)
   at Altiris.Common.Threading.LocalThreadPool.ExecuteWorkerRequest(Altiris.Common.Threading.LocalThreadPool+LocalThreadPoolWorkerState, Altiris.Common.Threading.LocalThreadPool+UserWorkItem)
   at Altiris.NS.Threading.NSThreadPool.ExecuteWorkerRequest(Altiris.Common.Threading.LocalThreadPool+LocalThreadPoolWorkerState, Altiris.Common.Threading.LocalThreadPool+UserWorkItem)
   at Altiris.Common.Threading.LocalThreadPool.ThreadPoolProc(Object)
   at System.Threading.ThreadHelper.ThreadStart(Object)

-----------------------------------------------------------------------------------------------------
Date: 7/12/2019 12:55:09 PM, Tick Count: 1082362546 (12.12:39:22.5460000), Size: 3.67 KB
Process: AeXSvc (9324), Thread ID: 71, Module: Altiris.NS.StandardItems.dll
Priority: 1, Source: Altiris.NS.StandardItems.SoftwareDelivery.SWDSupport+VirtualDirectories.MapHttpVirtualDirectory
 

Cause

In this particular issue, this error "Keyset does not exist (Exception from HRESULT: 0x80090016)" refers to problems with MachineKeys and IIS.

The customer was missing or had corrupted keys.

Some online references:

https://forums.iis.net/t/1160389.aspx

https://techcommunity.microsoft.com/t5/IIS-Support-Blog/Keyset-does-not-exist-exception-from-HRESULT-0x8009000D-or-or/ba-p/342955

Resolution

Please follow the advice that Microsoft has to address similar issue with bad/corrupted or missing MachineKeys.

In this particular scenario, the customer deleted some of the MachineKeys while trying to cleanup space in his hard drive. Since he had a backup copy of these keys, we did the following:

  1. Go to "C:\ProgramData\Microsoft\Crypto\RSA\MachineKeys\"
  2. Find if the following keys exists:
    6de9cb26d2b98c01ec4e9e8b34824aa2      --iisConfigurationKey
    d6d986f09a1ee04e24c949879fdb506c       --NetFrameworkConfigurationKey
    76944fb33636aeddb9590521c2e8815a        --iisWasKey

  3. Those where missing for this customer. Since he had a copy of the deleted MachineKeys, we copied those over to the "...\Crypto\RSA\MachineKeys\" directory and restarted IIS.

  4. Run "NS.Package Refresh" from Task Scheduler and now the proper package references will be recreated.

  5. Update configuration on your Package Servers and click on "Refresh All Packages" under the "Package Server" tab in the Agent UI on your package servers.