uSync Import Error
This article describes some known issues in the usync import process.
This article describes some known issues in the usync import process. In Particular, uSync Import thows an error on some content pages and doesn't seem to import any content on any other pages even though it says its imported and published successfully.
Symptoms
During import, some content pages may throw an error similar to the following (as can be seen from the logs):
"ContentHandler": Import Failed : "Newtonsoft.Json.JsonSerializationException: Cannot deserialize the current JSON array (e.g. [1,2,3]) into type 'Umbraco.Cms.Core.Models.Blocks.BlockValue' because the type requires a JSON object (e.g. {\"name\":\"value\"}) to deserialize correctly. To fix this error either change the JSON to a JSON object (e.g. {\"name\":\"value\"}) or change the deserialized type to an array or a type that implements a collection interface (e.g. ICollection, IList) like List<T> that can be deserialized from a JSON array. JsonArrayAttribute can also be added to the type to force it to deserialize from a JSON array. Path '', line 1, position 1.
uSync itself also reports the first part of this error "Cannot deserialize the current JSON array (e.g. [1,2,3]) into type 'Umbraco.Cms.Core.Models.Blocks.BlockValue'"
Causes
The cause for this is one of the earlier upgrades of the portal where the button configuration was updated to allow multiple update fields. If you created a page in the portal before this upgrade, and have not modified the page since, then the uSync export inclorrectly exports the button structure (even if there are no custom buttons defined) in the old format. During the import the old format can then not be parsed to the new format.
Identifying the Issue
Look for the error described above during the uSync import process. You may also experience content on pages that import successfully have in fact not been updated.
Impact
This only affects pages created before the particular upgrade, and not changes since then.
Workaround
The workaround requires a change to the button configuration, followed by a publish, then undo the change and publish again. It seems that pages without buttons are mostly affected, so naviagte through the list of Dynamics Form pages, go to the button section, and if it doesn't have a custom button, add one (you only need to specify a label), then save and publish, then remove the button, and save and publish again. Once you have updated all the Dynamics Forms pages in this manner, you can run the export again and import to the target environment, and ensure the error does not occur again. There might be unpublished pages or pages in the recycling bin that still cause the issue. Either update these pages in a similar manner or remove them from the environment if they are no longer used.
Last updated on