Problem
I had a completely phantom error today and I never did figure out the cause was but I thought it might help to explain how it happened, and my thoughts to the cause.
The environment is MOSS Enterprise SP2 development environment with Visual Studio, VSTE 1.3, Office 2007, WSPBuilder, and SQL all onboard, obviously supporting Windows Workflow Foundation workflows.
Over the last few days I’ve been struggling with strange bugs in my InfoPath task forms that required a million installs and uninstalls of the wsp, I finally noted that my task form was stuck in an “installing” state in central admin so I rolled back to a previous version of the form. I later determined that the task form’s error was caused by deleting an unused data source.
During that same period I had created a member variable for the workflowProperties.Web object. While testing my newly repaired task form, I received a serialization error in the SharePoint logs because you can’t have a non-serializable member variable in a Windows Workflow Foundation workflow. I removed the workflowProperties.Web member variable reference… all the errors were then fixed but then the ERROR: request not found in the TrackedRequests error and “Error Occurred” manifested!!!
The Error
11/19/2009 11:53:16.54 w3wp.exe (0x17FC) 0x10C8 Windows SharePoint Services General 0 Unexpected ERROR: request not found in the TrackedRequests. We might be creating and closing webs on different threads. ThreadId = 21, Free call stack = at Microsoft.SharePoint.SPRequestManager.Release(SPRequest request) at Microsoft.SharePoint.SPSite.Close() at Microsoft.SharePoint.SPSite.Dispose() at Microsoft.SharePoint.Workflow.SPWorkflowAutostartEventReceiver.AutoStartWorkflow(SPItemEventProperties properties, Boolean bCreate, Boolean bChange, AssocType atyp) at Microsoft.SharePoint.Workflow.SPWorkflowAutostartEventReceiver.AutoStartWorkflow(SPItemEventProperties properties, Boolean bCreate, Boolean bChange) at Microsoft.SharePoint.Workflow.SPWorkflowAutostartEventReceiver.ItemAdded(SPItemEventProperties properties) at Microsoft.SharePoint.SPEventManager.RunItemEventRe…
11/19/2009 11:53:16.54* w3wp.exe (0x17FC) 0x10C8 Windows SharePoint Services General 0 Unexpected …ceiver(SPItemEventReceiver receiver, SPItemEventProperties properties, SPEventContext context, String receiverData) at Microsoft.SharePoint.SPEventManager.RunItemEventReceiverHelper(Object receiver, Object properties, SPEventContext context, String receiverData) at Microsoft.SharePoint.SPEventManager.<>c__DisplayClass8`1.<InvokeEventReceivers>b__0() at Microsoft.SharePoint.SPSecurity.CodeToRunElevatedWrapper(Object state) at Microsoft.SharePoint.SPSecurity.RunAsUser(SPUserToken userToken, Boolean bResetContext, WaitCallback code, Object param) at Microsoft.SharePoint.SPSecurity.RunAsUser(SPUserToken userToken, CodeToRunElevated code) at Microsoft.SharePoint.SPEventManager.InvokeEventReceivers[ReceiverType](SPUserToken userToken, RunEventReceiver runEventReceiver, Ob…
11/19/2009 11:53:16.54* w3wp.exe (0x17FC) 0x10C8 Windows SharePoint Services General 0 Unexpected …ject receivers, Object properties, Boolean checkCancel) at Microsoft.SharePoint.SPEventManager.InvokeEventReceivers[ReceiverType](Byte[] userTokenBytes, RunEventReceiver runEventReceiver, Object receivers, Object properties, Boolean checkCancel) at Microsoft.SharePoint.SPEventManager.HandleEventCallback[ReceiverType,PropertiesType](Object callbackData) at Microsoft.SharePoint.Utilities.SPThreadPool.WaitCallbackWrapper(Object state) at System.Threading._ThreadPoolWaitCallback.WaitCallback_Context(Object state) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading._ThreadPoolWaitCallback.PerformWaitCallbackInternal(_ThreadPoolWaitCallback tpWaitCallBack) at System.Threading._ThreadPo…
11/19/2009 11:53:16.54* w3wp.exe (0x17FC) 0x10C8 Windows SharePoint Services General 0 Unexpected …olWaitCallback.PerformWaitCallback(Object state) , Allocation call stack (if present) null
11/19/2009 11:53:16.54 w3wp.exe (0x17FC) 0x10C8 Windows SharePoint Services General 8l1n Monitorable An SPRequest object was not disposed before the end of this thread. To avoid wasting system resources, dispose of this object or its parent (such as an SPSite or SPWeb) as soon as you are done using it. This object will now be disposed. Allocation Id: {CEE43EB2-0752-46F6-A72A-E73B5980112D} To determine where this object was allocated, create a registry key at HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Shared Tools\Web Server Extensions\HeapSettings. Then create a new DWORD named SPRequestStackTrace with the value 1 under this key.
Resolution
In my case, removing any reference to serialized fields and rebooting the server fixed the problem. My theory is that my serialization problem relating to member variables set to SPWeb or SPSite caused SharePoint get into some sort of unknown state.
Here’s some posts I reviewed along the way…
ERROR- request not found in the TrackedRequests
Popularity: 5% [?]
I was just looking through my blog’s history and it looks like this article is quite popular and I feel bad that I didn’t post an alternat solution sooner.
To solve this problem close all SPWeb and SPSite objects in your .NET code. If you are closing them you sitll make be leaking objects due to an unhandled exception, therefore consider using the “using” statement…
Using (SPWeb web = openWeb(“…”))
{
|