Copied to clipboard

Flag this post as spam?

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


  • Craig100 1136 posts 2523 karma points c-trib
    Jan 16, 2019 @ 17:46
    Craig100
    0

    Media Root children missing after upgrade

    Hi,

    I have this situation on a couple of sites I upgraded from 7.1.x up to 7.12.4 and yesterday to 7.13.1.....

    The immediate children of the Media section cannot be found OR if there are no immediate items then the children of the first Media folder. This also shows up in the Media Picker flyout panel. All give the same red error bar saying "Failed to retrieve children for media item -1". I thought maybe that it was because there may not be a Media Start Node set for my user group, but there was. However, when I removed it to reapply it, Media couldn't be listed. So again, children of the Media root can't be found. The Trace log error is like so:

     2019-01-16 14:20:14,959 [P11664/D2/T72] ERROR Umbraco.Web.Editors.MediaController - Unhandled controller exception occurred
    AutoMapper.AutoMapperMappingException: 
    
    Mapping types:
    Media -> UserProfile
    Umbraco.Core.Models.Media -> Umbraco.Web.Models.ContentEditing.UserProfile
    
    Destination path:
    ContentItemBasic`2.Owner.Owner
    
    Source value:
     Umbraco.Core.Models.Media ---> System.NullReferenceException: Object reference not set to an instance of an object.
           at Umbraco.Core.Services.UserService.GetProfileById(Int32 id)
           at Umbraco.Web.Models.Mapping.OwnerResolver`1.ResolveCore(TPersisted source)
           at AutoMapper.ValueResolver`2.Resolve(ResolutionResult source)
           at System.Linq.Enumerable.Aggregate[TSource,TAccumulate](IEnumerable`1 source, TAccumulate seed, Func`3 func)
           at AutoMapper.Mappers.TypeMapObjectMapperRegistry.PropertyMapMappingStrategy.MapPropertyValue(ResolutionContext context, IMappingEngineRunner mapper, Object mappedObject, PropertyMap propertyMap)
           --- End of inner exception stack trace ---
    

    I suspect that somehow a node has been removed in the database during the upgrade but I haven't a clue where or what. Could someone help me fault find this please?

    Thanks

    Craig

  • Nik 1614 posts 7260 karma points MVP 7x c-trib
    Jan 16, 2019 @ 18:35
    Nik
    0

    Hi Craig,

    If you've done a large upgrade all the way from 7.1, check the user permission and that they have the root node (or any node at all for that matter) set as a start node. I've seen it where migrated users (happens around v7.7 I think ) don't end up with any root nodes set in either Content or Media.

    Nik

  • Craig100 1136 posts 2523 karma points c-trib
    Jan 16, 2019 @ 19:35
    Craig100
    0

    Hi Nik,

    That appears to be what's happened BUT, I can't set the root node for Media in the Administrator group as Media doesn't seem to exist. Would I be right in my suspicion that only "THE" administrator can reset them? Although I'm "AN" administrator, it may be that I can't see everything. I might try breaking in with the AdminReset package in that case. What do you think?

    Craig

  • Craig100 1136 posts 2523 karma points c-trib
    Jan 16, 2019 @ 20:14
    Craig100
    0

    Broke in as "THE" administrator. Removed and reset the Media start node for the Administrator Group, THE administrator and my own administrator account. Logged out and in again as me, same problem, Media Picker errors with "Failed to retrieve children for media item -1" again. It's a complete conundrum at the moment. The error trace above does allude to this being the problem though. Question is, how to fix it?

    Craig

  • Nik 1614 posts 7260 karma points MVP 7x c-trib
    Jan 16, 2019 @ 20:38
    Nik
    0

    Hi Craig,

    When you log in as "The" administator account, find your user account and remove all the user groups from it.

    Then Add your account back into which ever is the main usergroup it needs to have, ensuring that that user group has the root nodes for Media set as it's start node.

    Once you've done that, see if you can set the root node for media on the user account itself.

    Once all set, log out as "The" administrator and log back in as your account. You might need to do a hard refresh of the back office but that is what normally fixes it for me.

    Thanks

    Nik

  • Craig100 1136 posts 2523 karma points c-trib
    Jan 16, 2019 @ 21:00
    Craig100
    0

    Hi Nik,

    Did what you said, but it didn't work:( I tried to save my account with all groups removed but it's not possible so just reapplied Administrators to my account. Did a hard reset (touched web.config) and a hard reload, but no joy :(

    Although when you initially open a Media Picker and get the error, you can still get results using the search. Also if you set a Media Picker itself with a start node other than "Media", it displays that folder's media perfectly. It's just the Media root that's the issue.

    Thanks

    Craig

  • Alex Skrypnyk 6163 posts 24143 karma points MVP 8x admin c-trib
    Feb 28, 2019 @ 16:17
    Alex Skrypnyk
    0

    Hi Nick and Craig

    Did you solve the issue? We have the same problem after upgrading the site.

    Thanks,

    Alex

  • Carlos Mosqueda 244 posts 435 karma points
    Feb 28, 2019 @ 16:30
    Carlos Mosqueda
    1

    @Alex @Nik, what did you upgrade from and then to versions?

    We had issues when we upgraded from 7.7 to 7.12 then to 7.13. It seemed a port of the groups were auto generated and got a little messed up.

    I would actually try making a new Admin Group names something else, and put your users in that Group. If you need to, make the Group have the access to the Root media folder.

  • Craig100 1136 posts 2523 karma points c-trib
    Feb 28, 2019 @ 16:33
    Craig100
    1

    We had the impression the root media folder's ID got changed somehow. Either that or everything seems to want to look for an ID of -1 for the root media folder.

    We still haven't fixed it. Content editors are just working around it by never asking for the root media folder in media pickers.

    Craig

  • Rhys Hamilton 140 posts 942 karma points
    Feb 28, 2019 @ 16:42
    Rhys Hamilton
    1

    Hi Alex,

    I had a similar issue a while ago, but with content instead of media.

    I noticed the the nodeUser in the dbo.umbracoNode table was set to -1 for all of my affected items. My "quick-fix" was simply to replace this value with the id of a valid user (in my case, the default 0).

    Interestingly, in the new V8, the default appears to be-1, so perhaps that's an indicator that there was an issue there that they've tried to prevent.

    I'm not sure if this will solve your issue, but hopefully it helps!

Please Sign in or register to post replies

Write your reply to:

Draft