Replication of an MSD policy fails with warning: Error getting task <Guid> to get it's Guid for serialization
search cancel

Replication of an MSD policy fails with warning: Error getting task <Guid> to get it's Guid for serialization

book

Article ID: 163278

calendar_today

Updated On:

Products

IT Management Suite

Issue/Introduction

Replication of a Client Task policy fails with warning: 

Error getting task <Guid> to get it's Guid for serialization

NS Log entry:

Process: AeXSvc (15828)

Thread: 276

Module: AeXSVC.exe

Source: Altiris.TaskManagement.Jobs.ServerTaskJobNode.OnToXml

Description: Error getting task b900482d-50e3-4e16-b33c-2af31724b69f to get it's Guid for serialization: Altiris.TaskManagement.Exceptions.ItemVersionNotFoundException: Error in the application.

   at Altiris.TaskManagement.ItemVersionCache.LoadVersion(ItemVersionGuid itemVersionGuid)

   at Altiris.TaskManagement.ItemVersionCache.InternalGetItemVersionFromDatabase(Object context)

   at Altiris.DotNetLib.Collections.SafeObjectCache.GetObject(Type objectType, Guid objectGuid, AltirisGetObjectDelegate delegateIfNotExist, Object delegateContextData)

   at Altiris.TaskManagement.ItemVersionCache.InternalGetItemVersion(Guid itemOrVersionGuid, Boolean strict)

   at Altiris.TaskManagement.VersionItem.GetVersion(ItemVersionGuid versionGuid, Boolean strict)

   at Altiris.TaskManagement.Jobs.ServerTaskJobNode.OnToXml(XmlTextWriter wr)

Problem Scenario:

  • A Client Task item was created in a test environment.
  • Once it was determined that the task worked as desired it was exported to an xml file and imported to the parent SMP in a hierarchy.
  • When Replication runs, or if the item is manually replicated (Right-Click > Hierarchy > Replicate Now) the Client Task does not replicate. But with each attempt to replicate the Client Task—a warning similar to the following is thrown in the logs as the replication engine attempts to export it.

Environment

ITMS 8.x

Cause

The Client Task was repeatedly tested, proved and modified in the original test environment. The result was that many versions were generated as well as many individual tasks, which are written the “State” column in the ItemVersionData table for the current version at the time of the task’s creation.

When the Client Task was exported all of the versions were exported with it. Within each of these versions (in the state column) were references to the original tasks created during testing.

When the Client Task was imported to the parent the import engine did not, and does not verify if anything referenced in the individual versions exists.  But when it is being exported during replication the replication engine does check for dependent tasks referenced in each version.

The task version(s) contained in some of the older versions (versions 32 & 33 of 37). As a result the entire Client Task could not be exported for replication. It is all or nothing. 

Plugging the GUID of the MSD policy into the following query and running it against the database showed that the Client Task had 37 distinct versions as it was exported from the test environment:

declare @Guid uniqueidentifier

set @Guid = '55AD589A-E0CC-4054-BC19-24DC925BC20D'

select i.Name, iv.VersionGuid, iv.Version, CAST(ivd.State as xml) State

from vItem i

join ItemVersions iv on iv.ItemGuid = i.Guid

left join ItemVersionData ivd on ivd.VersionGuid = iv.VersionGuid

where i.Guid = @Guid

order by 3

The following revised query showed that versions 32 & 33 contained references to the task version returned in the log warning:

declare @Guid uniqueidentifier

set @Guid = '55AD589A-E0CC-4054-BC19-24DC925BC20D'

select i.Name, iv.VersionGuid, iv.Version, CAST(ivd.State as xml) State

from vItem i

join ItemVersions iv on iv.ItemGuid = i.Guid

left join ItemVersionData ivd on ivd.VersionGuid = iv.VersionGuid

where i.Guid = @Guid

and ivd.State like '%b900482d-50e3-4e16-b33c-2af31724b69f"%'

order by 3

Resolution

The solution is to reduce the imported Client Task policy/task down to one version (the latest) on the parent SMP server.

  1. Run the “Cleanup Version Data” task found under “Settings > All Settings > Notification Server > Task Settings” and set the number of versions to keep as 1 as seen here:



  2. After reducing to the most current version as the only version the policy/task, run a replication so you can verify the wanted client task policy replicated successfully.

Recommendations:  In the future it would be a good practice to reduce each task being exported to a single version before exporting them from the test environment.