Running CI Restore fails for "Content item common data"
I made some content type changes which were reflected in the application's CI repository but after the changes were made I cannot successfully run a CI Restore.
The restore fails with the following exception:
Message: Restoration of object type "Content item common data" failed during objects' insertion and update. See inner exception for further details.
Exception type: CMS.ContinuousIntegration.ObjectTypeSerializationException
Stack trace:
at CMS.ContinuousIntegration.Internal.FileSystemRestoreJobBase.TryRun(Action`2 method, String objectType, String exceptionMessageFormat, CancellationToken cancellationToken)
at CMS.ContinuousIntegration.Internal.FileSystemRestoreAllJob.<>c__DisplayClass2_0.<CreateAndUpsertObjects>b__0(String objectType)
at CMS.ContinuousIntegration.Internal.AbstractFileSystemJob.<>c__DisplayClass38_0`1.<CancellableForEach>b__0(T item, Int32 _)
at CMS.ContinuousIntegration.Internal.AbstractFileSystemJob.CancellableForEach[T](IEnumerable`1 collection, Action`2 action, CancellationToken cancellationToken)
at CMS.ContinuousIntegration.Internal.AbstractFileSystemJob.CancellableForEach[T](IEnumerable`1 collection, Action`1 action, CancellationToken cancellationToken)
at CMS.ContinuousIntegration.Internal.FileSystemRestoreAllJob.CreateAndUpsertObjects(IEnumerable`1 orderedObjectTypes, CancellationToken cancellationToken)
at CMS.ContinuousIntegration.Internal.FileSystemRestoreAllJob.RunInternal(CancellationToken cancellationToken)
at CMS.ContinuousIntegration.Internal.AbstractFileSystemAllJob.Run(Nullable`1 cancellationToken)
Message: Restoration of object type "Content item common data" (cms.contentitemcommondata) failed for object "aeb0e246-019e-46d4-b639-26d367a3f8ca" (ContentItemCommonDataID: 2). See inner exception for further details.
Exception type: CMS.ContinuousIntegration.ObjectTypeSerializationException
Stack trace:
at CMS.ContinuousIntegration.Internal.FileSystemChangedObjectsByTypeJobBase.ProcessChangedObject(DeserializedObject deserializedObject, String logMessageFormat)
at CMS.ContinuousIntegration.Internal.FileSystemChangedObjectsByTypeJobBase.<>c__DisplayClass15_0.<ProcessChangedObjects>b__0(DeserializedObject deserializedObject)
at CMS.ContinuousIntegration.Internal.AbstractFileSystemJob.<>c__DisplayClass38_0`1.<CancellableForEach>b__0(T item, Int32 _)
at CMS.ContinuousIntegration.Internal.AbstractFileSystemJob.CancellableForEach[T](IEnumerable`1 collection, Action`2 action, CancellationToken cancellationToken)
at CMS.ContinuousIntegration.Internal.AbstractFileSystemJob.CancellableForEach[T](IEnumerable`1 collection, Action`1 action, CancellationToken cancellationToken)
at CMS.ContinuousIntegration.Internal.FileSystemChangedObjectsByTypeJobBase.ProcessChangedObjects(String objectType, IEnumerable`1 objects, CancellationToken cancellationToken)
at CMS.ContinuousIntegration.Internal.FileSystemUpsertObjectsByTypeJob.RunInternal(String objectType, ISet`1 fileLocations, CancellationToken cancellationToken)
at CMS.ContinuousIntegration.Internal.AbstractFileSystemTypeWideJob.Run(String objectType, ISet`1 fileLocations, Nullable`1 cancellationToken)
at CMS.ContinuousIntegration.Internal.FileSystemRestoreObjectsByTypeInternalJob.RunUpsertObjectsByTypeJob()
at CMS.ContinuousIntegration.Internal.FileSystemRestoreAllJob.CreateAndUpsert(String objectType, CancellationToken cancellationToken)
at CMS.ContinuousIntegration.Internal.FileSystemRestoreJobBase.TryRun(Action`2 method, String objectType, String exceptionMessageFormat, CancellationToken cancellationToken)
Message: Column 'ContentItemReferenceTargetItemID' does not allow DBNull.Value.
Environment
- Xperience by Kentico version: [29.4.1]
- .NET version: [8]
- Deployment environment: [SaaS]
- Link to relevant Xperience by Kentico documentation
Answers
TLDR;
It turns out this is related to deleting a referenced content item. I needed to re-publish the content item that linked to the deleted content item.
Here's an example:
I have a content type, named AuthorContent
, that references other content items in field using the Content items data type. Let's call this field AuthorContentImage
and it references content items of a MediaAssetContent
content type.
I deleted a referenced MediaAssetContent
content item from the Content hub, which is the source of the problem.
Xperience tracks content item references in the cms.contentitemcommondata
CI repository file under the <ContentItemReferences>
XML node but this node is not updated when a referenced content item is deleted from the Content hub.
To resolve the problem, I updated the AuthorContent
content item in the Content hub by creating a new draft version and publishing it with no changes. This updated the serialized version of this content item in the CI Repository and updated the <ContentItemReferences>
node in the cms.contentitemcommondata
file.
I then ran the CI Restore and it succeeded.
To answer this question, you have to login first.