Replication of a Client Task policy fails with warning: Error getting task <Guid> to get it's Guid for serialization
Problem Scenario:
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)
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
The solution was to reduce the imported Client Task policy/task down to one version (the latest) on the parent SMP.
This was done by running the “Cleanup Version Data” task found under “Settings > All Settings > Notification Server > Task Settings” and setting the number of versions to keep as 1.
After reducing to the most current version as the only version the policy/task 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.