Tuesday, April 21, 2015

Problem: Workflow is not started by the first event

The workflow is not started by the first event ("item created" or "item changed"), after that it works well.

It only happens in one site collection.

Soon I found the error message in ULS: "The requested workflow task content type was not found on the SPWeb"

Google search leads to this post. But re-creating Tasks list didn't resolve the problem in my case. The other posts all recommend to reactivate "OffWFCommon" feature. But it still didn't help.

Then I realized where the problem is.

SharePoint structure is based on "template". From the error message in ULS, it's easy to guess that the site content type "Tasks" is corrupted somewhere. Reactivating "OffWFCommon" feature only fixes the site content type template, not the content type instance in the Tasks list.

So the solution is simple.

1. Reactivate "OffWFCommon" feature

stsadm -o deactivatefeature -filename OffWFCommon\feature.xml -url http://sp.domain.local/sites/site1
stsadm -o activatefeature -filename OffWFCommon\feature.xml -url http://sp.domain.local/sites/site1

2. Rebuild "Tasks" list


Any comments welcome!

[update, 2016-07-21]

PowerShell script:

$siteUrl = "http://sp.domain.local/sites/site"

disable-spfeature -identity "OFFWfCommon" –url $siteUrl
enable-spfeature –identify "OffWfCommon" –url $siteUrl

https://blogs.technet.microsoft.com/sharepoint_scott/2012/10/05/intermittent-workflow-failures-the-workflow-failed-to-start-due-to-an-internal-error/

2 comments:

  1. In your 2nd step, when you rebuild the task list, do you then re-associate any workflows with this new task list, or is it just the process of creating the new task list that is required?

    ReplyDelete
    Replies
    1. Just need to rebuild the task list. Task list ID is not changed.

      Delete