Import results in error - Unexpected character encountered while parsing value
We're using uSync ((uSync.BackOffice 4.0.14.0) (uSync.Core 6.0.14.0) [uSync.Content: 4.1.8.0]) on an Umbraco 7.15.3 site. Our intention is to allow our editor to make back office changes in our dev environment and then use uSync to migrate those edits into our test environment (and ultimately to prod if this works out).
We've turned off import on start.
When we migrate the updated uSync files from the dev environment to the test environment and run the Report to see the changes it correctly picks up the changes to be applied. However, when we Import (either just the changes or a full import) the following error is being thrown:
"Error: An error has occurred. - Unexpected character encountered while parsing value: <. Path '', line 0, position 0."
Something is having trouble parsing the JSON in the uSync files. I can post a full call stack if necessary.
Does anyone know what might be the issue? This is a relatively new site - we're not dealing with 2 separate databases with huge content/data type differences between them.
if you can, feel free to post that file. As you say it's probably a bit of JSON parsing somewhere - but if we can isolate it - we should be able to fix it quicker.
I've set the Jumoo namespace to DEBUG logging as indicated and re-ran the import. Here's the call stack from the log.
2020-01-13 14:12:39,107 [P6808/D2/T14] INFO Jumoo.uSync.BackOffice.Logging - Handler Import Complete: 0 Items 0 changes 0 failures
2020-01-13 14:12:39,107 [P6808/D2/T14] DEBUG Jumoo.uSync.BackOffice.uSyncApplicationEventHandler - # Handler uSync: MacroHandler Complete (1ms)
2020-01-13 14:12:39,107 [P6808/D2/T14] DEBUG Jumoo.uSync.BackOffice.uSyncApplicationEventHandler - Handler: uSync: MediaHandler import = True
2020-01-13 14:12:39,107 [P6808/D2/T14] DEBUG Jumoo.uSync.BackOffice.uSyncApplicationEventHandler - # Import Calling Handler: uSync: MediaHandler
2020-01-13 14:12:39,107 [P6808/D2/T14] DEBUG Jumoo.uSync.BackOffice.Logging - Running Content Import: Media
2020-01-13 14:12:39,107 [P6808/D2/T14] DEBUG Jumoo.uSync.BackOffice.uSyncAction - Getting Actions: for type Umbraco.Core.Models.IMedia from 7 actions, found 0
2020-01-13 14:12:39,107 [P6808/D2/T14] DEBUG Jumoo.uSync.Content.ContentHandler - Import Folder: D:\Clients\HeliosWE\Test\uSync\data\Media -1
2020-01-13 14:12:39,107 [P6808/D2/T14] DEBUG Jumoo.uSync.Content.ContentHandler - Import Folder: D:\Clients\HeliosWE\Test\uSync\data\Media\placeholders -1
2020-01-13 14:12:39,107 [P6808/D2/T14] DEBUG Jumoo.uSync.Content.MediaHandler - Importing Media: D:\Clients\HeliosWE\Test\uSync\data\Media\placeholders\media.config -1
2020-01-13 14:12:39,107 [P6808/D2/T14] DEBUG Jumoo.uSync.Core.Serializers.MediaSerializer - Using IsNewer Checker
2020-01-13 14:12:39,107 [P6808/D2/T14] DEBUG Jumoo.uSync.Content.ContentHandler - Import Folder: D:\Clients\HeliosWE\Test\uSync\data\Media\placeholders\placeholder 1074
2020-01-13 14:12:39,107 [P6808/D2/T14] DEBUG Jumoo.uSync.Content.MediaHandler - Importing Media: D:\Clients\HeliosWE\Test\uSync\data\Media\placeholders\placeholder\media.config 1074
2020-01-13 14:12:39,122 [P6808/D2/T14] DEBUG Jumoo.uSync.Core.Serializers.MediaSerializer - Using IsNewer Checker
2020-01-13 14:12:39,122 [P6808/D2/T14] DEBUG Jumoo.uSync.Content.ContentHandler - Import Folder: D:\Clients\HeliosWE\Test\uSync\data\Media\placeholders\placeholder-dark 1074
2020-01-13 14:12:39,122 [P6808/D2/T14] DEBUG Jumoo.uSync.Content.MediaHandler - Importing Media: D:\Clients\HeliosWE\Test\uSync\data\Media\placeholders\placeholder-dark\media.config 1074
2020-01-13 14:12:39,122 [P6808/D2/T14] DEBUG Jumoo.uSync.Core.Serializers.MediaSerializer - Using IsNewer Checker
2020-01-13 14:12:39,122 [P6808/D2/T14] DEBUG Jumoo.uSync.BackOffice.uSyncApplicationEventHandler - # Handler uSync: MediaHandler Complete (14ms)
2020-01-13 14:12:39,122 [P6808/D2/T14] DEBUG Jumoo.uSync.BackOffice.uSyncApplicationEventHandler - Handler: uSync: ContentHandler import = True
2020-01-13 14:12:39,122 [P6808/D2/T14] DEBUG Jumoo.uSync.BackOffice.uSyncApplicationEventHandler - # Import Calling Handler: uSync: ContentHandler
2020-01-13 14:12:39,122 [P6808/D2/T14] DEBUG Jumoo.uSync.BackOffice.Logging - Running Content Import: Content
2020-01-13 14:12:39,122 [P6808/D2/T14] DEBUG Jumoo.uSync.BackOffice.uSyncAction - Getting Actions: for type Umbraco.Core.Models.IContent from 7 actions, found 0
2020-01-13 14:12:39,122 [P6808/D2/T14] DEBUG Jumoo.uSync.Content.ContentHandler - Import Folder: D:\Clients\HeliosWE\Test\uSync\data\Content -1
2020-01-13 14:12:39,122 [P6808/D2/T14] DEBUG Jumoo.uSync.Content.ContentHandler - Import Folder: D:\Clients\HeliosWE\Test\uSync\data\Content\home -1
2020-01-13 14:12:39,122 [P6808/D2/T14] DEBUG Jumoo.uSync.Content.ContentHandler - Importing Content : D:\Clients\HeliosWE\Test\uSync\data\Content\home\content.config -1
2020-01-13 14:12:39,122 [P6808/D2/T14] DEBUG Jumoo.uSync.Core.Serializers.ContentSerializer - Using IsNewer Checker
2020-01-13 14:12:39,122 [P6808/D2/T14] DEBUG Jumoo.uSync.Content.ContentHandler - Import Folder: D:\Clients\HeliosWE\Test\uSync\data\Content\home\publications 1077
2020-01-13 14:12:39,122 [P6808/D2/T14] DEBUG Jumoo.uSync.Content.ContentHandler - Importing Content : D:\Clients\HeliosWE\Test\uSync\data\Content\home\publications\content.config 1077
2020-01-13 14:12:39,122 [P6808/D2/T14] DEBUG Jumoo.uSync.Core.Serializers.ContentSerializer - Using IsNewer Checker
2020-01-13 14:12:39,153 [P6808/D2/T14] ERROR Jumoo.uSync.BackOffice.Controllers.uSyncApiController - Unhandled controller exception occurred
Newtonsoft.Json.JsonReaderException: Unexpected character encountered while parsing value: <. Path '', line 0, position 0.
at Newtonsoft.Json.JsonTextReader.ParseValue()
at Newtonsoft.Json.JsonReader.ReadForType(JsonContract contract, Boolean hasConverter)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)
at Newtonsoft.Json.JsonConvert.DeserializeObject(String value, Type type, JsonSerializerSettings settings)
at Newtonsoft.Json.JsonConvert.DeserializeObject[T](String value, JsonSerializerSettings settings)
at Umbraco.Web.PropertyEditors.NestedContentPropertyEditor.NestedContentPropertyValueEditor.ConvertDbToString(Property property, PropertyType propertyType, IDataTypeService dataTypeService)
at Umbraco.Core.PropertyEditors.PropertyValueEditor.ConvertDbToXml(Property property, PropertyType propertyType, IDataTypeService dataTypeService)
at Umbraco.Core.Services.EntityXmlSerializer.Serialize(IDataTypeService dataTypeService, Property property)
at Umbraco.Core.Services.EntityXmlSerializer.Serialize(IDataTypeService dataTypeService, IContentBase contentBase, String nodeName)
at Umbraco.Core.Services.EntityXmlSerializer.Serialize(IContentService contentService, IDataTypeService dataTypeService, IUserService userService, IContent content, Boolean deep)
at Umbraco.Core.Services.ContentService.<Save>b__112_0(IContent c)
at Umbraco.Core.Persistence.Repositories.ContentPreviewRepository`1.PersistNewItem(ContentPreviewEntity`1 entity)
at Umbraco.Core.Persistence.UnitOfWork.ScopeUnitOfWork.Commit(Action`1 transactionCompleting)
at Umbraco.Core.Services.ContentService.Save(IContent content, Boolean changeState, Int32 userId, Boolean raiseEvents)
at Umbraco.Core.Services.ContentService.Umbraco.Core.Services.IContentServiceOperations.Save(IContent content, Int32 userId, Boolean raiseEvents)
at Umbraco.Core.Services.ContentService.Save(IContent content, Int32 userId, Boolean raiseEvents)
at Jumoo.uSync.Core.Serializers.ContentSerializer.DeserializeCore(XElement node, Int32 parentId, Boolean forceUpdate)
at Jumoo.uSync.Core.Serializers.ContentBaseSerializer`1.Deserialize(XElement node, Int32 parentId, Boolean forceUpdate)
at Jumoo.uSync.Content.ContentHandler.Import(String filePath, Int32 parentId, Boolean force)
at Jumoo.uSync.Content.BaseContentHandler`1.ImportFolder(String folder, Int32 parentId, Boolean force, Dictionary`2 updates)
at Jumoo.uSync.Content.BaseContentHandler`1.ImportFolder(String folder, Int32 parentId, Boolean force, Dictionary`2 updates)
at Jumoo.uSync.Content.BaseContentHandler`1.ImportFolder(String folder, Int32 parentId, Boolean force, Dictionary`2 updates)
at Jumoo.uSync.Content.BaseContentHandler`1.ImportAll(String folder, Boolean force)
at Jumoo.uSync.BackOffice.uSyncBackOfficeContext.Import(IEnumerable`1 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)
at lambda_method(Closure , Object , Object[] )
at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>c__DisplayClass6_2.<GetExecutor>b__2(Object instance, Object[] methodParameters)
at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ExecuteAsync(HttpControllerContext controllerContext, IDictionary`2 arguments, CancellationToken cancellationToken)
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Web.Http.Controllers.ApiControllerActionInvoker.<InvokeActionAsyncCore>d__1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__6.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__6.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Web.Http.Filters.ActionFilterAttribute.<ExecuteActionFilterAsyncCore>d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__6.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__6.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Web.Http.Filters.ActionFilterAttribute.<ExecuteActionFilterAsyncCore>d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__6.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__6.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Web.Http.Filters.ActionFilterAttribute.<ExecuteActionFilterAsyncCore>d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__6.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__6.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Web.Http.Filters.ActionFilterAttribute.<ExecuteActionFilterAsyncCore>d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__6.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__6.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Web.Http.Filters.ActionFilterAttribute.<ExecuteActionFilterAsyncCore>d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Web.Http.Controllers.ActionFilterResult.<ExecuteAsync>d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Web.Http.Filters.AuthorizationFilterAttribute.<ExecuteAuthorizationFilterAsyncCore>d__3.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Web.Http.Filters.AuthorizationFilterAttribute.<ExecuteAuthorizationFilterAsyncCore>d__3.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Web.Http.Filters.AuthorizationFilterAttribute.<ExecuteAuthorizationFilterAsyncCore>d__3.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Web.Http.Controllers.ExceptionFilterResult.<ExecuteAsync>d__6.MoveNext()
If I'm reading the stack correctly then the last Importing Content statement logged before the error was
Import results in error - Unexpected character encountered while parsing value
We're using uSync ((uSync.BackOffice 4.0.14.0) (uSync.Core 6.0.14.0) [uSync.Content: 4.1.8.0]) on an Umbraco 7.15.3 site. Our intention is to allow our editor to make back office changes in our dev environment and then use uSync to migrate those edits into our test environment (and ultimately to prod if this works out).
We've turned off import on start.
When we migrate the updated uSync files from the dev environment to the test environment and run the Report to see the changes it correctly picks up the changes to be applied. However, when we Import (either just the changes or a full import) the following error is being thrown:
Something is having trouble parsing the JSON in the uSync files. I can post a full call stack if necessary.
Does anyone know what might be the issue? This is a relatively new site - we're not dealing with 2 separate databases with huge content/data type differences between them.
Hi,
can you isolate which .config file is causing the issue?
if not first try turning logging up by adding the following to the log4net.config file
if you can, feel free to post that file. As you say it's probably a bit of JSON parsing somewhere - but if we can isolate it - we should be able to fix it quicker.
Hi Kevin,
I've set the Jumoo namespace to DEBUG logging as indicated and re-ran the import. Here's the call stack from the log.
If I'm reading the stack correctly then the last Importing Content statement logged before the error was
The content of that file is copied below:
I would have zipped up all of the relevant files and attached it to this post but it doesn't look like file attachments are a feature of this forum?
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.