Intermittent Workflow failures - ‘The workflow failed to start due to an internal error’

I just got through working a pretty nasty workflow issue that had  nothing to go on with verbose ULS logging.   Our issue was that even the most basic workflow’s were failing on a brand new custom list, with the first item created.  After the first item was created the workflow would work fine for X amount of time.   This issue was ugly, and intermittent, and it probably would have helped if I read this first - https://support.microsoft.com/kb/2001370

 

We found a way to reproduce the error with the following:

1.)   Create a new list

2.)   Create a new workflow with SharePoint Designer

             a.)   Step 1: Email user X

3.)   Create a new list item

4.)   Start the workflow

5.)   Watch the failure

Note: Every other attempt after this work would fine  (restarting the workflow)

 

 

Like I said – the ULS logs were clean, tracking the correlation ID we came up with nothing.    Right when we took a break to review the final 3 sets of logs, my friend Wes had attempted a fix he used in the past with another workflow problem.

Disabling the OffWfCommon feature

disable-spfeature -identity  "OFFWfCommon" –url https://yoursitehere/sites/site

enable-spfeature –identify “OffWfCommon”    –url  https://yoursitehere/sites/site

 

After doing this the workflow consistently worked - but had me questions as to why, so I did some checking and I have found this to be a fix for other similar workflow issues such as a modified “Workflow Task” content type version that contains this error:  

The requested workflow task content type was not found on the SPWeb

If you have a modified "Workflow Task" version greater then 0 and are seeing this same issue, the steps above may be relevant.  I would always recommend testing this in a test environment fully before doing it.   Here is some sample PowerShell code to help find versions that are not 0.  Again, to be used in a test environment.

 

$site = get-spsite https://yoursitehere/sites/site  
$site = $site.RootWeb
foreach ($sites in $site)
{
   foreach ($ctype in $site.ContentTypes)
  {
       if ($ctype.name -eq "workflow Task" -and $ctype.version -gt "0")
           {

              $ctype.Scope,$ctype.name,$ctype.version }
            }

  }

}

 

Please only use these steps if you are experience the exact scenarios listed above, and I hope this helps you!