Copied to clipboard

Flag this post as spam?

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


  • Caractacus Downes 81 posts 314 karma points
    Dec 16, 2016 @ 14:36
    Caractacus Downes
    0

    Could not map all items to virtual content

    Hi,

    My project log file is getting flooded with entries like this:

    2016-12-15 15:37:29,400 [P884120/D110/T1878] WARN  Merchello.Web.Caching.VirtualContentCache`2[[Merchello.Web.Models.VirtualContent.IProductContent, Merchello.Web, Version=2.3.6127.15557, Culture=neutral, PublicKeyToken=null],[Merchello.Core.Models.IProduct, Merchello.Core, Version=2.3.6127.15554, Culture=neutral, PublicKeyToken=null]] - Could not map all items to virtual content
    

    I have serached and Googled and can't find any clues about what to do about it - does anyone have any suggestions? Obviously I can change the logging level, but the underlying problem must be having a performance impact, so I'd like to fix it!

    Cheers,

    Crac

  • Rusty Swayne 1655 posts 4993 karma points c-trib
    Dec 16, 2016 @ 17:03
    Rusty Swayne
    0

    Do you have any products in the result set that do not have a document type assigned?

  • Caractacus Downes 81 posts 314 karma points
    Dec 19, 2016 @ 10:15
    Caractacus Downes
    0

    Hi Rusty,

    As far as I can see all the products have the same document type assigned. There are 40 products in total, but the error appears in the log in groups of 16. I do have 16 collections that I have created, in addition to the Featured Products and T-shirts collections which were part of the FastTrack template.

    Is that likely to be relevant?

    Cheers,

    Crac

  • Rusty Swayne 1655 posts 4993 karma points c-trib
    Dec 19, 2016 @ 16:30
    Rusty Swayne
    0

    Hi Crac

    The numbers do line up - which I agree seems suspicious. Do you know which which page is generating the log messages? Are you seeing errors in your site - or just the warning logs.

    Just wondering if we have a situation where we're erroneously logging something ...

  • Caractacus Downes 81 posts 314 karma points
    Dec 19, 2016 @ 17:04
    Caractacus Downes
    0

    Hi,

    I've just run a quick test to see more exactly when this happens.

    On the top level store page it logs the 16 warnings twice (i.e. if there is something iterating through a collection causing the warnings, it runs through it twice). On the catalog page, listing the collections, it logs the warnings once (one set of 16). On a collection page it logs the warnings once. On a specific product page it logs the warnings once.

    Does that help?

    Cheers,

    Crac

  • Rusty Swayne 1655 posts 4993 karma points c-trib
    Dec 19, 2016 @ 19:23
    Rusty Swayne
    0

    That does give me somewhere to look and try to replicate. It would be good to log this issue in the issue tracker.

    Can you also confirm that, other than the warnings, there does not seem to be anything else going on?

  • Caractacus Downes 81 posts 314 karma points
    Dec 20, 2016 @ 09:40
    Caractacus Downes
    0

    That's certainly the thing that seems to be swamping the log at the moment. There might be something else in the noise, but I haven't noticed anything.

    Cheers,

    Crac

  • Caractacus Downes 81 posts 314 karma points
    Dec 20, 2016 @ 12:13
    Caractacus Downes
    0

    Hi,

    If it helps I think I have identified this macro which goes through the collections and seems to raise a warning for each one - at least the warnings disappear when I comment the macro out:

    @inherits Umbraco.Web.Macros.PartialViewMacroPage
    @using Merchello.Web.Models.Ui.Rendering
    @using ContentModels = Umbraco.Web.PublishedContentModels;
    @using Merchello.Core
    @using Merchello.Web.Models.Ui
    @using Umbraco.Core.Models
    @using Umbraco.Web
    @using Merchello.Web
    @using Merchello.Core.Services
    
    @{
        var ecs = MerchelloContext.Current.Services.EntityCollectionService;
        var collections = ecs.GetRootLevelEntityCollections(EntityType.Product).OrderBy(p => p.Name);
    }
    
    <ul>
    
        @foreach (Merchello.Core.Models.Interfaces.IEntityCollection col in collections)
        {
            var page = Merchello.FastTrack.Ui.ExampleUiHelper.Content.GetCategoryPageForCollection(col.Key);
            if (page != null)
            {
                <li><a href="@page.Url">@col.Name</a></li>
            }
        }
    
    </ul>
    

    Does that help to nail it down? The code 'works' in that it puts out the menu as expected, but it raises the warning message for each collection.

    I'm sure it's something obvious.

    Cheers,

    Crac

  • Brendan Rice 538 posts 1099 karma points
    Apr 09, 2017 @ 01:38
    Brendan Rice
    0

    Did you get a solution for the Caractacus?

  • Marek 16 posts 78 karma points
    Sep 02, 2017 @ 17:30
    Marek
    0

    this error is add to log file when i use MerchelloHelper.TypedProductContentFromCollection(guid) in cshtml file

    e.g.: Merchello.Web.Caching.VirtualContentCache`2[[Merchello.Web.Models.VirtualContent.IProductContent, Merchello.Web, Version=2.5.6275.24394, Culture=neutral, PublicKeyToken=null],[Merchello.Core.Models.IProduct, Merchello.Core, Version=2.5.6275.24390, Culture=neutral, PublicKeyToken=null]] - Could not map all items to virtual content

  • Bliss Applications 2 posts 72 karma points
    Sep 14, 2017 @ 20:15
    Bliss Applications
    0

    I've got this warning as well using 2.3.0 and 2.5.0.

    Tried multiple things so far:

    • Removed all collections
    • Removed all products
    • Reset Merchello Installation
    • Rebuilt all indexes
    • Upgraded to latest Merchello (2.5.0)

    Since all of this always yielded the same warning I went and read the source code.

    It seems like this warning is being printed here.

    Reading the condition that guards that logging statement it seems like it is expecting the retrieved Items to be equal to ItemsPerPage.

    Since in our case we are invoking the function:

    Merchello.Query.Product.TypedProductContentFromCollection(Guid.Parse("a0f663f6-516b-465b-b70e-7de7bcf897b0"));
    

    This will result in an ItemsPerPage equal to long.MaxValue. Also a corner case that would cause this logging statement to be printed would be at the last page (where items.Count() would be less than Page.ItemsPerPage).

    @rustyswayne let us know if this line is really supposed to be comparing items.Count() to ItemsPerPage

  • Steve Edson 16 posts 91 karma points
    Sep 21, 2017 @ 17:10
    Steve Edson
    0

    We've also started to hit this issue, any help would be massively appreciated. Thanks

  • Caractacus Downes 81 posts 314 karma points
    Sep 22, 2017 @ 09:15
    Caractacus Downes
    0

    I've been trying to remember how I got around this problem, so I just revisited the log files, and the answer is I never found the solution. The log file is still getting swamped with 'Could not map all items to virtual content' errors. The site seems to be performing OK, although it's not particularly high traffic, so the lack of efficiency isn't causing a problem.

    I'd like to find an answer too!

    Cheers,

    Crac

  • Marek 16 posts 78 karma points
    Sep 22, 2017 @ 09:29
    Marek
    0

    as Bliss Applications wrote this problem is in that line: if (items.Count() != page.ItemsPerPage)

    Lee fixed it (https://github.com/Merchello/Merchello/blob/merchello-dev/src/Merchello.Web/Caching/VirtualContentCache%7BT%7D.cs#L151),

    I've downloaded source, build and upgrade bin files and it works!!

Please Sign in or register to post replies

Write your reply to:

Draft