storedownloadd hangs and blocks install of other applications

Originator:vrancean
Number:rdar://26408264 Date Originated:
Status: Resolved:
Product:OS X Product Version:
Classification: Reproducible:Yes
 
Summary:
After an unsuccessful install of an application by an MDM server, storedownloadd refuses to add any other downloads to the queue.
The client also reports the command as Acknowledged to the MDM server(this makes sense but is not helpful). 

Restarting the storedownloadd process and re-sending an InstallApplication

/var/log/commerce.log message when  storedownloadd is hanged:
May 21 17:13:40 admins-Mac storedownloadd[532]: DownloadManifest: removePurgeablePath: /var/folders/qg/yc8wn1f13jb_mly2mj34pfkh0000gn/C/com.apple.appstore/0
May 21 17:13:40 admins-Mac storedownloadd[532]: DownloadQueue: Could not add download
May 21 17:13:40 admins-Mac storedownloadd[532]: DownloadQueue: Will start any ready downloads anyways.

Steps to Reproduce:
1. Deploy 3rd party pkg with InstallApplication command/MDM server 
The manifest plist in the InstallCommand must be malformed in any of the following ways:
a) missing md5-size/md5 array of hashes. or
b) mismatched md5-size and md5 arrays

2. The command will be acknowledged and the client will attempt the download. 
After several retries, the client will report that the download has failed and it will not attempt any retries. 

3. Try to queue another InstallApplication command. Could be the previous installer or a completely new install. 
Nothing happens. commerce.log reports the log lines in description.

/var/log/commerce.log message when  storedownloadd is hanged:
May 21 17:13:40 admins-Mac storedownloadd[532]: DownloadManifest: removePurgeablePath: /var/folders/qg/yc8wn1f13jb_mly2mj34pfkh0000gn/C/com.apple.appstore/0
May 21 17:13:40 admins-Mac storedownloadd[532]: DownloadQueue: Could not add download
May 21 17:13:40 admins-Mac storedownloadd[532]: DownloadQueue: Will start any ready downloads anyways.

4. Killing the storedownloadd process and resending the command queue 

Expected Results:
The storedownloadd command should continue downloads after a failure. 

Actual Results:
The storedownloadd process was stuck, subsequent installs did not work and the user has no way of knowing that the device is in a state that requires troubleshooting/a restart to be fixed. 

Version:
OS X El Capitan 10.11.4/15E65

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!