A Task is stuck in a workflow step for an extended period. The step is followed by the completion of the Task, for example, Test Asset Name followed by the completion of the task. Once a Task is completed, it is copied to the ARCHIVETASKS table. This is a relevant information to troubleshoot this issue. Restarting WorldServer does not resolve the issue, the tasks still hang in the same workflow step and do not move to completion. Sending the task to Autoerror and completing the error leads to the step being stuck again and not completing. In the ws-legacy.log, the following entry appears multiple times: (covers java.sql.SQLIntegrityConstraintViolationException: [SDL WorldServer][SQLServer JDBC Driver][SQLServer]Violation of PRIMARY KEY constraint 'TASKSARCPK'. Cannot insert duplicate key in object 'dbo.ARCHIVETASKS'. The duplicate key value is (2412608)Attempting to cancel the Task fails with the same error, displaying as an Internal error, and the task is not cancelled. Note: once a Task is completed, it is copied to the ARCHIVETASKS table. This is a relevant information to troubleshoot this issue. |
Follow these steps: 1- Send the Task to Autoerror: If the Task is still executing, send it to Autoerror. 2- Find the Task ID: Click on the Task History of the affected tasks. In the URL, you will find the Task ID. Example of a Task URL (partial): assignments_task_info?&task=2412608 Here, 2412608 is the Task ID. Make a note of it. 3- Connect to the WorldServer Database. 4- Run the Query: Based on the example above, run this query: select * from ARCHIVETASKS where TASKID=2412608 The result will display that this Task is already in the ARCHIVETASKS table. If it wasn't, you would get no results.5- Delete the Task from the ARCHIVETASKS Table: Run the following command to delete the Task: delete from ARCHIVETASKS where TASKID=2412608 5- Complete the Autoerror: Go back to the Tasks page and complete the Autoerror. The step should now be executed correctly. |
For some reason, the Task has already been moved to the ARCHIVETASKS table although the Task is not completed yet, creating a duplicated entry |