Save-CMSoftwareUpdate cmdlet crashes PowerShell console
Sometimes, when the cmdlet comes across certain cumulative Office updates, it crashes the whole PowerShell console, which makes it very inconvenient, when this cmdlet is used in scope of a scheduled task. The thing is that in such case, the script just terminates like nothing happened, which requires some advanced wrappers to be built around to alert when such issues occur.
Here's the event that gets logged in the Application log:
Log Name: Application
Source: Application Error
Date: 11/14/2017 7:06:37 PM
Event ID: 1000
Task Category: (100)
Computer: --- cut out ---
Faulting application name: powershell.exe, version: 10.0.10586.117, time stamp: 0x56bf0691
Faulting module name: patchDownloader.dll, version: 5.0.8458.1000, time stamp: 0x5811a391
Exception code: 0xc0000005
Fault offset: 0x000000000000c408
Faulting process id: 0x42c4
Faulting application start time: 0x01d35da4ae67eff0
Faulting application path: C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
Faulting module path: C:\Program Files (x86)\Microsoft Configuration Manager\AdminConsole\bin\x64\patchDownloader.dll
Report Id: d8d95b8f-c998-11e7-80e7-001dd8b71cc4
Faulting package full name:
Faulting package-relative application ID:
<Provider Name="Application Error" />
<TimeCreated SystemTime="2017-11-15T00:06:37.000000000Z" />
<Data>C:\Program Files (x86)\Microsoft Configuration Manager\AdminConsole\bin\x64\patchDownloader.dll</Data>
I'm experiencing this with a ConfigurationManager module 5.1.8471.1000.
The issue occurs regardless of whether the script runs on the Primary Site server or on some other machine.
This issue should be fixed in 1802.
I've been doing some more testing recently, and it turned out that those remaining office update can only be downloaded using SCCM Console (after several retries). I've tried wrapping Save-CMSoftwareUpdate cmdlet into a scriptblock to be able to re-run it via PSJob as many times as needed (to prevent the main script from crashing), however judging by the output it was always crashing in the same place even after tens of retries.
By the way, does calling Save-CMSoftwareUpdate trigger logging to PatchDownloader.log file, like it happens when updates are downloaded via the console? I've tried searching for one using procmon but couldn't find any. Wanted to find out which URL does it flip over and at which point.
@Adam, I have the memory dump captured, where shall I upload it?
A few weeks ago, we've upgraded our SCCM environment to 1706 and the problem is still occurring. I've rerun the cmdlet again in 32bit PowerShell (locally on SCCM Primary host) and it has also crashed. Here's the problem signature:
Problem Event Name: BEX
Application Name: powershell.exe
Application Version: 10.0.10586.117
Application Timestamp: 56bf0886
Fault Module Name: clr.dll
Fault Module Version: 4.7.2117.0
Fault Module Timestamp: 59cf5105
Exception Offset: 005662c7
Exception Code: c0000409
Exception Data: 00000002
OS Version: 6.3.9600.2.0.0.272.7
Locale ID: 1033
Additional Information 1: 5f25
Additional Information 2: 5f25cfe2a8f1b0a062e85f610ac86ca4
Additional Information 3: 77a8
Additional Information 4: 77a88052f910e775ec8cce023cf53f0b
Read our privacy statement online:
If the online privacy statement is not available, please read our privacy statement offline:
In PatchDownloader.log file, there's the following line (first line in the log):
ERROR: DownloadContentFiles() failed with hr=0x80010106 Software Updates Patch Downloader 12/13/2017 3:30:27 AM 24444 (0x5F7C)
This time the issue occurred when the cmdlet was trying to download updates for the following update:
Title: Office 365 Client Update - Semi-annual Channel Version 1701 for x64 based Edition (Build 7766.2122)
Article ID: 3104046
Unique Update ID: 3134c5bf-702e-458e-a1e8-c57cf83b575d
I'm going to try and capture the memory dump and will let you know once I have it.
AdminAdam Meltzer (ConfigMgr Product Team) (Software Engineer, Microsoft Endpoint Configuration Manager) commented
Thanks for the extra details. We will definitely look into this.
If you have the ability to get a crash dump when this occurs, it would also be immensely helpful just in case we can't reproduce it on our end -- this way we'll know exactly where in the code the failure is occurring. More information on how to get a crash dump using DebugDiag is here: https://blogs.msdn.microsoft.com/chaun/2013/11/12/steps-to-catch-a-simple-crash-dump-of-a-crashing-process/
I will report back once we have more to share on this.
Sorry for the delayed reply.
The thing is that when I try downloading the same update through the console, the download fails (but the SCCM Console doesn't crash). Here's what gets logged to the PatchDownloader.log file when the issue occurs:
Downloading content for ContentID = 16837275, FileName = office\data\16.0.6741.2105\stream.x86.x-none.dat. Software Updates Patch Downloader 8/18/2017 6:25:39 AM 33608 (0x8348)
Download http://officecdn.microsoft.com/pr/7ffbc6bf-bc32-4f92-8982-f9dd17fd3114/office/data/16.0.6741.2105/stream.x86.x-none.dat in progress: 10 percent complete Software Updates Patch Downloader 8/18/2017 6:25:59 AM 11724 (0x2DCC)
Download http://officecdn.microsoft.com/pr/7ffbc6bf-bc32-4f92-8982-f9dd17fd3114/office/data/16.0.6741.2105/stream.x86.x-none.dat to C:\Users\AASERI~1\AppData\Local\Temp\CAB851.tmp returns 12002 Software Updates Patch Downloader 8/18/2017 6:26:31 AM 11724 (0x2DCC)
ERROR: DownloadContentFiles() failed with hr=0x80072ee2 Software Updates Patch Downloader 8/18/2017 6:26:31 AM 33608 (0x8348)
What's interesting is that if I retry downloading this update, it downloads a bit more (or the whole thing) on the next retry. Sometimes it takes about 2 or 3 retries to download the update completely.
To confirm that the problem is not with any firewalls/proxies, I tried to download the same file using PowerShell (i.e. via invoke-webrequest or Start-BitsTransfer) or the web browser with no issues at all.
I haven't tried this in 32bit console, but will try it out next month (as I've already downloaded the updates for this month).
Here's the exact string from my script where the issue is occurring:
Save-CMSoftwareUpdate -SoftwareUpdateGroupName $SUGName -DeploymentPackageName $DeploymentPackageName
Here are the details about one of the updates that I've been having issues with:
Title: Office 365 Client Update - Deferred Channel (1602-17) 32-bit Edition
Article ID: 3104046
Unique Update ID: 5345c02b-ed73-44ac-948f-3be8fc02aad6