4.7.1. null exceptions with umbraco.cms.businesslogic.cache.Cache.ClearCacheItem(System.String)
Hi all
Just upgraded a 4.5.2 site to 4.7.1 and coming across some major issues which are stopping us going live. Basically the site runs ok but when we login and access certain areas, the w3p process is throwing exceptions, the exceptions at the end of this message are from the event log:
At the point the exceptions are being thrown, this seems to be triggering it:
umbraco.library.RefreshContent();
Exceptions
An unhandled exception occurred and the process was terminated.
Application ID: /LM/W3SVC/10/ROOT
Process ID: 2688
Exception: System.NullReferenceException
Message: Object reference not set to an instance of an object.
StackTrace: at umbraco.cms.businesslogic.cache.Cache.ClearCacheItem(String Key) at umbraco.cms.businesslogic.cache.Cache.ClearCacheByKeySearch(String KeyStartsWith) at umbraco.content.set_XmlContentInternal(XmlDocument value) at umbraco.content.<RefreshContentFromDatabaseAsync>b__2(Object ) at System.Threading.QueueUserWorkItemCallback.WaitCallback_Context(Object state) at System.Threading.ExecutionContext.runTryCode(Object userData) at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData) at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx) at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem() at System.Threading.ThreadPoolWorkQueue.Dispatch() at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()
Application: w3wp.exe Framework Version: v4.0.30319 Description: The process was terminated due to an unhandled exception. Exception Info: System.NullReferenceException Stack: at umbraco.cms.businesslogic.cache.Cache.ClearCacheItem(System.String) at umbraco.cms.businesslogic.cache.Cache.ClearCacheByKeySearch(System.String) at umbraco.content.set_XmlContentInternal(System.Xml.XmlDocument) at umbraco.content.<RefreshContentFromDatabaseAsync>b__2(System.Object) at System.Threading.QueueUserWorkItemCallback.WaitCallback_Context(System.Object) at System.Threading.ExecutionContext.runTryCode(System.Object) at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode, CleanupCode, System.Object) at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object) at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean) at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem() at System.Threading.ThreadPoolWorkQueue.Dispatch() at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()
I've gotten around it for now by removing the call to RefreshContent() - to be honest i'm not 100% convinced it's required in my instance but it's obviously a core bug that needs resolving
I'm wondering if it's related to ghost nodes left in the DB after being deleted, this is causing me other issues as well in the site i.e. sort content tree etc, could be related?
Looking at the code, the only thing that seem to possibly go wrong is the entire HttpRuntime.Cache to become null at some point -- which could make sense because we see these errors when the application restarts (deploy, update, whatever). Since the code is running is a background thread, the whole app seem to be able to restart while the thread keeps running on itself.
Still trying to fully understand what's going on...
Running with a custom patch for about 2 weeks and not seeing the error anymore. Will try to push the patches before 4.7.1.1 is out but I might be late...
4.7.1. null exceptions with umbraco.cms.businesslogic.cache.Cache.ClearCacheItem(System.String)
Hi all
Just upgraded a 4.5.2 site to 4.7.1 and coming across some major issues which are stopping us going live. Basically the site runs ok but when we login and access certain areas, the w3p process is throwing exceptions, the exceptions at the end of this message are from the event log:
At the point the exceptions are being thrown, this seems to be triggering it:
umbraco.library.RefreshContent();
Exceptions
An unhandled exception occurred and the process was terminated.
Application ID: /LM/W3SVC/10/ROOT
Process ID: 2688
Exception: System.NullReferenceException
Message: Object reference not set to an instance of an object.
StackTrace: at umbraco.cms.businesslogic.cache.Cache.ClearCacheItem(String Key)
at umbraco.cms.businesslogic.cache.Cache.ClearCacheByKeySearch(String KeyStartsWith)
at umbraco.content.set_XmlContentInternal(XmlDocument value)
at umbraco.content.<RefreshContentFromDatabaseAsync>b__2(Object )
at System.Threading.QueueUserWorkItemCallback.WaitCallback_Context(Object state)
at System.Threading.ExecutionContext.runTryCode(Object userData)
at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
at System.Threading.ThreadPoolWorkQueue.Dispatch()
at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()
Application: w3wp.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.NullReferenceException
Stack:
at umbraco.cms.businesslogic.cache.Cache.ClearCacheItem(System.String)
at umbraco.cms.businesslogic.cache.Cache.ClearCacheByKeySearch(System.String)
at umbraco.content.set_XmlContentInternal(System.Xml.XmlDocument)
at umbraco.content.<RefreshContentFromDatabaseAsync>b__2(System.Object)
at System.Threading.QueueUserWorkItemCallback.WaitCallback_Context(System.Object)
at System.Threading.ExecutionContext.runTryCode(System.Object)
at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode, CleanupCode, System.Object)
at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
at System.Threading.ThreadPoolWorkQueue.Dispatch()
at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()
Faulting application name: w3wp.exe, version: 7.5.7601.17514, time stamp: 0x4ce7a5f8
Faulting module name: unknown, version: 0.0.0.0, time stamp: 0x00000000
Exception code: 0xc0000005
Fault offset: 0x0f496415
Faulting process id: 0xa80
Faulting application start time: 0x01ccaa91c7672290
Faulting application path: c:\windows\system32\inetsrv\w3wp.exe
Faulting module path: unknown
Report Id: 7e264c2f-1686-11e1-8471-001c420ea859
Fault bucket , type 0
Event Name: CLR20r3
Response: Not available
Cab Id: 0
Problem signature:
P1: w3wp.exe
P2: 7.5.7601.17514
P3: 4ce7a5f8
P4: cms
P5: 1.0.4281.14852
P6: 4e798ef9
P7: 355
P8: 19
P9: System.NullReferenceException
P10:
Attached files:
These files may be available here:
Analysis symbol:
Rechecking for solution: 0
Report Id: 7e264c2f-1686-11e1-8471-001c420ea859
Report Status: 0
I've seen these exceptions too...
I've gotten around it for now by removing the call to RefreshContent() - to be honest i'm not 100% convinced it's required in my instance but it's obviously a core bug that needs resolving
I'm wondering if it's related to ghost nodes left in the DB after being deleted, this is causing me other issues as well in the site i.e. sort content tree etc, could be related?
Same issue here, currently investigating. If anyone has a clear way to reproduce, I'm interested.
Looking at the code, the only thing that seem to possibly go wrong is the entire HttpRuntime.Cache to become null at some point -- which could make sense because we see these errors when the application restarts (deploy, update, whatever). Since the code is running is a background thread, the whole app seem to be able to restart while the thread keeps running on itself.
Still trying to fully understand what's going on...
Good stuff for getting stuck in, i've not had time due to client work coming in thick and fast :-)
For me, reproducing was after editing document properties, saving, publishing then calling the RefreshContent method
Simon
HAJ HAJ
I have just upgraded a site from 4.5.1 to 4.7.1 and experiencing the exact same error.
Every time I do a "Republish entire site" from inside the backoffice, the w3wp.exe process crashes with the above stacktrace.
Looking at the setter for "protected virtual XmlDocument XmlContentInternal" in umbraco/presentation/content.cs, (http://umbraco.codeplex.com/SourceControl/changeset/view/20be2d518820#umbraco%2fpresentation%2fcontent.cs), it looks like this methodcall is the culprit: Cache.ClearCacheByKeySearch("macroHtml_");
Hmm caching and macros...
Now after some testing it looks like the error only occurs if any of the macros have caching enabled ("Cache Period" > 0)
\Dan
Seeing this too, any news regarding fix?
Running with a custom patch for about 2 weeks and not seeing the error anymore. Will try to push the patches before 4.7.1.1 is out but I might be late...
You better hurry, I think Niels wants to release asap. ;)
Stéphane pinged me and I'll add his patch as it's straight forward - any work item to relate this to?
Managed to check with Niels. Patch should be in 4.7.1.1.
It's in and build no. 474 will be 4.7.1.1 unless we discover any surprises during today:
http://nightly.umbraco.org/umbraco%204.7.1/4.7.1/4.7.1.474.zip
is working on a reply...