SharePoint Designer 2013: Unexpected Error on server associating the workflow

This post is a contribution from Raghavendra Nanjaiah, an engineer with the SharePoint Developer Support team

What is the issue?

When you try to publish the SharePoint 2010 reusable or list workflow on SharePoint 2013 platform using SharePoint designer 2013 you will get following exception in UI


If you carefully observe the ULS logs

08/22/2014 16:17:53.40          w3wp.exe (0x2610)      0x05D4            SharePoint Foundation      Legacy Workflow Infrastructure           xmfh    Medium           Workflow Compile Failed: Could not find a part of the path 'C:\Users\devapppool\AppData\Local\Temp\cjjkiult.tmp'. b118b19c-3fad-30ad-ac8b-ed8c02395742

Why we face this issue?

During the workflow publishing phase, SharePoint will create couple of temporary files under the temp folder (of the app pool service account). As part of clean-up process w3wp process will delete this files later.

Sometimes, instead of deleting content inside temp folder w3wp process deletes the temp folder. Because of which workflow publishing fails with “Could not find a part of the path”

How to work around this issue?

Create a text file and provide read only access to file. This will stop process from deleting temp folder.

1. Navigate to C:\Users\<service-acct>\AppData\Local\Temp on both the server (WFE1 and WFE2)

2. Create a text file inside the temp folder and in the properties check read-only option.

3. Reset iis /noforce

4. Publish the workflow.