Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Mike Poole 53 posts 165 karma points
    Mar 04, 2019 @ 11:25
    Mike Poole
    0

    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)

  • Chris Evans 137 posts 353 karma points c-trib
    Mar 04, 2019 @ 19:56
    Chris Evans
    0

    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

  • Kevin Jump 2310 posts 14695 karma points MVP 7x c-trib
    Mar 05, 2019 @ 10:53
    Kevin Jump
    0

    Hi

    if you up the logging level for uSync (in the log4net.config file add :

      <logger name="Jumoo.uSync">
        <level value="DEBUG" />
      </logger>
    

    then you should see lots of logging, but more importantly what is happening when the error is thrown.

  • Mike Poole 53 posts 165 karma points
    Mar 07, 2019 @ 07:41
    Mike Poole
    0

    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

    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)

  • Kevin Jump 2310 posts 14695 karma points MVP 7x c-trib
    Mar 07, 2019 @ 08:19
    Kevin Jump
    0

    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 the key="" element)

    <Master Key="5e0a25c0-fd3c-4d00-bf12-4fd7cd4aa3f8">myMasterItem</Master>
    

    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.

Please Sign in or register to post replies

Write your reply to:

Draft