Replication of a Client Task policy fails with warning: Error getting task <Guid> to get it's Guid for serialization
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.
Description: Error getting task b900482d-50e3-4e16-b33c-2af31724b69fto 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)
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.