Software gets stuck in download phase ( waiting for content ) with SCCM 2007 and 2012.

A few years ago I encountered a problem with specific software ( if I recall correctly it was AutoCAD 2010 ) that was to be distributed via SCCM 2007 R2. I can’t recall the name however I clearly recall the problem as I a few weeks ago encountered the same type of problem with distributing IBM iSeries Access For Windows V6R1M0.

The software was packaged in msi format and it was correctly uploaded to SCCM and distributed to all distribution points without and issues at all. Still, when an end-user tried to install the software via Run Advertised Programs the software started to download and then simply got stuck at 0% and did not move for over 24 hours.

Below are two screenshots demonstrating the symptoms. The first is for SCCM 2007 R3 and the second is for SCCM 2012 / vNext. For whatever reason once I started to install my package it disappeared from Software Center – however as you will discover later it actually tried to download it. It could very well be related to the fact that it is Beta 2.

blog_110912_pic01
Picture 1: SCCM 2007 R3

blog_110912_pic02

Picture 2: SCCM 2012

Analysis

Before I go into the analysis phase I would like to point out that the analysis will be made on SCCM 2012 / vNext however the procedure is exactly the same for SCCM 2007 R2/R3.
Starting to look at the usual places such as the C:\Windows\System32\CCM\Logs folder ( C:\Windows\SysWoW64\CCM\Logs for x64 systems ) and reviewing all the logs resulted in me only finding references that indicated that the software was in “DownloadingData” stage.

For example, opening up DataTransferService and scrolling to the bottom clearly displayed all the files it was trying to download.

blog_110912_pic03

Picture 3: DataTransferService

Checking in ContentTransferManager indicated similar, note that my package ID TB200003 was referenced and latest entries claim that it is in the CCM_DOWNLOADSTATUS_DOWNLOADING_DATA phase.

blog_110912_pic04

Picture 4: ContentTransferManager

What next? Excellent question, before I go into the next step I want to take a brief moment to explain how SCCM distribution works in “out-of-the-box” configuration. For the sake of this post and the problem at hand SCCM has two main components. The first is the distribution between distribution points and the second one is from the distribution point to the client.
SCCM utilizes SMB/CIFS to transfer content between distribution points, i.e. the same as when you copy content from your computer to a network share.

However SCCM utilizes BITS to transfer content from the distribution point to the client. How is this relevant? Well, as we know that ( in this case ) BITS is used to send data to the client and all messages indicate that we are stuck in the Downloading phase the next step would be to see if we have any BITS jobs in the pipe.

Open your favorite command prompt in elevated mode and type in the following command: bitsadmin /list /allusers /verbose
Depending on the size of the content you might get a lot of content, in which case it is wiser to pipe the output into a text file for easer processing, simply modify the command to bitsadmin /list /allusers /verbose > c:\BITSContent.txt
In my case the output was the following:

blog_110912_pic05

Picture 5: BITSADMIN

As you can see we see our job and our files queued for downloading ( just as the logs indicated ) however we also see that there is some sort of error! This is the reason to why the download got stuck in the “Downloading” phase. You see, BITS utilizes IIS and WebDAV for transferring content and one of the issues encountered by using this technology is that special characters such as the Swedish characters ÅÄÖ or any other characters not in the English alphabet will result in a failure to download.

This is not limited to IIS or WebDAV but rather to the restrictions in all web servers and the internet in general where only English characters are allowed.

File Extensions being blocked
There is another type of problem that can occur which is not related to non-English characters but rather to file extensions. In the case of IBM iSeries Access For Windows the problem is due to it having files that have extensions that are blocked or not allowed by IIS.
Following the same steps including running the bitsadmin command will instead result in the following output:

blog_110912_pic06

Picture 6: File extension restrictions

As you can see the file blocked ends with the extension .properties. This extension ( among others ) is not allowed by default via IIS and therefore the download is blocked.

Solution

Now that we know what the problem is, how do we fix it? That is a very good question, due to there being two separate problems and two separate solutions I’ll divide this chapter into two sub-chapters.

Illegal Characters

Let’s start with illegal characters and how the problem can be fixed. There are a few solutions however I’ve only used two to solve this issue, one “ugly” and another more elegant, however both fully working.
Before we go into the options I would like to point out that in reality the analysis above works, however it only displays one problematic file at a time, i.e. if you as for example in AutoCAD 2010 have a lot of files in the packaged version you cannot be certain that only one particular file is the problem.

A quickly written script can save you a lot of time as it will traverse all the directories and files and output all the ones that contain an “illegal” character in its name. The script which I call SearchForIllegalSCCMCharacters.vbs is a VBScript that will traverse the path given as an argument and check for %&()?åäö in the name. The characters that it looks for can be extended / replaced simply by updating re.Pattern = ”[%&()?åäö]” to whatever you want to look for.

'

' Copyright Mirza Kubat  - FildelityConsulting

'

Set fso = CreateObject("Scripting.FileSystemObject")

Set re  = New RegExp

' put all characters that you want to strip inside the brackets'

re.Pattern = "[%&()?åäö]"

re.IgnoreCase = True

re.Global = True

If WScript.Arguments.Unnamed.Count = 1 Then

If fso.FolderExists(WScript.Arguments.Unnamed(0)) Then

Wscript.Echo "Searching for illegal characters."

Recurse fso.GetFolder(WScript.Arguments.Unnamed(0))

Else

WScript.Echo "Folder not found."

End If

Else

WScript.Echo "Please give folder name as argument 1."

End If

Sub Recurse(f)

For Each sf In f.SubFolders

Recurse sf

If re.Test(sf.Name) Then

WScript.Echo "Folder: " & f & "\" & sf.Name

End If

Next

For Each sf In f.Files

If re.Test(sf.Name) Then

WScript.Echo "File: " & f & "\" & sf.Name

End If

Next

End Sub

For example, running the script and checking my package results in it finding two files that contain illegal characters and which would cause problems with the transfer.

blog_110912_pic07

Picture 7: SearchForIllegalSCCMCharacters

 

Solution 01: Rename Files

So how do we solve this? Well the quick and dirty solution it to simply rename the files I the source and then use an install.cmd or install.vbs wrapper that when executed on the client will rename the files back to their original names and then start the installation.
For example:

  1. Client downloads content from Distribution Point.
  2. Client executes install.cmd
  3. Install.cmd starts by renaming the files back to their original name.
  4. Install.cmd starts the installation of the software

The result will be that the software will download ( as you have renamed the files on the distribution point ) and it will then install as the files are renamed back to their original names after download.

It is quick and dirty and I would not recommend this solution unless there are a few files.

Solution 02: Compress

The second solution which I find more elegant is to simply compress the files. Please note that in SCCM you have the option to set Use a compressed copy of the source directory which is NOT what you want to do. This option dictates that SCCM should compress the files on the source server and transfer the compressed files to the distribution points.

To quote TechNet: Use a compressed copy of the source directory: Configuration Manager 2007 will create a compressed version of the source files on the site server. If this option is selected, this compressed version will be decompressed and copied to the distribution points instead of being copied directly from the original source folder when the distribution points are refreshed. Use this option if the source files might be removed from the specified path (for example, if the source files are on a CD).

What I’m referring to is to compress the files with the help of for example WinZIP, WinRAR , 7Zip or any other compression software which will allow for self-extracting executable to be created.
What this means is that you take a source, say AutoCAD 2010 and compress it with the compression software of your choice into a self-extracting executable. This executable is configured to decompress the contents automatically and silently and then execute a specific command.
For example:

  1. The compressed AutoCAD_2010.exe is added to SCCM and distributed to all distribution points.
  2. The client runs the installation from Run Advertised Programs or Software Central.
  3. The SCCM client will download the software successfully as it only downloads the .exe file which is allowed.
  4. The SCCM Client runs the command AutoCAD_2010.exe which will trigger the self-extraction and once the self-extraction is complete the exe will start the installation of AutoCAD 2010 as defined by your command.

The end result is that the software will be downloaded and installed successfully, the added bonus is that in cases such as AutoCAD, Photoshop or any other software that is MSI packaged but where all the files are stored outside the MSI or CAB will be downloaded much faster due to the fact that instead of downloading +10000 files you are downloading one.

File Extensions

The second problem where you are not able to download the software due to file extensions is easier to solve. Although you could use both the renaming and compression solution above there is a third and preferable way to solve it.
You see IIS contains a specific configuration file where you can deny or allow file extensions. Simply editing this file and restarting IIS will result in a successful download.

Start by browsing to the file in question, which can be found in c:\Windows\System32\Intesrv\Config and is called applicationHost.config.

blog_110912_pic08

Picture 8: applicationHost.config

Open the file in Notepad and search for . It should take you directly to the section in the picture below. This section contains all the file extensions that IIS is actively not allowing. Please note that .properties is not in the list and should therefore be allowed, however it is still not.
What you have to do is either update the allowed=”false” to allowed=”true” if your file extension is present in the list or add a completely new row if it is not.
In my case I added the row at the bottom:

blog_110912_pic09

Picture 9: applicationHost.config – Properties

This tells IIS that all files ending with .properties are to be downloadable. Please note that files such as .config, .mdb and .resources are not allowed by default and they can cause problems as many applications might have files with those extensions. Please note that this problem will only occur if the software contains files outside of their exe / cab / msi files and not if the files exist inside these files.
Save the file and finish off by restarting IIS in order for the changes to take effect.

blog_110912_pic10

Picture 10: iisreset

If you try to download the software again the download will be successful, of course presuming that you only needed to unlock the files that you unlocked.

Summary

To summarize this quite lengthy blog post, the problems in themselves are not related to SCCM but rather BITS and IIS and they can occur for any software utilizing these technologies for downloading purposes. I actually encountered the file extension issue with Citrix XenApp 6 and Citrix Application Streaming just the other day, application failed to stream as it contained a file ending in .resources which was not allowed in IIS.
In the case of SCCM the third solution that would solve both the file extension and illegal characters problem is to configure SCCM to distribute the software to the client by SMB / CIFS in which cases there are no such restrictions – however BITS is to be preferred due to its possibility to pause / resume and its throttling capabilities.

Post written by Mirza Kubat


Liknande artiklar:


Taggar: , , , , , , , , ,

Kommentering är avstängd.

News & Events

Fredrik Kämpe utnämnd till AppSense Partner Sales Star of the Year!

april 2015

Vi gratulerar Fredrik Kämpe som på årets AppSense University med 65 partners från 8 länder mottog utmärkelsen Partner Sales Star of the Year! Stort grattis och ...

Fidelity Consulting på Citrix Synergy 2015

april 2015

Våra konsulter inom Citrix samt några av våra kunder kommer åka till årets Citrix Synergy mässa i Orlando. Vi uppdaterar oss inom Mobility och Cloud ...

Mer Nyheter
 

Our Clients

"The best project manager I´ve ever worked with!"
Kari Innanen / Fortum IT services, Finland

"IBM har valt att anlita Fredrik för att han är pålitlig, snabb och effektiv. Inget lämnas åt slumpen och vi känner oss trygga med att lägga projekt i hans händer."
Martin Eriksson / CDC Lead Sweden

"Jim är en pålitlig och förtroendeingivande konsult av yttersta kvalitet, med stabil & lyhörd inställning och som alltid levererar mer än förväntat."
Jonas / Teamleader IBM.