Copied to clipboard

Flag this post as spam?

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


  • Gerard 20 posts 77 karma points
    Mar 06, 2012 @ 21:52
    Gerard
    0

    XSLT error: ...An attempt was made to reference a CacheDependency object from more than one Cache entry.

    Hi there,

    one of my sites is having some problems with my XSLT macro's sometimes. This happens occasionally, not very often. General message shown is "Error parsing XSLT file". After a second pageload the problem is gone by itself.

    It's always the first XSLT macro on the page. I first thought my main-navigation macro could be the problem, so i replaced that one with a Razor-macro. Now the next macro is giving me the message.

    Last few weeks i always used umbDebugShowTrace=true on my homepage, and today the macro failed again so i could see the debugtrace. This is the message i can see in the trace:


    An attempt was made to reference a CacheDependency object from more than one Cache entry.
    An attempt was made to reference a CacheDependency object from more than one Cache entry.
    at System.Web.Caching.CacheEntry.MonitorDependencyChanges()
    at System.Web.Caching.CacheSingle.UpdateCache(CacheKey cacheKey, CacheEntry newEntry, Boolean replace, CacheItemRemovedReason removedReason, Object& valueOld)
    at System.Web.Caching.CacheInternal.DoInsert(Boolean isPublic, String key, Object value, CacheDependency dependencies, DateTime utcAbsoluteExpiration, TimeSpan slidingExpiration, CacheItemPriority priority, CacheItemRemovedCallback onRemoveCallback, Boolean replace)
    at umbraco.cms.businesslogic.cache.Cache.GetCacheItem[TT](String cacheKey, Object syncLock, CacheItemPriority priority, CacheItemRemovedCallback refreshAction, CacheDependency cacheDependency, TimeSpan timeout, GetCacheItemDelegate`1 getCacheItem)
    at umbraco.macro.GetXsltExtensions()
    at umbraco.macro.AddMacroXsltExtensions()
    at umbraco.macro.GetXsltTransformResult(XmlDocument macroXML, XslCompiledTransform xslt, Dictionary`2 parameters)
    at umbraco.macro.loadMacroXSLT(macro macro, MacroModel model, Hashtable pageElements)

    I'm using version 4.7.1.1 (Assembly version: 1.0.4393.24044) on multiple sites. Have seen the error on only one of those sites, a site that is not used very often.

    Any solution?

    Regards;
    Gerard

     

  • Gerard 20 posts 77 karma points
    Mar 21, 2012 @ 22:14
    Gerard
    0

    No answer yet, still occasionally see the error message, so maybe i need to provide some more information?

    Running Umbraco 4.7.1.1 on Windows Server 2008 R2, with SQL Server 2008 R2. There are several macro's on the (home)page, and one is called twice with different macro parameters, but that's not the macro that is failing: its always the first macro on the page that fails.

     

     

  • Gerard 20 posts 77 karma points
    Mar 21, 2012 @ 22:47
    Gerard
    0

    Diving into this further, trying to reproduce the situation, i now have created a page with a Razor-macro clearing the ASP.NET cache (using HttpContext.Current.Cache.Remove for all cached items).
    Following one the same page, there are two XSLT macro's. After clearing the cache the first XSLT macro will throw the same error ("An attempt was made to reference a CacheDependency object from more than one Cache entry"), so that's a way to reproduce this.

    I'm not sure if what i do here is valid, but could this be the problem with my site (a cleared ASP.NET cache)?

     

  • Gerard 20 posts 77 karma points
    Mar 27, 2012 @ 23:47
    Gerard
    0

    Ok, still fighting to find out what's going on. I downgraded to version 4.7.1 (Assembly version: 1.0.4315.19820) today. And surprise: in that version the problem is gone. So it must be the upgrade to 4.7.1.1 that started this problem.

    Summarizing:
    - Sometimes, the first XSLT-macro on my site is failing. At the next pageload the failure is gone.
    - This happens in version 4.7.1.1 (Assembly version: 1.0.4393.24044) on Windows 2008 R2 / MS SQL 2008 R2
    - It does not happen in version 4.7.1 (Assembly version: 1.0.4315.19820)
    - It lookes that the cause is a "cleared" ASP.NET cache.
    - By iterating over the cacheitems and clearing them with the following code, the problem can be reproduced:
          var enumerator = HttpContext.Current.Cache.GetEnumerator();
          while (enumerator.MoveNext())
          {
              string item = enumerator.Key.ToString();
              HttpContext.Current.Cache.Remove(item);
          }
    After running this code and going back to the homepage, the problem appears. (but not in version 4.7.1)

     

  • Árni Gunnar Ragnarsson 31 posts 51 karma points
    Mar 28, 2012 @ 12:44
    Árni Gunnar Ragnarsson
    0

    I am having the very same error, but on a clean install of a 4.7.1.1 ... how can this be fixed?

  • Árni Gunnar Ragnarsson 31 posts 51 karma points
    Mar 28, 2012 @ 13:01
    Árni Gunnar Ragnarsson
    0

    When I try to save an XSLT file inside Umbraco, this error comes:

    System.NullReferenceException: Object reference not set to an instance of an object.
    at umbraco.macro.GetXsltExtensionsImpl()
    at umbraco.cms.businesslogic.cache.Cache.GetCacheItem[TT](String cacheKey, Object syncLock, CacheItemPriority priority, CacheItemRemovedCallback refreshAction, CacheDependency cacheDependency, TimeSpan timeout, GetCacheItemDelegate`1 getCacheItem)
    at umbraco.macro.GetXsltExtensions()
    at umbraco.macro.AddMacroXsltExtensions()
    at umbraco.presentation.webservices.codeEditorSave.SaveXslt(String fileName, String oldName, String fileContents, Boolean ignoreDebugging)
  • Steve Megson 151 posts 1024 karma points MVP c-trib
    May 08, 2012 @ 17:55
    Steve Megson
    1

    I've submitted a patch to fix this on Codeplex.

  • Gerard 20 posts 77 karma points
    Sep 17, 2012 @ 20:52
    Gerard
    0

    Thank you Steve, finally someone who knows what's going on, and with a solution. I haven't been able to test the latest Umbraco release so i'm not sure if this is solved in the latest build, but it seems to me that this case can be closed. Thank you again.

Please Sign in or register to post replies

Write your reply to:

Draft