{"id":3274,"date":"2023-09-13T12:25:45","date_gmt":"2023-09-13T12:25:45","guid":{"rendered":"https:\/\/leinss.com\/blog\/?p=3274"},"modified":"2023-11-08T15:17:44","modified_gmt":"2023-11-08T15:17:44","slug":"error_sxs_assembly_missing-chaos","status":"publish","type":"post","link":"https:\/\/leinss.com\/blog\/?p=3274","title":{"rendered":"ERROR_SXS_ASSEMBLY_MISSING Chaos"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Tried to add IIS and MSMQ features to a server.  Kept getting a 0x80073701 error: missing assembly file.  Off to C:\\windows\\logs\\cbs.log we go:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>2023-09-06 07:02:33, Error CSI 00000009 (F) STATUS_SXS_ASSEMBLY_MISSING #2625634# from CCSDirectTransaction::OperateEnding at index 0 of 1 operations, disposition 2[gle=0xd015000c]<br>2023-09-06 07:02:33, Error CSI 0000000a (F) HRESULT_FROM_WIN32(ERROR_SXS_ASSEMBLY_MISSING) #2625476# from Windows::ServicingAPI::CCSITransaction::ICSITransaction_PinDeployment(Flags = 0, a = dbbb65b179c955b3c0186aa84fa6e087, version 10.0.17763.3165, arch amd64, nonSxS, pkt {l:8 b:31bf3856ad364e35}, cb = (null), s = (null), rid = '<mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-red-color\">Package_4455_for_KB5022286~31bf3856ad364e35~amd64~~10.0.1.7.5022286-8227_neutral<\/mark>', rah = (null), manpath = (null), catpath = (null), ed = 0, disp = 0)[gle=0x80073701]<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">On Google, I found this <a href=\"https:\/\/learn.microsoft.com\/en-us\/answers\/questions\/1080042\/iis-failure-to-install-on-data-center-server-2019\">post<\/a>, but I will save you the time: downloading said update, expanding it to a CAB file and then adding the CAB file via DISM did absolutely nothing to fix the problem.  Neither did running <code>SFC \/scannow<\/code> or <code>dism \/online \/cleanup-image \/restorehealth<\/code>.  <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The fix is to remove the keys referencing the bad KB from the registry under <code>HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Component Based Servicing\\Packages<\/code>, then try re-adding the roles from Server Manager.   I suggest using <a href=\"https:\/\/www.baremetalsoft.com\/baretail\/\">Baretail<\/a> to watch C:\\windows\\logs\\cbs.log while you are doing this to see if additional errors come back up (<em>you may need to do this fix for multiple KBs.  In my case, I would fix one and another KB would pop up<\/em>).<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Before running this script, run <code>regedit<\/code> using the<code> psexec -s -i cmd<\/code> trick to run under the SYSTEM account, then go to <code>HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Component Based Servicing\\Packages<\/code>, right-click on Packages and grant SYSTEM full control.  Trying to adjust permissions and take ownership of the registry keys within the script was a nightmare, so I went back to basics by removing that logic and just set permissions manually using the registry editor.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You&#8217;ll need to run the Powershell script under the same SYSTEM trick above to avoid any permission issues removing the keys:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># Define the root path to search in\n$rootPath = \"HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Component Based Servicing\\Packages\"\n\n# Get all child items (keys) under the root path\n$keys = Get-ChildItem -Path $rootPath\n\n# Filter the keys based on the presence of the desired values in the name\n$filteredKeys = $keys | Where-Object { $_.Name -like '*KB5022286*' -or $_.Name -like '*KB5027222*' }\n\n# Loop through each matching key and remove it\n$filteredKeys | ForEach-Object {\n    # Extract the key's path\n    $keyPath = $_.Name -replace 'HKEY_LOCAL_MACHINE', 'HKLM:'\n\n    # Remove the key\n    Remove-Item -Path $keyPath -Recurse -Force\n}\n\nWrite-Output \"Operation completed.\"<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Now for the &#8220;root cause analysis&#8221;, a buzz word we love to throw around in IT: it appears that someone completely cleared out the contents of C:\\Windows\\SoftwareDistribution on the server and DISM couldn&#8217;t find the source files anymore for these KBs. However, there were other KBs pointed to this folder (<em>which was empty<\/em>) and they worked just fine? Perhaps these specific KBs actually updated the core IIS files within the OS and that&#8217;s why DISM was querying them during the IIS\/MSMQ role add?<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Perhaps a better solution is to copy the SoftwareDistribution folder from a server running the same server OS where the downloads are not cleared from the folder. Not sure if the GUIDs would match up between the two different servers, but might be worth trying the next time this comes up.  If you should try this route yourself, you&#8217;ll need to temporarily disable and stop the Windows Update service on both servers as it likes to lock files in this folder.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If you were also curious: Windows Update keeps working just fine after the procedure of removing bad KBs from <code>HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Component Based Servicing\\Packages<\/code>.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Soli Deo Gloria<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Tried to add IIS and MSMQ features to a server. Kept getting a 0x80073701 error: missing assembly file. Off to C:\\windows\\logs\\cbs.log we go: 2023-09-06 07:02:33, Error CSI 00000009 (F) STATUS_SXS_ASSEMBLY_MISSING #2625634# from CCSDirectTransaction::OperateEnding at index 0 of 1 operations, disposition 2[gle=0xd015000c]2023-09-06 07:02:33, Error CSI 0000000a (F) HRESULT_FROM_WIN32(ERROR_SXS_ASSEMBLY_MISSING) #2625476# from Windows::ServicingAPI::CCSITransaction::ICSITransaction_PinDeployment(Flags = 0, a = dbbb65b179c955b3c0186aa84fa6e087, &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/leinss.com\/blog\/?p=3274\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;ERROR_SXS_ASSEMBLY_MISSING Chaos&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[4,7],"tags":[],"class_list":["post-3274","post","type-post","status-publish","format-standard","hentry","category-operating-system","category-tech-tips"],"jetpack_publicize_connections":[],"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p7wiG8-QO","jetpack-related-posts":[],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/leinss.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/3274","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/leinss.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/leinss.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/leinss.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/leinss.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3274"}],"version-history":[{"count":40,"href":"https:\/\/leinss.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/3274\/revisions"}],"predecessor-version":[{"id":3353,"href":"https:\/\/leinss.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/3274\/revisions\/3353"}],"wp:attachment":[{"href":"https:\/\/leinss.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3274"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/leinss.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3274"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/leinss.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3274"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}