none
Sharepoint 2013 crashes indefinitely after workflow publishing error.

    Question

  • Hello,

    I am using Sharepoint Designer 2013 with a Sharepoint 2013 foundation server on Windows Server 2012. Just a preface here regarding the issue below: Rebooting appears to resolve the problem until the next workflow compilation error. The bottom line is that I had to reboot the server 10 times in the last 2 days. I am not seeing anything else out there that resembles this problem, so I would appreciate any advice about what we can do from here.

    After publishing a workflow, I received the following errors: 

    Errors were found when compiling the workflow. The workflow files were saved but cannot be run

    (0, 0) Activity 'ID187' validation failed: An IfElseActivity must have at least one child of type IfElseBranchActivity.)

    (0, 0) Activity 'ID201' validation failed: An IfElseActivity must have at least one child of type IfElseBranchActivity.)

    The larger problem, however, is that once ANY workflow publishing error occurs, I will get the following message when I try to perform any workflow publishing until the server is rebooted.

    Errors were found when compiling the workflow. The workflow files were saved but cannot be run: Unexpected error on server associating the workflow.

    I also noticed there are several links when navigating through the settings page that produce varying errors similar to this:

    An error occurred during the compilation of the requested file, or one of its dependencies. Could not write to output file 'c:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\784a69f1\95fd2dd1\App_Web_vsubwebs.aspx.9c9699a8.1xoeknv5.dll' -- 'The directory name is invalid. ' 

    Correlation ID: 48d1359c-34f9-c0b9-135f-ddb6110cc676 

    Date and Time: 8/4/2013 3:57:14 PM 


    Sunday, August 04, 2013 8:02 PM

Answers

All replies

  • Hi,
    According to your post, the server-side validation for the workflow was unsuccessful may be because of errors in the workflow or one or more actions used in the workflow reference assemblies are not listed or listed as unsafe in the safe list in the web.config file.

    You can try the following steps:
    1. Re-register workflow service and publish a simple workflow to see if the error still occurs.
    http://social.technet.microsoft.com/Forums/sharepoint/en-US/46a868eb-a012-4148-8319-088d55671ae7/errors-were-found-when-compiling-the-workflow-the-workflow-files-were-saved-but-cannot-run
    2. Open the web.config file and make sure that the workflow reference assemblies are listed correctly in the file.
    3. Make sure the workflow design uses valid data and logic.

    Best regards.
    Thanks

    Wednesday, August 07, 2013 10:13 AM
    Moderator
  • I can confirm this behavior. In our environment if a publish attempt ever receives this message: "Errors were found when compiling the workflow. The workflow files were saved but cannot be run: Details..." all workflow publishing fails on the entire farm (All Web Applications). We are also receiving this message:  "Unexpected error on server associating the workflow". This error can be reproduced. We have found that doing an IISRESET on one of our front end servers resolves the issue. However, resetting IIS every time this issue occurs is not a viable solution.
    Wednesday, October 02, 2013 9:23 PM
  • We were experiencing a similar issue and it has since been submitted as a bug to the .NET framework product team by the Microsoft escalation engineers working our premiere support ticket.  

    When the error occurs, the associated application pool service account's temp folder gets deleted.  Recreating the 'Temp' folder in the following path fixes the errors without having to restart the application pool.
    Path: C:\Users\<service-acct>\AppData\Local\Temp

    An alternate workaround is to create a read-only file within the Temp directory so that it cannot be deleted.

    marcadamcarter

    Sunday, May 25, 2014 6:00 AM
  • I am seeing the same error when I try to publish my Workflow to my SharePoint 2013 site via SharePoint Designer 2013.

    I have tried an IISReset /noforce on the Web Front End server and I've also recreated the Temp folder under the Web Application pool account, however both haven't fixed the problem.

    Has there been any further update from Microsoft?

    Thanks

    Yoshi

    Wednesday, May 28, 2014 2:17 AM
  • Yoshi,

    A couple questions to clarify...

    Are you publishing workflows with complex or nested logic statement? If so, have you already gone through solutions posted by Victoria above?  What were the results?

    Have you verified that the Web App Service Account Temp directory is/isn't being deleted? Path: C:\Users\<service-acct>\AppData\Local\Temp Can you verify that the issue is isolated to a single web app?

    Have you attempted to re-register the Workflow Service (SP2013 Workflows)?

    If publishing Workflows with logic...Have you attempted to add to executionTimeout property in web.config file to increase the timeout interval (Make a copy of the web.config file before editing anything). For more information, refer to:
    Fixed: SharePoint Designer Error - Unexpected error on server associating the workflow: http://www.manjuke.com/2011/05/fixed-sharepoint-designer-error.html


    marcadamcarter


    Wednesday, May 28, 2014 2:37 AM
  • Hi maradamcarter

    Yes, my workflow does contain a number of conditional statements. I have found that publishing small sections of the workflow has worked but it fails again when I add more than 4 conditional statements.

    I created a txt file in the Temp folder of the application pool account on the WFE and set it to Read Only. This prevents the Temp folder from being deleted. However, I still see the error.

    I haven't tried Victoria's suggestion above as I'm using the SharePoint 2010 Workflows in my SharePoint 2013 site. Should I run the command nevertheless?

    I will extend the timeout now and let you know.

    Cheers

    Yoshi

    Wednesday, May 28, 2014 2:46 AM
  • Extending the timeout to 300 did not fix the error unfortunately.

    Wednesday, May 28, 2014 2:51 AM
  • Yoshi,
    This sounds like a similar but different problem than we were experiencing based on your previous statement ("workflow does contain a number of conditional statements").  Please take a look at my posting (http://social.msdn.microsoft.com/Forums/sharepoint/en-US/079f86d2-fb9c-48e2-b928-3ee31b636129/spd2010-workflows-causing-sp2013-indefinitely-crash-after-publishing-error) and the last example I posted titled "Posting example steps to reproduce error:" 

    Also, if the fact that you're able to publish portions of the workflow without error seems to point more to the conditional statements.  Does it appear to matter which statements produce the error?

    Despite the workaround we employed, we still receive an initial error when publishing the workflow however it no longer inhibits us from republishing a valid workflow where before it required an IISRESET or web app reset.

    Also, once you receive the error, is it isolated to a single web app or does the publishing error break all web apps (assuming you have more than one)?


    marcadamcarter

    • Proposed as answer by SharePointYo Wednesday, May 28, 2014 5:02 AM
    Wednesday, May 28, 2014 3:33 AM
  • We have 2 web applications, one for the main SharePoint 2013 site and one for MySites.

    I just tried increasing the timeout to 1000 but still the problem persists.

    I'm thinking maybe there is a problem with my conditional statements.

    This is what they look like now

    if
     
      if
        email someone
      else
        email someone else
    
      if
       
         if
           email someone
         else
           email someone else
       else if
        
         if
           email someone
         else
           email someone else
       else if  (adding these 3 links breaks it)
    
         if     (adding these 3 links breaks it)
         
         else   (adding these 3 links breaks it)
    
       else
          email someone
    else
        email someone

    Now in addition to the ones above, I have a few more conditions to add. This Workflow however works in my DEV site, which I started building before I went to the latest service pack for SP2013 last week. So all i'm doing now is recreating the same Workflow in my Production site.

    Yoshi


    Wednesday, May 28, 2014 3:48 AM
  • I think I found the problem. It points to a block of if else statements. After getting rid of the block, I added the remaining condition and it deployed correctly.

    I will attempt to add the problem block back in line by line.

    Thanks for your suggestions.

    Cheers

    Yoshi

    Wednesday, May 28, 2014 3:53 AM
  • Sounds like you're headed in the right direction.  One note: we experienced no workflow errors with the RTM SP2013 release but only started experiencing issues after MAR 2013 PU and all subsequent releases including SP1.  Not knowing the versions you're running in DEV vs. PROD, this might be something to consider.  However, it sounds like your issue is rooted in your workflow.  

    If you find a block that seems to cause errors you might isolate that condition block out to its own workflow and see if it produces the problem alone or only with other conditions and then try repeating on your DEV.

    Good luck!


    marcadamcarter

    Wednesday, May 28, 2014 4:40 AM
  • Hello

    I solved the problem by isolating the block if condition statements after which I found that my action wasn't sitting correctly inside the condition.

    Too easy!

    Thanks again.

    Yoshi

    Wednesday, May 28, 2014 5:01 AM
  • Did the trick for me. Thanks.
    Tuesday, August 26, 2014 2:40 AM
  • Hi marcadamcarter, Is this issue resolved ?
    Wednesday, August 27, 2014 12:36 AM
  • Hello RaghavendraBN, 

    To the best of my knowledge, yes the issue should be considered resolved.


    marcadamcarter

    Wednesday, August 27, 2014 5:11 AM
  • Thank you Marcadamcarter. 

    Just an additional question.

    "temp folder is getting deleted" is that bug fixed ? any specific CU or Hotfix?

    Thursday, August 28, 2014 3:31 PM