uSyncMigrations icon indicating copy to clipboard operation
uSyncMigrations copied to clipboard

Errors Parsing the Config Data

Open markadrake opened this issue 1 year ago • 5 comments

Reference:

  • uSync 10.3.1.-beta001
  • uSync.Migrations 4.0.0-phase.2.1

Hi Everyone,

I'm running into an issue with this file, and potentially others after it, where the parsing seems to blow up.

image

Newtonsoft.Json.JsonReaderException: After parsing a value an unexpected character was encountered: 1. Path '[0].link', line 4, position 14.
   at Newtonsoft.Json.JsonTextReader.ParsePostValue(Boolean ignoreComments)
   at Newtonsoft.Json.JsonTextReader.Read()
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateList(IList list, JsonReader reader, JsonArrayContract contract, JsonProperty containerProperty, String id)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateList(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, Object existingValue, String id)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
   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 uSync.Migrations.Migrators.RelatedLinksMigrator.GetContentValue(SyncMigrationContentProperty contentProperty, SyncMigrationContext context)
   at uSync.Migrations.Handlers.Shared.SharedContentBaseHandler`1.MigrateContentValue(SyncMigrationContentProperty migrationProperty, SyncMigrationContext context)
   at uSync.Migrations.Handlers.Shared.SharedContentBaseHandler`1.ConvertPropertyValue(String itemType, String contentType, XElement property, SyncMigrationContext context)
   at uSync.Migrations.Handlers.Shared.SharedContentBaseHandler`1.MigrateFile(XElement source, Int32 level, SyncMigrationContext context)
   at uSync.Migrations.Handlers.MigrationHandlerBase`1.MigrateFolder(String folder, Int32 level, SyncMigrationContext context)

I believe the error is being reported with the very first link property:

  {
    "caption": "Credit Reports",
    "link": "18d02d55-6aa5-4689-b980-2ba3238658cd", // HERE
    "newWindow": false,
    "internal": "18d02d55-6aa5-4689-b980-2ba3238658cd",
    "edit": false,
    "isInternal": true,
    "internalName": "Credit Reports",
    "type": "internal",
    "title": "Credit Reports"
  },

I validated the JSON below in an external validator, just in case there was something my eyes didn't see. The JSON came back valid. Here is the entire config file for reference:

<?xml version="1.0" encoding="utf-8"?>
<membersOnlyHeaderShortcut guid="89a3cde2-c885-4f23-895e-4d6e4bd4b605" id="4063" nodeName="Reports" isDoc="" updated="2018-01-21T15:29:45.0270000Z" parentGUID="eba0bf09-2c38-4387-bc4c-bebc79a84595" nodeTypeAlias="membersOnlyHeaderShortcut" templateAlias="" sortOrder="1" published="true" isBlueprint="false">
  <commentToFirstApprover></commentToFirstApprover>
  <excludeFromSitemap>0</excludeFromSitemap>
  <excludeFromSiteSearch>0</excludeFromSiteSearch>
  <firstApprover><![CDATA[[
  6
]]]></firstApprover>
  <hasRunningWorkflow><![CDATA[No]]></hasRunningWorkflow>
  <links><![CDATA[[
  {
    "caption": "Credit Reports",
    "link": "18d02d55-6aa5-4689-b980-2ba3238658cd",
    "newWindow": false,
    "internal": "18d02d55-6aa5-4689-b980-2ba3238658cd",
    "edit": false,
    "isInternal": true,
    "internalName": "Credit Reports",
    "type": "internal",
    "title": "Credit Reports"
  },
  {
    "caption": "Deposit Reports",
    "link": "66473c23-240e-42f4-a6e9-afe112a4abef",
    "newWindow": false,
    "internal": "66473c23-240e-42f4-a6e9-afe112a4abef",
    "edit": false,
    "isInternal": true,
    "internalName": "Demand Deposit Reports",
    "type": "internal",
    "title": "Deposit Reports"
  },
  {
    "caption": "Safekeeping Reports",
    "link": "e4b9c55c-60ab-4a18-ac59-cb12ac7e780c",
    "newWindow": false,
    "internal": "e4b9c55c-60ab-4a18-ac59-cb12ac7e780c",
    "edit": false,
    "isInternal": true,
    "internalName": "Safekeeping/Pledge Reports",
    "type": "internal",
    "title": "Safekeeping Reports"
  },
  {
    "caption": "Funds Transfer Reports",
    "link": "d199b112-a54e-4a1d-863f-9a489cd7eb61",
    "newWindow": false,
    "internal": "d199b112-a54e-4a1d-863f-9a489cd7eb61",
    "edit": false,
    "isInternal": true,
    "internalName": "Funds Transfer Reports",
    "type": "internal",
    "title": "Funds Transfer Reports"
  },
  {
    "caption": "Capital Stock Reports",
    "link": "d23cdbce-106d-4408-9da7-7bdce4f5a83b",
    "newWindow": false,
    "internal": "d23cdbce-106d-4408-9da7-7bdce4f5a83b",
    "edit": false,
    "isInternal": true,
    "internalName": "Your Stock",
    "type": "internal",
    "title": "Capital Stock Reports"
  },
  {
    "caption": "All Reports",
    "link": "bffdb065-fa6c-4155-bd29-b23202d9b49c",
    "newWindow": false,
    "internal": "bffdb065-fa6c-4155-bd29-b23202d9b49c",
    "edit": false,
    "isInternal": true,
    "internalName": "All reports",
    "type": "internal",
    "title": "All Reports"
  },
  {
    "caption": "Set Up Report Bundles",
    "link": "fdfb70fc-7580-4425-bdfa-913b95630391",
    "newWindow": false,
    "internal": "fdfb70fc-7580-4425-bdfa-913b95630391",
    "edit": false,
    "isInternal": true,
    "internalName": "Report bundles",
    "type": "internal",
    "title": "Set Up Report Bundles"
  }
]]]></links>
  <metadataDescription></metadataDescription>
  <publishAt></publishAt>
  <umbracoUrlAlias></umbracoUrlAlias>
  <unPublishAt></unPublishAt>
  <workflowHistory></workflowHistory>
</membersOnlyHeaderShortcut>

Any help would be appreciated. I'm not sure how to debug this.

markadrake avatar May 17 '23 14:05 markadrake