Copied to clipboard

Flag this post as spam?

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


  • Michael B 17 posts 97 karma points
    Jun 29, 2023 @ 14:52
    Michael B
    0

    An Error Occurred Value cannot be null. Parameter name: key in Umbraco 8.7 after update

    Hello,

    I am upgrading a website from Umbraco 7 to Umbraco 10. I upgraded to Umbraco 8.5.5 first, then I jumped from 8.5.5 to 8.18.7. I noticed one of my content types is throwing the following error: enter image description here

    This error did not happen when viewing the content in the backoffice in 8.5.5, so I figured it happened during one of the versions between. After walking up the Umbraco versions, it finally broke in 8.7.0. At least half of this content type is broken in this way, so this error will be thrown and you cannot edit any of the content under that entire node.

    However other nodes of that same type work fine. There doesn't seem to be any reason apparent to me why some work and others don't (for example one datatype was used while not on another, I've looked at most combinations).

    It appears to be an issue being thrown from a Nested Content datatype according to the stacktrace, but I am not sure where it comes from or if there is a way to migrate to this version to prevent this bug from happening.

    This brings up another bit of weird behavior that I observed post migration from Umbraco 7 in 8.5.5.

    Nested content appears to have all of it's nodes removed and it cannot be edited as seen here: enter image description here

    Nested content still works if you make a new node, however you lose all the data that was already under that field which is quite a pain. This error does happen in 8.5.5, which tells me it is likely caused by the migration from 7. I am not sure if they are connected in some way, but the primary concern is that a large portion of the site's content of one particular node are throwing errors once the site is upgraded to Umbraco 8.7.0.

    If any further information is needed, I can provide it. Appreciate any help that can be provided. Thanks!

  • Marc Goodson 2157 posts 14431 karma points MVP 9x c-trib
    Jun 29, 2023 @ 20:27
    Marc Goodson
    0

    Hi Michael B

    I have a hunch that in early versions of Nested Content it didn't store a key? and there was definitely an issue with copying and pasted Nested Content, where new Keys weren't generated:

    https://github.com/umbraco/Umbraco-CMS/issues/7133

    Wondering if the SQL in this issue can help you...

    https://our.umbraco.com/forum/using-umbraco-and-getting-started/106313-missing-key-attribute-in-nested-content-when-upgrading-from-v7-to-v8

    If you turn the underlying property editor into a text area, you should be able to see the JSON that you have stored after the migration for the editors and see if they are missing keys, and whether you can fix up the JSON that is there to be the new valid JSON for Nested Content in V8.5.5 and beyond.

    There is also uSyncMigrations that will take your V7 content and media and transform into V10+ in one fell swoop, (it's in beta, sometimes it's magic sometimes it's confusing) - that might be worth doing a test to see if you get further quicker with it: https://github.com/Jumoo/uSyncMigrations

    regards

    marc

  • Michael B 17 posts 97 karma points
    Jun 29, 2023 @ 20:29
    Michael B
    0

    Excellent, thank you Marc. That makes a lot of sense. I will give it a try tomorrow and report back with my findings. Appreciate the quick response

  • Mitch 44 posts 159 karma points
    Jul 02, 2023 @ 18:34
    Mitch
    0

    Any solution to this? I'm having similar issues.

  • Michael B 17 posts 97 karma points
    Jul 03, 2023 @ 12:35
    Michael B
    0

    Hey Mitch,

    My own personal update is that I haven't found exactly where the key is being held. I tried USync, which was a good idea but wasn't quite the solution I was looking for.

    I then have been looking into a way to implement keys into the nested content data. . If I find a solution I will make sure to keep you up to date.

    If anyone has encountered this as well and knows of the solution that worked for them, it would be appreciated.

  • Marc Goodson 2157 posts 14431 karma points MVP 9x c-trib
    Jul 03, 2023 @ 14:09
    Marc Goodson
    0

    Hi Michael and Mitch

    This article here might be of interest:

    https://dev.to/skttl/fixing-broken-nested-content-after-upgrading-from-umbraco-7-to-8-57g5

    Essentially there is another issue where Nested Content Keys aren't unique

    but I bet you could use the same technique to loop through your site, find any Nested Content without a key (generate a new guid, it doesnt' matter what it is as long as it's unique) and resave.

    It certainly looks less scary than the SQL here:

    https://our.umbraco.com/forum/using-umbraco-and-getting-started/106313-missing-key-attribute-in-nested-content-when-upgrading-from-v7-to-v8

    regards

    Marc

  • Michael B 17 posts 97 karma points
    Jul 06, 2023 @ 14:37
    Michael B
    0

    Hey Marc,

    This looks very promising. I integrated the controller with the upgrade project and I can with near certainty say I found the issue.

    Some of the records I had worked fine, while other records were breaking. Here is what I found in my case:

    This is a healthy record: [{ "key": "guid", "name": "text", "ncContentTypeAlias": "ContentAlias", "title": "text" //same text as above name }]

    This was what the same nested content looking like on the records that were breaking:

    [{"title":"text"}]

    Needless to say it is missing the key along with many other things.

    What I am going to do is edit the code in the controller to edit the nested content types that do not contain a key so that they match the format of the working records.

    Once that is complete, I do believe I should be in good shape. I will let you know how it works once I finish it.

  • Michael B 17 posts 97 karma points
    Jul 07, 2023 @ 20:06
    Michael B
    0

    An update:

    It worked!

    I used an edited version of the tool to iterate through every record and update the nested content json with the missing information (namely a key).

    When I go to the Content page for each node, I no longer have an error thrown and can then edit each entry.

    There was a smaller error that I hoped it would resolve where nested content shows as greyed out and unable to be changed as seen here: enter image description here

    Ideally that would have the content on it that was placed there from Umbraco 7, however I will keep digging into it and see if I can find any more information.

    If anyone has any ideas for that as well, I would appreciate input as I begin to work on it.

    Thanks for all the help Marc!

Please Sign in or register to post replies

Write your reply to:

Draft