Update: Some readers of my blog still experience this issue, and up until now the exact cause is not clear. The workaround is still valid though ! Please read the comments below for the latest updates. If you also experience this issue, please up the counter on the Microsoft Connect site where this issue is reported: https://connect.microsoft.com/ConfigurationManagervnext/feedback/details/772079/task-sequence-doesnt-install-or-fails-when-application-version-is-updated

Recently I experienced some strange issues with installing applications during a task sequence, and at this time of writing there is no official fix for this issue in ConfigMgr 2012 only a workaround. It caused me a lot of question marks before i could actually figure out what the problem was.

 

So, to start let first answer the question about what the symptoms are:

When you install applications you will notice that the task sequence when executed will not install the latest application revision of that application. Instead the application revision of the Application at the time it was added to the task sequence is used, causing either the Task Sequence to fail or an earlier version of the Application ends up being installed.

 

clip_image001

When looking to the References of your task sequence you will notice that it displays a reference to the latest application revision you have.

clip_image002

This corresponds to the actual revision, which you can view by right clicking on the application and by choosing Revision History. As you can see here Revision 2 corresponds to the /2 behind the Application ID.

clip_image003

When looking at the SMSTS.log of a machine running a task sequence you see the following then the application is installed:

Action command line: smsappinstall.exe /app:ScopeId_D78CF89A-6167-4402-9A48-08E5C00613B9/Application_7e9da397-d987-476b-be0d-985f205b7bd1 /basevar: /continueOnError:False

So, the logging isn’t really helping here.

 

When exporting the Task Sequence and opening the AppReferencesInfo.xml file we see the following when searching for the application.

 

<string><INSTANCE CLASSNAME=”SMS_TaskSequenceAppReferencesInfo”> <PROPERTY TYPE=”string” NAME=”__RELPATH”> <VALUE></VALUE> </PROPERTY> <PROPERTY NAME=”PackageID” TYPE=”string”> <VALUE>N12000AD</VALUE> </PROPERTY> <PROPERTY NAME=”RefAppCI_ID” TYPE=”sint32″> <VALUE>16797307</VALUE> </PROPERTY> <PROPERTY NAME=”RefAppModelName” TYPE=”string”> <VALUE>ScopeId_D78CF89A-6167-4402-9A48-08E5C00613B9/Application_7e9da397-d987-476b-be0d-985f205b7bd1</VALUE> </PROPERTY> <PROPERTY NAME=”RefAppPackageID” TYPE=”string”> <VALUE>N1200092</VALUE> </PROPERTY> </INSTANCE></string>

 

What we see here is that the application is also referenced generally and not by a specific revision number.

 

So, in order to do a deeper dive, we need to know more about how the Applications in ConfigMgr 2012 work, so I started reading two articles written by Steve Rachui

 

 

And

 

 

So after reading these 5 articles we now know that the Applications leverage the CI model which already existed in ConfigMgr 2007, and that next to SMSTS.log also the DCMAgent.log and the CI*.log files are important in order to troubleshoot applications.

So let’s check how the logfiles look at a failing task sequence.

First some general items to know:

Scope ID of the Application: D78CF89A-6167-4402-9A48-08E5C00613B9

Application ID of the Application: 56479a67-28bc-42a2-a5ce-6ed64eca32db

Latest Revision of the application at time of logging is 4.

 

In the SMSTS.log we see a couple of entries which relate to this issue:

 

First, we see that version 4 is referenced to:

 

<![LOG[[9] Added/updated setting ‘ccm_civersioninfo:modelname=scopeid_d78cf89a-6167-4402-9a48-08e5c00613b9/application_56479a67-28bc-42a2-a5ce-6ed64eca32db:version=4′.]LOG]!><time=”16:05:10.069-60″ date=”11-19-2012″ component=”InstallSWUpdate” context=”” type=”0″ thread=”1868″ file=”policyutil.cpp:7863″>

And later we see that for some kind of reason, the Task Sequence is looking for version 3 of the Application.

<![LOG[CAppMgmtSDK::GetEvaluationState – ScopeId_D78CF89A-6167-4402-9A48-08E5C00613B9/RequiredApplication_56479a67-28bc-42a2-a5ce-6ed64eca32db.3 Not found in CI state store. Marking CIs state as EvaluationFailed]LOG]!><time=”16:13:39.268-60″ date=”11-19-2012″ component=”DCMAgent” context=”” type=”1″ thread=”2780″ file=”cisdkclass.cpp:1971″>

This causes the Task Sequence to fail, since version 3 of this application cannot be found.

<![LOG[Failed to run the action: Install AppSense Client 8.3 Pack.

Unspecified error (Error: 80004005; Source: Windows)]LOG]!><time=”16:28:47.589-60″ date=”11-19-2012″ component=”TSManager” context=”” type=”3″ thread=”1784″ file=”instruction.cxx:3102″>

Notice that the error returned is 80004005, which is usually a Access is Denied, but in this case needs some extra investigation, because what really went wrong is described here:

<![LOG[NotifyProgress received: 16 (Application failed to evaluate )]LOG]!><time=”16:13:39.268-60″ date=”11-19-2012″ component=”InstallApplication” context=”” type=”1″ thread=”2780″ file=”installapplication.cpp:596″>

And this makes sense because it is looking for version 3, while version 4 is actual at this point in time and downloaded by CIDownloader

Let’s have a look in the other logs, for more information

DCMAgent.log

The first thing to notice is that in DCM each job gets a unique ID as well, so you have to copy it somewhere so you can use it when doing a search in the logfiles:

<![LOG[CDCMAgentJobMgr::StartJob – Starting DCM Agent job {ECBD7BAA-9173-42E1-BFFC-270B14184BA0}]LOG]!><time=”16:13:38.986-60″ date=”11-19-2012″ component=”DCMAgent” context=”” type=”1″ thread=”2696″ file=”dcmagentjobmgr.cpp:430″>

A little bit further in the logfile we see that a CI agent Job is started with yet again a new unique ID, so we have to keep this ID somewhere also.

<![LOG[DCMAgentJob({ECBD7BAA-9173-42E1-BFFC-270B14184BA0}): CDCMAgent::InitiateCIAgentJob – Starting CI Agent Job {6D6420D4-852D-473A-9DD3-D0B12990784A} for target: machine. Refer to this CI agent job ID in ciagent.log for more details]LOG]!><time=”16:13:39.033-60″ date=”11-19-2012″ component=”DCMAgent” context=”” type=”1″ thread=”2872″ file=”dcmagentjob.cpp:2739″>

So let’s have a look at CIAgent.log

<![LOG[CIAgentJob({6D6420D4-852D-473A-9DD3-D0B12990784A}): CAgentJob::VersionInfoTimedOut for ModelName ScopeId_D78CF89A-6167-4402-9A48-08E5C00613B9/RequiredApplication_56479a67-28bc-42a2-a5ce-6ed64eca32db, version 3 not available.]LOG]!><time=”17:43:39.038-60″ date=”11-19-2012″ component=”CIAgent” context=”” type=”3″ thread=”1572″ file=”agentjob.cpp:3241″>

Here we see the CI Agent Job ID back, and a message that version 3 is not available.

So, let’s see what got downloaded in the first place:

CIDownloader.log

<![LOG[[Calculate Scope] – Adding CI Modelname:ScopeId_D78CF89A-6167-4402-9A48-08E5C00613B9/Application_56479a67-28bc-42a2-a5ce-6ed64eca32db Version:4 to Scoped CIs List of root Modelname:ScopeId_D78CF89A-6167-4402-9A48-08E5C00613B9/Application_56479a67-28bc-42a2-a5ce-6ed64eca32db Version:4 ]LOG]!><time=”16:05:23.068-60″ date=”11-19-2012″ component=”CIDownloader” context=”” type=”1″ thread=”1720″ file=”cdownloadpayload.cpp:558″>

CIStore.log

<![LOG[CCIStoreTargetedCIDownloader::AddCI – CI Modelname:ScopeId_D78CF89A-6167-4402-9A48-08E5C00613B9/Application_56479a67-28bc-42a2-a5ce-6ed64eca32db Version:4 has been added for download]LOG]!><time=”16:05:12.725-60″ date=”11-19-2012″ component=”CIStore” context=”” type=”1″ thread=”1104″ file=”targetedcidownloader.cpp:100″>

And we see that the CCMStatestore.sdf file is queried for version 4 in the CIStateStore.log

<![LOG[QueryCIStateStoreFromSQL 1 rows returned for query select st.ModelName,st.Revision,st.UserSID,st.LastUpdateTime,st.Applicability,st.State,st.DesiredState,st.Severity,st.EvaluationState,st.EvaluationStateProgress, st.DisplayName,st.DetailedReport,st.CheckSum,st.LatestRevision,st.TotalSupressionCount,st.TotalEnforcements,st.TotalConflicts,st.NumCompliantRules,st.EnforcementState,st.EnforceError,st.LaunchState,st.LaunchErrorCode,  st.LaunchAdditionalErrorInfo,st.EnforcementStateProgress,st.LastEvalTime,st.LastError,st.LastInstallTime,st.StartTime,st.EnforcementDeadline,st.UpdateDeadline,    st.DCMDetectionState,st.Priority,st.Precedence,st.IsEnforcable,st.DPLocality,st.DisableMomAlerts,st.RaiseMomAlertsOnFailure,st.SupressReboot,st.OverrideServiceWindows,st.RebootOutsideOfServiceWindows, st.UseSiteEvaluation,st.UseGMTTimes,st.NotifyUser,st.UserUIExperience,st.WolEnabled,st.ContentSize,st.RetriesRemaining, st.IsUserPolicyEffective, st.SupersessionState, st.IsPreflightOnly from ConfigurationItemState st  where ModelName = ‘ScopeId_D78CF89A-6167-4402-9A48-08E5C00613B9/RequiredApplication_56479a67-28bc-42a2-a5ce-6ed64eca32db’ and Revision = 4 and UserSID = ‘SYSTEM’.]LOG]!><time=”07:31:29.770-60″ date=”11-20-2012″ component=”CIStateStore” context=”” type=”1″ thread=”3744″ file=”cistateutils.cpp:1143″>

You can check the ccmstore.sdf query yourself b.t.w. by opening the .SDF in SQL Management Studio and executing the same query. You can find more information about how to open the .sdf database file here: http://stackoverflow.com/questions/1953248/how-to-open-sdf-sql-server-compact-edition-file

select st.ModelName,st.Revision,st.UserSID,st.LastUpdateTime,st.Applicability,st.State,st.DesiredState,st.Severity,st.EvaluationState,st.EvaluationStateProgress, st.DisplayName,st.DetailedReport,st.CheckSum,st.LatestRevision,st.TotalSupressionCount,st.TotalEnforcements,st.TotalConflicts,st.NumCompliantRules,st.EnforcementState,st.EnforceError,st.LaunchState,st.LaunchErrorCode,  st.LaunchAdditionalErrorInfo,st.EnforcementStateProgress,st.LastEvalTime,st.LastError,st.LastInstallTime,st.StartTime,st.EnforcementDeadline,st.UpdateDeadline,    st.DCMDetectionState,st.Priority,st.Precedence,st.IsEnforcable,st.DPLocality,st.DisableMomAlerts,st.RaiseMomAlertsOnFailure,st.SupressReboot,st.OverrideServiceWindows,st.RebootOutsideOfServiceWindows, st.UseSiteEvaluation,st.UseGMTTimes,st.NotifyUser,st.UserUIExperience,st.WolEnabled,st.ContentSize,st.RetriesRemaining, st.IsUserPolicyEffective, st.SupersessionState, st.IsPreflightOnly from ConfigurationItemState st  where ModelName = ‘ScopeId_D78CF89A-6167-4402-9A48-08E5C00613B9/RequiredApplication_56479a67-28bc-42a2-a5ce-6ed64eca32db’ and Revision = 4 and UserSID = ‘SYSTEM’

So, let’s have a look at what happens when a Task Sequence is successful, in my case I executed this task sequence the day after, and before executing it I removed the Install Application task (the whole task) and added the task again.

SMSTS.log

<![LOG[[9] Added/updated setting ‘ccm_civersioninfo:modelname=scopeid_d78cf89a-6167-4402-9a48-08e5c00613b9/application_56479a67-28bc-42a2-a5ce-6ed64eca32db:version=4′.]LOG]!><time=”11:19:16.521-60″ date=”11-20-2012″ component=”InstallSWUpdate” context=”” type=”0″ thread=”2440″ file=”policyutil.cpp:7863″>

<![LOG[CAppMgmtSDK::GetEvaluationState ScopeId_D78CF89A-6167-4402-9A48-08E5C00613B9/RequiredApplication_56479a67-28bc-42a2-a5ce-6ed64eca32db.4 = Enforced]LOG]!><time=”11:34:17.328-60″ date=”11-20-2012″ component=”DCMAgent” context=”” type=”1″ thread=”1572″ file=”cisdkclass.cpp:2042″>

Notice that the GetEvaluationState now points to .4 (version 4)

This will result in a succesful application installation

<![LOG[Successfully completed the action (Install AppSense Client Pack 8.3) with the exit win32 code 0]LOG]!><time=”11:34:17.765-60″ date=”11-20-2012″ component=”TSManager” context=”” type=”1″ thread=”1784″ file=”instruction.cxx:3037″>

DCMAgent.log

<![LOG[CDCMAgentJobMgr::StartJob – Starting DCM Agent job {E4756814-BA9A-4659-8876-684209B4FF46}]LOG]!><time=”11:32:05.374-60″ date=”11-20-2012″ component=”DCMAgent” context=”” type=”1″ thread=”616″ file=”dcmagentjobmgr.cpp:430″>

<![LOG[DCMAgentJob({E4756814-BA9A-4659-8876-684209B4FF46}): CDCMAgent::InitiateCIAgentJob – Starting CI Agent Job {1FC2F5E4-F834-41CC-ABDA-B91171D5D13B} for target: machine. Refer to this CI agent job ID in ciagent.log for more details]LOG]!><time=”11:32:05.421-60″ date=”11-20-2012″ component=”DCMAgent” context=”” type=”1″ thread=”2116″ file=”dcmagentjob.cpp:2739″>

We see the following in the CIAgent.log

<![LOG[CIAgentJob({5E6BFBAA-4CBD-4574-8721-A9D5725FB213}):State – Reporting (scan):: Install Policy Type – ScopeId_D78CF89A-6167-4402-9A48-08E5C00613B9/RequiredApplication_56479a67-28bc-42a2-a5ce-6ed64eca32db:4 – State = Compliant ResolvedState = Compliant Applicability = Applicable]LOG]!><time=”11:34:17.203-60″ date=”11-20-2012″ component=”CIAgent” context=”” type=”1″ thread=”2472″ file=”agentjob.cpp:6179″>

CIDownloader.log

 <![LOG[[Calculate Scope] – Adding CI Modelname:ScopeId_D78CF89A-6167-4402-9A48-08E5C00613B9/Application_56479a67-28bc-42a2-a5ce-6ed64eca32db Version:4 to Scoped CIs List of root Modelname:ScopeId_D78CF89A-6167-4402-9A48-08E5C00613B9/Application_56479a67-28bc-42a2-a5ce-6ed64eca32db Version:4 ]LOG]!><time=”11:19:29.598-60″ date=”11-20-2012″ component=”CIDownloader” context=”” type=”1″ thread=”1232″ file=”cdownloadpayload.cpp:558″>

CIStore.log

 

<![LOG[QueryCIStateStoreFromSQL 1 rows returned for query select st.ModelName,st.Revision,st.UserSID,st.LastUpdateTime,st.Applicability,st.State,st.DesiredState,st.Severity,st.EvaluationState,st.EvaluationStateProgress, st.DisplayName,st.DetailedReport,st.CheckSum,st.LatestRevision,st.TotalSupressionCount,st.TotalEnforcements,st.TotalConflicts,st.NumCompliantRules,st.EnforcementState,st.EnforceError,st.LaunchState,st.LaunchErrorCode,  st.LaunchAdditionalErrorInfo,st.EnforcementStateProgress,st.LastEvalTime,st.LastError,st.LastInstallTime,st.StartTime,st.EnforcementDeadline,st.UpdateDeadline,    st.DCMDetectionState,st.Priority,st.Precedence,st.IsEnforcable,st.DPLocality,st.DisableMomAlerts,st.RaiseMomAlertsOnFailure,st.SupressReboot,st.OverrideServiceWindows,st.RebootOutsideOfServiceWindows, st.UseSiteEvaluation,st.UseGMTTimes,st.NotifyUser,st.UserUIExperience,st.WolEnabled,st.ContentSize,st.RetriesRemaining, st.IsUserPolicyEffective, st.SupersessionState, st.IsPreflightOnly from ConfigurationItemState st  where ModelName = ‘ScopeId_D78CF89A-6167-4402-9A48-08E5C00613B9/Application_56479a67-28bc-42a2-a5ce-6ed64eca32db’ and Revision = 4 and UserSID = ‘SYSTEM’.]LOG]!><time=”11:32:14.606-60″ date=”11-20-2012″ component=”CIStateStore” context=”” type=”1″ thread=”2752″ file=”cistateutils.cpp:1143″>

I did a lot of testing, after which I developed a working workaround for this issue untill Microsoft solves it.

Workaround:

When you make a new revision of an Application which is used within a Task Sequence:

  1. Open the Task Sequence in which you have used this application
  2. Remove the Install Software step (yes, the whole step)
  3. Save the Task Sequence
  4. Open the Task Sequence and add the Install Software Step back again
  5. Save the Task Sequence
  6. Start your OS Deployment

In my situation (2 different customers, same symptoms) this is a working workaround, but because we don’t have any clear root cause identified it could be that in other situations this workaround doesn’t work. I do hope though that this article can help you to determine if you experience the same issue and hopefully provide a workaround which works for you as well.

Update 27-11-2012: Microsoft has confirmed that this issue will be fixed with Service Pack 1 which is still expected to be released in Q1 2013

Hello Kenneth, Thank you for your feedback. I see you have mentioned the product as ConfigMgr 2012 RTM. We have fixed the mentioned issue in SP1. The work around for RTM is to remove the app from TS, save it  and add it back.