SharePoint 2013: Workflows (2010 Workflow Template) not running properly and Tasks are not getting approved/reject

Gaurav Singh Gagwari 1 Reputation point
2020-07-27T12:00:35.883+00:00

Dear All,

I have created a workflow in SharePoint 2013 using 2010 workflow template. This workflow is running when any new item is uploaded in the document library.
In the library upload properties form, there are 7 users fields, which are used in workflow to assign task to them.
I have used Start task process to create tasks and assign to the users sequentially upto 7 level. But at level 2, I am generating 2 parallel tasks and then waiting them to complete and then passing no to 3 level and so on.

I have also created 2 new fields in Task list through Tasks(in workflow) only and then setting values it in at stage 'Before a Task is Assign' using Set Task field.

Issue:

Issue1: When end users are uploading the document, sometimes workflow is not working properly and throwing error stating 'an error has occurred' and 1st level task is not getting generated.
Issue2: And sometimes when users are trying to approve/reject tasks then they are not able to do so as they are receiving 'Task is locked by the running workflow and cannot be edited' error.

Workaround:
When I am restarting the workflow after terminating the it is running fine. But the above errors are occurring intermittently. Could you please help in this, as this workflow is running on 26 sites and many users are using it daily.
But this is not feasible as there are 26 sites on which workflow is running.

ULS logs error:
Winwf internal error terminating workflow SharePoint 2010
can't find workflow service proxy or its service application proxy type name is null

Other Info:
Publishing workflows using System account but not using Impersonation step. As Tasks are created with user who is uploading the document.
SharePoint Timer Service is running with Farm account
SharePoint Tracing Service is running with local service account

SharePoint Server Development
SharePoint Server Development
SharePoint Server: A family of Microsoft on-premises document management and storage systems.Development: The process of researching, productizing, and refining new or existing technologies.
1,596 questions
SharePoint Server Management
SharePoint Server Management
SharePoint Server: A family of Microsoft on-premises document management and storage systems.Management: The act or process of organizing, handling, directing or controlling something.
2,893 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Itch Sun-MSFT 2,556 Reputation points
    2020-07-28T02:59:07.78+00:00

    'Task is locked by the running workflow and cannot be edited'

    A cause of this error appearing inconsistently is multiple users responding to tasks in parallel at the same time. In this scenario, one task will complete correctly and the other will not process. When the user tries again, the ‘task locked’ message will display.

    In this case, the workflow is locked. In general, it's hard to find a real reason, and if circumstances permit, I suggest you change a complex workflow into several different workflows.

    In addition, According to the ULS log you provide. Please check if the Due Date of the task is in the past instead of the future first.

    If yes, please modify it to the future and then test.

    You can also try to unregister and register the Workflow Proxy. Follow steps to unregister and register the Workflow Proxy:

    1. Go to Central Admin > Manage Service Application > Click on the Workflow Service Application Proxy.
    2. Select it and from the Ribbon click Delete.
    3. Run Register-SPWorkflowService in the PowerShell window. Would recommend using the –Force parameter.