uSync import error - Object reference not set to an instance of an object
We are currently using uSync but now have an environment where we get this below error in the logs when attempting an import
My question is - how can I trace WHICH element is causing this issue during the import? The debugging does not show which element is being processed when the error occurs
Many thanks
2019-03-04 11:09:34,497 [P1716/D7/T160] ERROR
Jumoo.uSync.BackOffice.Controllers.uSyncApiController - Unhandled
controller exception occurred System.NullReferenceException: Object
reference not set to an instance of an object. at
Jumoo.uSync.Core.Serializers.ContentTypeBaseSerializer1.DeserializeBase(IContentTypeBase
item, XElement info) at
Jumoo.uSync.Core.Serializers.ContentTypeSerializer.DeserializeCore(XElement
node) at
Jumoo.uSync.Core.Serializers.SyncBaseSerializer1.DeSerialize(XElement
node, Boolean forceUpdate) at
Jumoo.uSync.BackOffice.Handlers.ContentTypeHandler.Import(String
filePath, Boolean force) at
Jumoo.uSync.BackOffice.Handlers.uSyncBaseHandler1.ImportFolder(String
folder, Boolean force, Dictionary2 updates) at
Jumoo.uSync.BackOffice.Handlers.uSyncBaseHandler1.ImportFolder(String
folder, Boolean force, Dictionary2 updates) at
Jumoo.uSync.BackOffice.Handlers.uSyncBaseHandler1.ImportFolder(String
folder, Boolean force, Dictionary2 updates) at
Jumoo.uSync.BackOffice.Handlers.uSyncBaseHandler1.ImportFolder(String
folder, Boolean force, Dictionary2 updates) at
Jumoo.uSync.BackOffice.Handlers.uSyncBaseHandler1.ImportAll(String
folder, Boolean force) at
Jumoo.uSync.BackOffice.uSyncBackOfficeContext.Import(IEnumerable1
syncHandlers, String folder, Boolean checkConfig, Boolean force,
String groupName) at
Jumoo.uSync.BackOffice.uSyncBackOfficeContext.Import(String groupName,
String folder, Boolean force) at
Jumoo.uSync.BackOffice.uSyncBackOfficeContext.ImportAll(String folder,
Boolean force) at
Jumoo.uSync.BackOffice.Controllers.uSyncApiController.Import(Boolean
force)
I set the logger value to DEBUG and get this at the point it errors
I am assuming it is failing on the deletion of a DocumentType? How can I tell which is the offending element?
Mike
2019-03-07 05:24:31,007 [P7952/D2/T137] INFO
Jumoo.uSync.BackOffice.Logging - Running Import: DocumentType
2019-03-07 05:24:31,007 [P7952/D2/T137] INFO
Jumoo.uSync.BackOffice.Logging - Processing a Delete:
Umbraco.Core.Models.IContentType 2019-03-07 05:25:21,746
[P7952/D2/T137] INFO Jumoo.uSync.BackOffice.Logging - Processing a
Delete: Umbraco.Core.Models.IContentType 2019-03-07 05:25:21,750
[P7952/D2/T137] INFO Jumoo.uSync.BackOffice.Logging - Processing a
Delete: Umbraco.Core.Models.IContentType 2019-03-07 05:25:21,753
[P7952/D2/T137] INFO Jumoo.uSync.BackOffice.Logging - Processing a
Delete: Umbraco.Core.Models.IContentType 2019-03-07 05:25:21,759
[P7952/D2/T137] INFO Jumoo.uSync.BackOffice.Logging - Processing a
Delete: Umbraco.Core.Models.IContentType 2019-03-07 05:25:21,762
[P7952/D2/T137] INFO Jumoo.uSync.BackOffice.Logging - Processing a
Delete: Umbraco.Core.Models.IContentType 2019-03-07 05:25:21,767
[P7952/D2/T137] INFO Jumoo.uSync.BackOffice.Logging - Processing a
Delete: Umbraco.Core.Models.IContentType 2019-03-07 05:25:21,774
[P7952/D2/T137] INFO Jumoo.uSync.BackOffice.Logging - Processing a
Delete: Umbraco.Core.Models.IContentType 2019-03-07 05:25:21,777
[P7952/D2/T137] INFO Jumoo.uSync.BackOffice.Logging - Processing a
Delete: Umbraco.Core.Models.IContentType 2019-03-07 05:26:38,157
[P7952/D2/T137] ERROR
Jumoo.uSync.BackOffice.Controllers.uSyncApiController - Unhandled
controller exception occurred System.NullReferenceException: Object
reference not set to an instance of an object. at
Jumoo.uSync.Core.Serializers.ContentTypeBaseSerializer1.DeserializeBase(IContentTypeBase
item, XElement info) at
Jumoo.uSync.Core.Serializers.ContentTypeSerializer.DeserializeCore(XElement
node) at
Jumoo.uSync.Core.Serializers.SyncBaseSerializer1.DeSerialize(XElement
node, Boolean forceUpdate)
I actually think the error is with the very first item it is trying to process, the delete actions don't serialize - they just look for the key and if it's there delete it.
That the error is then in the serializers makes me think there is something wrong with the first file (or indeed something bigger that is hit as soon as it tries to read the file).
I've had a look through the code, and I think one possibility is that the master content item is missing - as it does look like we have missed a null check on that - so a workaround might be to delete the Key value from the <master> element in the file (it will look something like this just remove the key="" element)
this is a bit of a long shot, as in theory, you should never get to an import of an item where the master hasn't been created first as the imports are done based on the folder structure
I suppose it's possible the folder could be missing the master file - then I would recommend a full export to see if it fixes things.
uSync import error - Object reference not set to an instance of an object
We are currently using uSync but now have an environment where we get this below error in the logs when attempting an import
My question is - how can I trace WHICH element is causing this issue during the import? The debugging does not show which element is being processed when the error occurs
Many thanks
Is anything being saved in
~/app_data/temp/usync
? Might be some logs there showing the issue.Also according to this post:
https://our.umbraco.com/packages/developer-tools/usync/usync/80228-is-it-possible-to-see-more-verbose-information#comment-256419
it might be possible to get more information in the standard umbraco trace log by configuring log4net to log usync more verbosely.
Hope that helps,
Chris
Hi
if you up the logging level for uSync (in the log4net.config file add :
then you should see lots of logging, but more importantly what is happening when the error is thrown.
Thanks Kevin, really appreciate it
I set the logger value to DEBUG and get this at the point it errors
I am assuming it is failing on the deletion of a
DocumentType
? How can I tell which is the offending element?Mike
Hi Mike,
I actually think the error is with the very first item it is trying to process, the delete actions don't serialize - they just look for the key and if it's there delete it.
That the error is then in the serializers makes me think there is something wrong with the first file (or indeed something bigger that is hit as soon as it tries to read the file).
I've had a look through the code, and I think one possibility is that the master content item is missing - as it does look like we have missed a null check on that - so a workaround might be to delete the Key value from the
<master>
element in the file (it will look something like this just remove thekey=""
element)this is a bit of a long shot, as in theory, you should never get to an import of an item where the master hasn't been created first as the imports are done based on the folder structure
I suppose it's possible the folder could be missing the master file - then I would recommend a full export to see if it fixes things.
is working on a reply...