I have a document library on Sharepoint 2010 with an associated workflow. I can start the workflow ”by hand” thru the document library. It’s a long processing workflow, so we have exended the “workflow-eventdelivery-timeout” property in stsadm to an hour, to be sure not to get any “Failed to start (retrying)”. It runs perfectly without any problems or errors logged.
However, if we start the same workflow programmatically then strange things is happening. We are using _vti_bin/workflow.asmx and the “StartWorkflowAsync” method, and afterwards disconnects the client.
The workflow starts and processing, but after a little amount of time, the workflow stops with the “Failed to start (retrying)” (SP Internal State 8). The workflow is started with the same permissions as when we start it by hand thru the document library.
What is going on here, why isn’t it running as if we was starting it by hand? Help or hits in any directions would be very appreciated!
The following is in the log - especially the last line, where it tells me that the "Workflow Soap" it aborted, seems somehow that it hasn't unhooked the workflow soap call?
03-21-2012 13:45:50.19 w3wp.exe (0x2284) 0x1D58 SharePoint Foundation Database tzkv High SqlCommand: 'proc_FetchDocForUpdate' CommandType: StoredProcedure CommandTimeout: 0 Parameter: '@RETURN_VALUE' Type: Int Size: 0 Direction: ReturnValue Value: '' Parameter: '@DocSiteId' Type: UniqueIdentifier Size: 0 Direction: Input Value: '92fddace-905e-4016-a438-6aea431186d2' Parameter: '@DocWebId' Type: UniqueIdentifier Size: 0 Direction: Input Value: '0a9089cd-29f4-453c-a7f9-a9900512ee11' Parameter: '@DocDirName' Type: NVarChar Size: 4000 Direction: Input Value: 'test/testdoc.pdf' Parameter: '@DocLeafName' Type: NVarChar Size: 4000 Direction: Input Value: 'test.pdf' Parameter: '@UserId' Type: Int Size: 0 Direction: Input Value: '1073741823' Parameter: '@Version' Type: Int Size: 0 Direction: Input Value: '-1' Parameter: '@GetContent' Type: Bit Size: 0 Direction: Input Value: 'False' Parameter: '@GetWebListForNormalization' Type: Bit Size: 0 Direction: Input Value: 'False' Parameter: '@CacheParse' Type: Bit Size: 0 Direction: Input Value: 'False' Parameter: '@GetWebPartInfo' Type: Bit Size: 0 Direction: Input Value: 'False' Parameter: '@GetFileFormatInfo' Type: Bit Size: 0 Direction: Input Value: 'False' Parameter: '@bGetContainingList' Type: Bit Size: 0 Direction: Input Value: 'False' Parameter: '@GetCurrentMetaInfo' Type: Bit Size: 0 Direction: Input Value: 'False' Parameter: '@LooksLikeAttachmentFile' Type: Bit Size: 0 Direction: Input Value: 'False' Parameter: '@ChunkSize' Type: Int Size: 0 Direction: Input Value: '102400' Parameter: '@Level' Type: TinyInt Size: 1 Direction: InputOutput Value: '1' Parameter: '@RequestGuid' Type: UniqueIdentifier Size: 0 Direction: Input Value: 'e7933551-c6f4-4c84-865c-5e5160296f61' e7933551-c6f4-4c84-865c-5e5160296f61
03-21-2012 13:45:50.19 w3wp.exe (0x2284) 0x1D58 SharePoint Foundation Database btq8 High System.Threading.ThreadAbortException: Thread was being aborted. at SNIReadSync(SNI_Conn* , SNI_Packet** , Int32 ) at SNINativeMethodWrapper.SNIReadSync(SafeHandle pConn, IntPtr& packet, Int32 timeout) at System.Data.SqlClient.TdsParserStateObject.ReadSni(DbAsyncResult asyncResult, TdsParserStateObject stateObj) at System.Data.SqlClient.TdsParserStateObject.ReadNetworkPacket() at System.Data.SqlClient.TdsParserStateObject.ReadBuffer() at System.Data.SqlClient.TdsParserStateObject.ReadByte() at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) at System.Data.SqlClient.SqlDataReader.ConsumeMetaData() at System.Data.SqlClient.SqlDataReader.get_MetaData() at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method) at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method) at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior) at Microsoft.SharePoint.Utilities.SqlSession.ExecuteReader(SqlCommand command, CommandBehavior behavior, SqlQueryData monitoringData, Boolean retryForDeadLock) at Microsoft.SharePoint.SPSqlClient.ExecuteQueryInternal(Boolean retryfordeadlock) at Microsoft.SharePoint.SPSqlClient.ExecuteQuery(Boolean retryfordeadlock) e7933551-c6f4-4c84-865c-5e5160296f61
03-21-2012 13:45:50.21 w3wp.exe (0x2284) 0x1D58 SharePoint Foundation Workflow Infrastructure 98d5 Unexpected System.Threading.ThreadAbortException: Thread was being aborted. at System.Workflow.Runtime.Scheduler.Run() at System.Workflow.Runtime.WorkflowExecutor.RunScheduler() at System.Workflow.Runtime.WorkflowExecutor.RunSome(Object ignored) at System.Workflow.Runtime.Hosting.DefaultWorkflowSchedulerService.WorkItem.Invoke(WorkflowSchedulerService service) at System.Workflow.Runtime.Hosting.ManualWorkflowSchedulerService.RunOne(Guid workflowInstanceId) e7933551-c6f4-4c84-865c-5e5160296f61
03-21-2012 13:45:50.35 w3wp.exe (0x2284) 0x1D58 SharePoint Foundation Workflow Infrastructure 936l High Engine RunWorkflow: System.Threading.ThreadAbortException: Thread was being aborted. at System.Workflow.Runtime.Hosting.ManualWorkflowSchedulerService.RunOne(Guid workflowInstanceId) at System.Workflow.Runtime.Hosting.ManualWorkflowSchedulerService.RunWorkflow(Guid workflowInstanceId) at Microsoft.SharePoint.Workflow.SPWinOeHostServices.Send(SPWorkflow workflow, SPWinOeWorkflow winoeworkflow, SPWorkflowEvent e) at Microsoft.SharePoint.Workflow.SPWinOeEngine.RunWorkflow(SPWorkflowHostService host, SPWorkflow workflow, Collection`1 events, TimeSpan timeOut) e7933551-c6f4-4c84-865c-5e5160296f61
03-21-2012 13:45:50.39 w3wp.exe (0x2284) 0x1D58 SharePoint Foundation Workflow Infrastructure 72fs Unexpected RunWorkflow: System.Threading.ThreadAbortException: Thread was being aborted. at Microsoft.SharePoint.Workflow.SPWinOeEngine.RunWorkflow(SPWorkflowHostService host, SPWorkflow workflow, Collection`1 events, TimeSpan timeOut) at Microsoft.SharePoint.Workflow.SPWorkflowManager.RunWorkflowElev(SPWorkflow workflow, Collection`1 events, SPWorkflowRunOptionsInternal runOptions) e7933551-c6f4-4c84-865c-5e5160296f61
03-21-2012 13:45:50.57 w3wp.exe (0x2284) 0x1D58 SharePoint Foundation Workflow Infrastructure 98d8 Unexpected System.Threading.ThreadAbortException: Thread was being aborted. at Microsoft.SharePoint.Workflow.SPWinOeEngine.RunWorkflow(SPWorkflowHostService host, SPWorkflow workflow, Collection`1 events, TimeSpan timeOut) at Microsoft.SharePoint.Workflow.SPWorkflowManager.RunWorkflowElev(SPWorkflow workflow, Collection`1 events, SPWorkflowRunOptionsInternal runOptions) e7933551-c6f4-4c84-865c-5e5160296f61
03-21-2012 13:45:50.61 w3wp.exe (0x2284) 0x1D58 SharePoint Foundation Workflow Infrastructure 72fq Unexpected Start Workflow: System.Threading.ThreadAbortException: Thread was being aborted. at Microsoft.SharePoint.Workflow.SPWorkflowManager.RunWorkflowElev(SPWorkflow workflow, Collection`1 events, SPWorkflowRunOptionsInternal runOptions) at Microsoft.SharePoint.Workflow.SPWorkflowManager.StartWorkflowElev(Object context, SPWorkflowAssociation association, DateTime elevationTimeUtc, SPWorkflowEvent startEvent, SPWorkflowRunOptions runOptions) e7933551-c6f4-4c84-865c-5e5160296f61
03-21-2012 13:45:50.61 w3wp.exe (0x2284) 0x1D58 Document Management Server Workflow Features 8026 Critical Workflow Soap: StartWorkflow failed Item: http://sp2010/test/testdoc.pdf TemplateId: 0d3c1204-a824-48c3-8456-8651720ad957 Thread was being aborted. Error: Thread was being aborted. e7933551-c6f4-4c84-865c-5e5160296f61
Best regards Duftstenen!