Authoring Tool Workflow Execution Error

Hi everybody.
I have a customized workflow that contains a Powershell script, it was running until last week.

Now, when the workflow is running says:

Microsoft.EnterpriseManagement.Common.InconsistentDataException: The requested objects had an unknown management pack. ---> Microsoft.EnterpriseManagement.Common.InconsistentDataException: The call produced inconsistent results. The data on the client does not match the data returned from the server. The most likely cause is that client-side cache is out of sync with server data. ---> Microsoft.EnterpriseManagement.Common.ObjectNotFoundException: An object of class ManagementPack with ID ce6d366c-1021-7283-7fc2-a4550062e55f was not found.
   at Microsoft.EnterpriseManagement.Configuration.TypeSpaceCacheBaseWithManagementPacks.GetManagementPack(Guid id)
   at Microsoft.EnterpriseManagement.Configuration.TypeSpaceCache.GetManagementPack(Guid id)
   at Microsoft.EnterpriseManagement.ManagementPackManagement.GetManagementPack(Guid id)
   at Microsoft.EnterpriseManagement.Configuration.CreatableManagementPackElement`1.GetManagementPack(Guid managementPackId)
   --- End of inner exception stack trace ---
   --- End of inner exception stack trace ---
   at Microsoft.EnterpriseManagement.Configuration.CreatableManagementPackElement`1.GetManagementPack(Guid managementPackId)
   at Microsoft.EnterpriseManagement.Configuration.ManagementPackTask.Constructor.CreateSingle(Result row)
   at Microsoft.EnterpriseManagement.Configuration.ManagementPackElementConstructor.CreateMultiple[T,H](IList`1 dataAccessResult, EnterpriseManagementGroup managementGroup, ManagementPack managementPack)
   at Microsoft.EnterpriseManagement.TaskConfigurationManagement.GetTasksInternal(ManagementPackTaskCriteria criteria, IList`1 targetTypeIds, BaseClassTraversalDepth baseClassTraversalDepth, Nullable`1 managedEntityId)
   at Microsoft.EnterpriseManagement.TaskConfigurationManagement.GetTasksInternal(ManagementPackTaskCriteria criteria, IList`1 targetTypeIds, BaseClassTraversalDepth baseClassTraversalDepth)
   at Microsoft.EnterpriseManagement.TaskConfigurationManagement.GetTasksInternal(ManagementPackTaskCriteria criteria)
   at Microsoft.EnterpriseManagement.TaskConfigurationManagement.GetTasks(ManagementPackTaskCriteria criteria)
   at Microsoft.ServiceManager.WorkflowAuthoring.Common.ManagementGroupHelper.GetTaskGuid(String taskName, String mgmtGroupName)
   at Microsoft.ServiceManager.WorkflowAuthoring.ActivityLibrary.WindowsPowerShellScript.InitializeRunTaskActivity()
   at Microsoft.ServiceManager.WorkflowAuthoring.ActivityLibrary.WindowsPowerShellScript.Execute(ActivityExecutionContext executionContext)
   at System.Workflow.ComponentModel.ActivityExecutor`1.Execute(T activity, ActivityExecutionContext executionContext)
   at System.Workflow.ComponentModel.CompositeActivityExecutor`1.Execute(T activity, ActivityExecutionContext executionContext)
   at System.Workflow.ComponentModel.ActivityExecutor`1.Execute(Activity activity, ActivityExecutionContext executionContext)
   at System.Workflow.ComponentModel.ActivityExecutorOperation.Run(IWorkflowCoreRuntime workflowCoreRuntime)
   at System.Workflow.Runtime.Scheduler.Run()

and fails

I ve restarted al system center service manager services, an reimported the workflows but fails again.

any suggestions?

Tks. Regards,


February 11th, 2015 12:21am

Any reply?
Free Windows Admin Tool Kit Click here and download it now
February 11th, 2015 6:56pm

Do you have multiple management servers in place? Did you try to restart all 3 SCSM services on all management servers? It looks like the configuration is out-of-sync...
February 11th, 2015 7:22pm

I dont have multiple management servers, and yes, ive tried to restart all scsm service and dont work, the workflow takes about 30 minutes and fails but isn't the scrip code :(
Free Windows Admin Tool Kit Click here and download it now
February 11th, 2015 7:33pm

Can you share the MP XML code?
February 11th, 2015 7:53pm

<ManagementPack ContentReadable="true" SchemaVersion="2.0" OriginalSchemaVersion="1.1" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <Manifest>
    <Identity>
      <ID>WORKFSSINT</ID>
      <Version>1.0.0.0</Version>
    </Identity>
    <Name>WORKFSSINT</Name>
    <References>
      <Reference Alias="System">
        <ID>System.Library</ID>
        <Version>7.5.8501.0</Version>
        <PublicKeyToken>31bf3856ad364e35</PublicKeyToken>
      </Reference>
      <Reference Alias="Console">
        <ID>Microsoft.EnterpriseManagement.ServiceManager.UI.Console</ID>
        <Version>7.5.1561.0</Version>
        <PublicKeyToken>31bf3856ad364e35</PublicKeyToken>
      </Reference>
      <Reference Alias="System_WorkItem_ServiceRequest_Library">
        <ID>System.WorkItem.ServiceRequest.Library</ID>
        <Version>7.5.1561.0</Version>
        <PublicKeyToken>31bf3856ad364e35</PublicKeyToken>
      </Reference>
      <Reference Alias="EnterpriseManagement">
        <ID>Microsoft.EnterpriseManagement.ServiceManager.UI.Administration</ID>
        <Version>7.5.1561.0</Version>
        <PublicKeyToken>31bf3856ad364e35</PublicKeyToken>
      </Reference>
      <Reference Alias="SystemCenter">
        <ID>Microsoft.SystemCenter.Library</ID>
        <Version>7.0.8427.0</Version>
        <PublicKeyToken>31bf3856ad364e35</PublicKeyToken>
      </Reference>
      <Reference Alias="SystemCenter1">
        <ID>Microsoft.SystemCenter.Subscriptions</ID>
        <Version>7.5.1561.0</Version>
        <PublicKeyToken>31bf3856ad364e35</PublicKeyToken>
      </Reference>
      <Reference Alias="System_WorkItem_Library">
        <ID>System.WorkItem.Library</ID>
        <Version>7.5.1561.0</Version>
        <PublicKeyToken>31bf3856ad364e35</PublicKeyToken>
      </Reference>
      <Reference Alias="Core">
        <ID>ServiceManager.Core.Library</ID>
        <Version>7.5.1561.0</Version>
        <PublicKeyToken>31bf3856ad364e35</PublicKeyToken>
      </Reference>
      <Reference Alias="Windows">
        <ID>Microsoft.Windows.Library</ID>
        <Version>7.5.8501.0</Version>
        <PublicKeyToken>31bf3856ad364e35</PublicKeyToken>
      </Reference>
    </References>
  </Manifest>
  <TypeDefinitions>
    <ModuleTypes>
      <WriteActionModuleType ID="WORKF_SS_INT.WindowsPowerShellScript.8cd2c343_eb19_4b80_8606_ea2648090234.MT" Accessibility="Public" RunAs="Core!Microsoft.SystemCenter.ServiceManager.WorkflowAccount" Batching="false">
        <Configuration>
          <IncludeSchemaTypes>
            <SchemaType>Windows!Microsoft.Windows.PowerShellSchema</SchemaType>
          </IncludeSchemaTypes>
          <xsd:element name="srID" type="xsd:string" xmlns:xsd="http://www.w3.org/2001/XMLSchema" />
        </Configuration>
        <OverrideableParameters>
          <OverrideableParameter ID="srID" Selector="$Config/srID$" ParameterType="string" />
        </OverrideableParameters>
        <ModuleImplementation Isolation="Any">
          <Composite>
            <MemberModules>
              <WriteAction ID="WORKF_SS_INT.WindowsPowerShellScript.8cd2c343_eb19_4b80_8606_ea2648090234.PSWA" TypeID="Windows!Microsoft.Windows.PowerShellWriteAction">
                <ScriptName>DoWork.ps1</ScriptName>
                <ScriptBody>param ( [string]$srID )
Param(
     [Parameter()][string]$srID
 )
 
Import-Module SMLets -Force
 

$srClass = Get-SCSMClass System.WorkItem.ServiceRequest$
$srObj = Get-SCSMObject -Class $srClass | Where {$_.NAME -eq $srID}
$wiContainsActivity = Get-SCSMRelationshipClass System.WorkItemContainsActivity
$activities = Get-SCSMRelatedObject -SMObject $srObj -Relationship $wiContainsActivity
$solicitud = $srObj.SolicitudesINT.DisplayName
if ($solicitud -ne $null){
    $csvfolder = "E:\CSV"
    $csvdata = Import-Csv $($csvfolder + "\SolicitudesInternas.csv") -Delimiter ";" | ?{$_.Solicitud -eq $solicitud}
    if (!$csvdata) {
         Set-ScsmObject $srObj -Property Status -Value "Cancelado"
    }else{
        $csvactivities = $csvdata.Actividades.Split(',')
        $Enabled = $csvdata.Enabled.Split(',')
        $csvPriority = $csvdata.Prioridad
        $priority = Get-SCSMEnumeration -Name ServiceRequestPriorityEnum | Get-SCSMChildEnumeration | Where-Object {$_.DisplayName -eq $csvPriority}
        $SupportGroup = $csvdata.GrupoSoporte
        $Urgency = $csvdata.Urgencia
        Set-ScsmObject $srObj -Property Title -Value $solicitud
        Set-ScsmObject $srObj -Property Priority -Value $priority
        Set-ScsmObject $srObj -Property SupportGroup -Value $SupportGroup
        Set-ScsmObject $srObj -Property Urgency -Value $Urgency
        $counter = 0
        foreach ($record in $csvactivities) {
            if ($Enabled[$counter] -eq 0) {
                Remove-SCSMObject $($activities | ?{$_.Title -eq $record}) -Confirm:$False -Force
            }
            else {
                Set-ScsmObject $($activities | ?{$_.Title -eq $record}) -Property Skip -Value $False
            }
        $counter++
        }
        while (((Get-SCSMRelatedObject -SMObject $srObj -Relationship $wiContainsActivity).Skip).Count -gt 0) {
        Start-Sleep -Seconds 5
        }
        $activities = Get-SCSMRelatedObject -SMObject $srObj -Relationship $wiContainsActivity
        $count = 1
        $act = $activities | Where-Object {$_.SequenceID -eq 1}
        while ($act -eq $null) {
            $count++
            $act = $activities | Where-Object {$_.SequenceID -eq $count}
        }
        Set-ScsmObject $($activities | ?{$_.Title -eq "Activity"}) -Property Status -Value "Completed"
        while (($act.Status.DisplayName) -ne "In Progress") {
            Start-Sleep -Seconds 5
            $activities = Get-SCSMRelatedObject -SMObject $srObj -Relationship $wiContainsActivity
            $act = $activities | Where-Object {$_.SequenceID -eq $count}
        }
        Set-ScsmObject $($activities | ?{$_.Title -eq "Activity"}) -Property Skip -Value $True 
        Remove-SCSMObject $($activities | ?{$_.Title -eq "Activity"}) -Confirm:$False -Force 
    }
}
if ($srID) {Remove-Variable srID}
if ($srClass) {Remove-Variable srClass}
if ($srObj) {Remove-Variable srObj}
if ($wiContainsActivity) {Remove-Variable wiContainsActivity}
if ($activities) {Remove-Variable activities}
if ($solicitud) {Remove-Variable solicitud}
if ($csvfolder) {Remove-Variable csvfolder}
if ($csvdata) {Remove-Variable csvdata}
if ($csvactivities) {Remove-Variable csvactivities}
if ($Enabled) {Remove-Variable Enabled}
if ($csvPriority) {Remove-Variable csvPriority}
if ($priority) {Remove-Variable priority}
if ($SupportGroup) {Remove-Variable SupportGroup}
if ($Urgency) {Remove-Variable Urgency}
if ($counter) {Remove-Variable counter}
if ($record) {Remove-Variable record}
if ($act) {Remove-Variable act}
Remove-Module SMLets -Force</ScriptBody>
                <SnapIns></SnapIns>
                <Parameters>
                  <Parameter>
                    <Name>srID</Name>
                    <Value>$Config/srID$</Value>
                  </Parameter>
                </Parameters>
                <TimeoutSeconds>900</TimeoutSeconds>
                <StrictErrorHandling>true</StrictErrorHandling>
                <SerializationDepth>3</SerializationDepth>
              </WriteAction>
            </MemberModules>
            <Composition>
              <Node ID="WORKF_SS_INT.WindowsPowerShellScript.8cd2c343_eb19_4b80_8606_ea2648090234.PSWA" />
            </Composition>
          </Composite>
        </ModuleImplementation>
        <InputType>System!System.BaseData</InputType>
      </WriteActionModuleType>
    </ModuleTypes>
  </TypeDefinitions>
  <Categories>
    <Category ID="WORKFSSINT.Category" Value="Console!Microsoft.EnterpriseManagement.ServiceManager.ManagementPack">
      <ManagementPackName>WORKFSSINT</ManagementPackName>
      <ManagementPackVersion>1.0.0.0</ManagementPackVersion>
    </Category>
    <Category ID="WORKF_SS_INTCategory" Target="WORKF_SS_INT" Value="EnterpriseManagement!Microsoft.EnterpriseManagement.ServiceManager.Rules.WorkflowSubscriptions" />
  </Categories>
  <Monitoring>
    <Rules>
      <Rule ID="WORKF_SS_INT" Enabled="true" Target="SystemCenter!Microsoft.SystemCenter.SubscriptionWorkflowTarget" ConfirmDelivery="true" Remotable="true" Priority="Normal" DiscardLevel="100">
        <Category>Notification</Category>
        <DataSources>
          <DataSource ID="DS" TypeID="SystemCenter1!Microsoft.SystemCenter.CmdbInstanceSubscription.DataSourceModule">
            <Subscription>
              <InstanceSubscription Type="$MPElement[Name='System_WorkItem_ServiceRequest_Library!System.WorkItem.ServiceRequest']$">
                <AddInstance></AddInstance>
              </InstanceSubscription>
              <PollingIntervalInSeconds>60</PollingIntervalInSeconds>
              <BatchSize>100</BatchSize>
            </Subscription>
          </DataSource>
        </DataSources>
        <WriteActions>
          <WriteAction ID="WA" TypeID="SystemCenter1!Microsoft.EnterpriseManagement.SystemCenter.Subscription.WindowsWorkflowTaskWriteAction">
            <Subscription>
              <WindowsWorkflowConfiguration>
                <AssemblyName>WORKF_SS_INT</AssemblyName>
                <WorkflowTypeName>WorkflowAuthoring.WORKF_SS_INT</WorkflowTypeName>
                <WorkflowParameters>
                  <WorkflowParameter Name="ScriptSSINT_srID" Type="string">$Data/Property[@ID='$MPElement[Name="System_WorkItem_Library!System.WorkItem"]/Id$' and @State='Post']$</WorkflowParameter>
                </WorkflowParameters>
                <RetryExceptions></RetryExceptions>
                <RetryDelaySeconds>60</RetryDelaySeconds>
                <MaximumRunningTimeSeconds>300</MaximumRunningTimeSeconds>
              </WindowsWorkflowConfiguration>
            </Subscription>
          </WriteAction>
        </WriteActions>
      </Rule>
    </Rules>
    <Tasks>
      <Task ID="WORKF_SS_INT.WindowsPowerShellScript.8cd2c343_eb19_4b80_8606_ea2648090234" Accessibility="Public" Enabled="true" Target="Windows!Microsoft.Windows.Computer" Timeout="900" Remotable="true">
        <Category>Notification</Category>
        <WriteAction ID="WORKF_SS_INT.WindowsPowerShellScript.8cd2c343_eb19_4b80_8606_ea2648090234.WA" TypeID="WORKF_SS_INT.WindowsPowerShellScript.8cd2c343_eb19_4b80_8606_ea2648090234.MT">
          <srID></srID>
        </WriteAction>
      </Task>
    </Tasks>
  </Monitoring>
  <LanguagePacks>
    <LanguagePack ID="ENU" IsDefault="true">
      <DisplayStrings>
        <DisplayString ElementID="WORKFSSINT">
          <Name>WORKFSSINT</Name>
        </DisplayString>
        <DisplayString ElementID="WORKF_SS_INT">
          <Name>WORKF_SS_INT</Name>
          <Description></Description>
        </DisplayString>
        <DisplayString ElementID="WORKF_SS_INT.WindowsPowerShellScript.8cd2c343_eb19_4b80_8606_ea2648090234">
          <Name>WORKF_SS_INT.WindowsPowerShellScript.8cd2c343_eb19_4b80_8606_ea2648090234</Name>
        </DisplayString>
      </DisplayStrings>
    </LanguagePack>
  </LanguagePacks>
</ManagementPack>
Free Windows Admin Tool Kit Click here and download it now
February 11th, 2015 8:01pm

Hmm... everything looks good here... I am running out of ideas. Could it be that SQL Broker is disabled for the ServiceManager database?

SELECT name, is_broker_enabled FROM sys.databases WHERE name = 'ServiceManager'

If is_broker_enabled returns 0, enable it:

ALTER DATABASE ServiceManager SET ENABLE_BROKER WITH ROLLBACK IMMEDIATE

February 11th, 2015 8:12pm

When i have executed the query, is_broker_enabled returned 0 and i executed the ALTER query to enable it.

But i have seen a problem, when i create the service request it keep on new state and no continue to In progress.

it happened before execute the query.



Free Windows Admin Tool Kit Click here and download it now
February 11th, 2015 10:40pm

SQL broker is required by SCSM to get notifications about changes in the database. Did you restart the 3 SCSM services after running the query? I expect your workflows should start again.
February 11th, 2015 11:27pm

I cannot reset the services in this moment but in a few hours i will notify you the result, i think that it affects too :

http://www.systemcentercentral.com/scsm-2012-tip-all-workflows-stuck-in-new-status-and-never-completing-issue-and-workaround/


  • Marked as answer by DANIELVIVAS92 Wednesday, February 11, 2015 10:22 PM
Free Windows Admin Tool Kit Click here and download it now
February 11th, 2015 11:46pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics