Error while writing serialized item - Serialized version contained a blank language value - Sitecore Serialization error in CLI
Sitecore Content Serialization (SCS) is a system for serializing, sharing, and deploying content items, as well as keeping them in version control. It combines best of both Unicorn and TDS tools used widely in Sitecore applications for content serialization. If you havent used it yet, you should give it a try and learn more from here.
The Problem
Recently, while performing a dotnet sitecore ser pull command to get latest updates of an item into source control, I got the below errors -
System.InvalidOperationException: Error while writing serialized item C:\projects\MyProbject.Website\src\Project\MyProjct\code\module\serialization\MySite\Home.yml
---> System.InvalidOperationException: Serialized version contained a blank language value!
So this looked familiar with invariant language issue where an item may have field values in a language that doesn't exist or to put simply no language or blank language. This makes the item an invalid item and hence, it fails the serializations checks and errors out
The Solution
To move ahead, we needed to get rid of the invariant language version for the item. It can be done in many ways. One of the simplest ways is using DB scripts.
There are entries in the VersionedFields table that causes it. We can get rid of them by executing below SQL statements on both your Master and Web databases respectively.
DELETE FROM [Sitecore.Master].[dbo].[VersionedFields] WHERE [Language] = ''
DELETE FROM [Sitecore.Web].[dbo].[VersionedFields] WHERE [Language] = ''
You may also want to run these scripts against UnversionedFields table too. After making these changes on SQL level, we need to ensure that we reset IIS to clear the cache.
This fixed the problem for us and we could a clean pull of items without any issues. Hope it helps you too!
Comments
Post a Comment