title: Sharepoint 2010 Workflow Intermittently shows Error Occurred
body: <p>Using and InfoPath form, a person will submit a request to a form library. Upon creation of new item in the library, the workflow (using SharePoint Designer out of the box functionality - no code) is set to automatically start. It's a fairly simple workflow with 3 approval steps. 75% of the time it runs perfectly fine, 25% of the time it will switch to 'Error Occurred'. It particularly seems to error more often in the morning hours, although not limited to that time of day. I've read just about every article out there and have not found a solution. </p>
  
  <p>-Workflow history screen will show 'Note: Due to heavy load, the latest workflow operation has been queued. It will attempt to resume at a later time', until it finals errors.</p>
  
  <p>-Have already increased workflow throttle and batch size, issue seems to of gotten worse since then</p>
  
  <p>-Workflow history will says 'An error has occurred in [workflow name]' by the system account.</p>
  
  <p>-There appear to be no batch jobs running at the same time, no heavy work like backups occurring</p>
  
  <p>-This is occurring on more than one workflow for more than one form library, they are all completely not related to each other</p>
  
  <p>-We've checked our CPU on the server, no spikes during that time, we have plenty of memory. We don't have a lot of workflows running at the same time. Particularly in the morning when I'm seeing this occur the most, I'm just about the only user submitting forms and kicking off workflows.</p>
  
  <p>-We have checked to ensure our times are synced on the server (they are by 1 second) and that we have time zones set in our web applications</p>
  
  <p>-If you manually restart the workflow on one that had errored, it will process through fine again on the second try (based on that, assuming this means it can't be related to how the SPD workflow was built or permissions)</p>
  
  <p>-Tried logging to the workflow history to see where it errors, my logging prior to the 'approval process' step does appear in the history... workflow appears to fail upon trying to initiate the first task. Again, restarting workflow works fine and does assign the task, so I don't think it could be related to anything with the task list.</p>
  
  <p>Any suggestions that you may have to help me out here would be greatly appreciated!</p>
  
  <p><strong>Below are the errors logs from 14:</strong></p>
  
  <p>*Unexpected WinWF Internal Error, terminating workflow Id# f413610c-0981-4c37-9583-1d7cac4f0265</p>
  
  <p>09/12/2013 06:57:42.65  w3wp.exe (0x2768)                           0x1740  SharePoint Foundation           Workflow Infrastructure         98d4    Unexpected  System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> Microsoft.SharePoint.SPException: The context has expired and can no longer be used. (Exception from HRESULT: 0x80090317) ---> System.Runtime.InteropServices.COMException (0x80090317): The context has expired and can no longer be used. (Exception from HRESULT: 0x80090317)     at Microsoft.SharePoint.Library.SPRequestInternalClass.SetHttpParameters(String bstrHttpMethod, String bstrRequestDigest, UInt32 flags, Guid gTranLockerId, Byte[]&amp; ppsaImpersonateUserToken, Boolean bIgnoreTimeout, String bstrUserLogin, String bstrUserKey, UInt32 ulRoleCount, String bstrRoles, Boolean bWindowsMode, ApplicationPrincipalInfo&amp; pAppUserInfo, Boolean bInvalidateCachedConfigurationProperties, Int32 lAp...</p>
  
  <p>09/12/2013 06:57:42.65* w3wp.exe (0x2768)                           0x1740  SharePoint Foundation           Workflow Infrastructure         98d4    Unexpected  ...pDomainId, ISPManagedObjectFactory pFactory, Boolean bCallstack)     at Microsoft.SharePoint.Library.SPRequest.SetHttpParameters(String bstrHttpMethod, String bstrRequestDigest, UInt32 flags, Guid gTranLockerId, Byte[]&amp; ppsaImpersonateUserToken, Boolean bIgnoreTimeout, String bstrUserLogin, String bstrUserKey, UInt32 ulRoleCount, String bstrRoles, Boolean bWindowsMode, ApplicationPrincipalInfo&amp; pAppUserInfo, Boolean bInvalidateCachedConfigurationProperties, Int32 lAppDomainId, ISPManagedObjectFactory pFactory, Boolean bCallstack)     --- End of inner exception stack trace ---     at Microsoft.SharePoint.SPGlobal.HandleComException(COMException comEx)     at Microsoft.SharePoint.Library.SPRequest.SetHttpParameters(String bstrHttpMethod, String bstrRequestDigest, UInt32 flags, Guid gTranLock...</p>
  
  <p>09/12/2013 06:57:42.65* w3wp.exe (0x2768)                           0x1740  SharePoint Foundation           Workflow Infrastructure         98d4    Unexpected  ...erId, Byte[]&amp; ppsaImpersonateUserToken, Boolean bIgnoreTimeout, String bstrUserLogin, String bstrUserKey, UInt32 ulRoleCount, String bstrRoles, Boolean bWindowsMode, ApplicationPrincipalInfo&amp; pAppUserInfo, Boolean bInvalidateCachedConfigurationProperties, Int32 lAppDomainId, ISPManagedObjectFactory pFactory, Boolean bCallstack)     at Microsoft.SharePoint.SPGlobal.CreateSPRequestAndSetIdentity(SPSite site, String name, Boolean bNotGlobalAdminCode, String strUrl, Boolean bNotAddToContext, Byte[] UserToken, String userName, Boolean bIgnoreTokenTimeout, Boolean bAsAnonymous)     at Microsoft.SharePoint.SPSite.GetSPRequest()     at Microsoft.SharePoint.SPSite.get_Request()     at Microsoft.SharePoint.SPSite.InitSite()     at Microsoft.SharePoint.SPSite.get_SystemAccount()     at Microsoft.Shar...</p>
  
  <p>09/12/2013 06:57:42.65* w3wp.exe (0x2768)                           0x1740  SharePoint Foundation           Workflow Infrastructure         98d4    Unexpected  ...ePoint.WorkflowActions.Helper.SplitMultiUserToObjects(WorkflowContext context, Object val)     at Microsoft.SharePoint.WorkflowActions.Helper.MultiDisplayNameSemicolon(WorkflowContext context, Object val)     --- End of inner exception stack trace ---     at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct&amp; sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)     at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)     at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)     at System.Reflection.MethodBase.Invoke(Object obj, Ob...</p>
  
  <p>09/12/2013 06:57:42.65* w3wp.exe (0x2768)                           0x1740  SharePoint Foundation           Workflow Infrastructure         98d4    Unexpected  ...ject[] parameters)     at Microsoft.SharePoint.WorkflowActions.CoerceActivity.Coerce()     at Microsoft.SharePoint.WorkflowActions.CoerceActivity.Execute(ActivityExecutionContext provider)     at System.Workflow.ComponentModel.ActivityExecutor<code>1.Execute(T activity, ActivityExecutionContext executionContext)     at System.Workflow.ComponentModel.ActivityExecutor</code>1.Execute(Activity activity, ActivityExecutionContext executionContext)     at System.Workflow.ComponentModel.ActivityExecutorOperation.Run(IWorkflowCoreRuntime workflowCoreRuntime)     at System.Workflow.Runtime.Scheduler.Run()*     </p>