SharePoint 2010 "Out of the Box" Workflow: Failed to Start / Cancelled by System Account

Answered SharePoint 2010 "Out of the Box" Workflow: Failed to Start / Cancelled by System Account

  • Wednesday, February 08, 2012 9:30 PM
     
      Has Code

    Greetings,

    I have a site collection where the site owner is asking me about a workflow that results in "Failed to start" messages.  The workflow is an approval workflow, available out-of-the-box in SharePoint 2010, that is assigned to a document library called "Company Policies".  If I click on the "Failed to start" status message, the workflow status page shows up (/_layouts/WrkStat.aspx) and says that (under "Workflow  History) the User ID is the System Account, and "The workflow was cancelled by System Account".

    This happens only in this one specific site collection, and nowhere else.  There are no errors in the Windows event logs, nor the ULS logs, for this issue. 

    Now, if I go to "View Workflow Reports" and try to set one of those up to see if it gives anymore information, the page errors with a Correlation ID.  When checking the ULS logs (again), the following error showed up (it is the ONLY error, the rest were just the normal "Leaving Monitored Scope" notifications):

    System.InvalidCastException: Specified cast is not valid.
    
    at Microsoft.Office.RecordsManagement.Reporting.ReportData.GenerateNextReport()
    
    at Microsoft.Office.RecordsManagement.Reporting.ReportBase.AggregateReports(Hashtable query, SPFolder folder, ReportNameGenerator reportNameGenerator)
    
    at Microsoft.Office.RecordsManagement.Reporting.ApplicationPages.CustomizeReport.OKBtn_Click(Object sender, EventArgs e)
    
    at System.Web.UI.WebControls.Button.OnClick(EventArgs e)
    
    at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument)
    
    at System.Web.UI.Page.RaisePostBackeVent(IPostBackEventHandler sourceControl, String eventArgument)
    
    at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

    Has anyone encountered this before?  Like I stated, it's the ONLY site collection that it happens on, and the Workflow features (even the aggregated SharePoint 2007 Workflows) are enabled.

    Any ideas or comments are welcome.

All Replies

  • Thursday, February 09, 2012 12:44 AM
     
     

    This KB article should help you.

    http://support.microsoft.com/kb/2496152


    Varun Malhotra ================= If my post solves your problem could you mark the post as Answered or Vote As Helpful if my post has been helpful for you.

  • Thursday, February 09, 2012 1:51 AM
     
     

    Hi ThatSharePointGuy,

    I would like to share you a little about your situation that might be related to a very common issue I've seen among SharePoint folks. When running workflow under System Account, the workflow doesn't run automatically.

    Regards,


    SharePoint in Vietnam Blog: The SharePoint diary

  • Thursday, February 09, 2012 4:48 PM
     
     

    Varun Malhotra:

    Thank you for the KB article link, but I found that one yesterday.  Unfortuantely, the images on the KB article do not load because it asks for login credentials for the partner site that hosts the images...but that's a different matter.  When I turned off Workflows, and went in to SharePoint Designer to delete the workflow, and then turned Workflows back on again, I created a new workflow and it still lists as "Failed on Start".

    Thuan Soldier:

    I am not sure why the workflows run under the System Account.  Do you have a recommended way to force them to use a different account (say, the farm account, for instance)?

    I appreciate both of your posts!



    • Edited by Get-SPKen Thursday, February 09, 2012 4:48 PM
    • Edited by Get-SPKen Thursday, February 09, 2012 4:49 PM
    •  
  • Thursday, February 09, 2012 5:49 PM
     
      Has Code

    I found this article here on TechNet: Workflow not running with system account login?

    I attempted to use this command:

    stsadm.exe –o setproperty –propertyname declarativeworkflowautostartonemailenabled –propertyvalue yes

    And it says that it completed successfully. 

    I deleted the workflow I created as a test, and created a new one.  However, the workflow still shows "Failed on Start" for the workflow status, and on the workflow statistics page (/_layouts/WrkStat.aspx), it lists the workflow that started when I uploaded a new document as "Canceled by System Account".

    I have tried deactivating the "Workflows" feature on the site collection, and removed the workflows in SharePoint Designer as well (following another blog post).  Our users do not use SharePoint Designer, so all of the workflows are "out of the box" solutions.  However, even after activating the "Workflows" feature again on the site collection, they still fail on start.

    This is only happening on one site collection - the rest of the site collections under this web application work perfectly fine.  I have no idea what is causing this, but nothing was done to the servers since January 1st (monthly updates, server maintenance, etc),  yet the users in this site collection say that their workflows were working up until about two weeks ago.

  • Saturday, February 11, 2012 4:58 AM
     
     

    Hi

    workflows and event recievers doesnot work with System Accounts

  • Tuesday, February 14, 2012 7:27 AM
     
     

    Hi,

    1. Please create a new out of box list and copy the workflow from the original list using sharepoint designer to check if it is working fine.

    2. If it is still not working, please compare the web.conf file of normal web application with the one of your issue web application to see if there are some special differences. or you can backup the original web.conf and copy the web.config of the normal web application to the issue one, and then IISRESET to check the result.

    Regards,

    Seven

    • Marked As Answer by Seven M Friday, February 17, 2012 6:42 AM
    • Unmarked As Answer by Get-SPKen Friday, February 17, 2012 11:08 PM
    •  
  • Friday, February 17, 2012 11:07 PM
     
     

    Seven M,

    I'm sorry for the long post. 

    Just a note: all of the site collections in this farm are under the same web application, so I am unable to copy the web.config files (great idea though).

    I am not proficient in SharePoint Designer (of any version)...  I read through Bing.com, TechNet, and the F1 Help files in SharePoint Designer, but found no info on moving Workflows from one list to another.

    1. I created a new list ("testList", document library) in the site collection with the problem...
    2. Navigation > Site Objects > Workflows, no workflows were listed for the site, even though I have created one "Out of the box" in SharePoint... 
    3. Navigation > Site Objects > Lists and Libraries, click the link for the document library that I created last week that has the "Out of the box" workflow on it...and the workflow is listed, but there is no way to copy or edit it (clicking "Edit" just opens the SharePoint page in Internet Explorer for the Workflow's settings).
    4. I searched Bing and Google profusely, but wasn't able to find an answer on "sharepoint 2010 how to copy sharepoint workflow in designer" (to copy a sharepoint-created workflow on a list in SharePoint Designer and paste it onto another list).

    I DID happen to get a Workflow working...but it was created in SharePoint Designer....

    1. I created a new document library (again) in SharePoint Designer ("testList2")...
    2. Navigation > Workflows > Reusable Workflow (in SPD menu bar)...
    3. Created a "Collect Feedback" step (by searching for "feedback")...
    4. Clicked "Associate To List" and selected my "testList2" list...
    5. Set my email address as the person to contact...Published the workflow...
    6. Went to the SharePoint site (the same one as before)...Uploaded a file...
    7. Workflow status was set to "In Progress".  I DID get a "Due to heavy load, the latest workflow operation has been queued.  It will attempt to resume at a later time".
    8. 5 minutes later, I received the email notification of the feedback workflow...
    9. I went to the task list, gave the file my feedback, and submitted it...notified in email within 5 seconds of task completion.
    10. Workflow Status page showed "Feedback was completed" for the "Workflow Completed" event type.
    11. testList2 Workflow - Completed Successfully , It completed under my User ID "John_Doe".

    BUT!!!

    1. I created a new document library (yet again), in Internet Explorer ("testList3")...
    2. List Settings > Workflow Settings > Add Workflow > "Collect Feedback - SharePoint 2010"...
    3. Set my email address as the contact...saved the workflow...
    4. Uploaded a file...
    5. And the workflow fails again.
    6. testList3 Workflow - Failed.jpg , It failed under the User ID "System Account".

    Our users do not have access to SharePoint Designer (company rules, although whether its software-cost related, training-cost related for users, or not "validated" through our enterprise security team, I'm not sure)...so creating workflows in SPD isn't a solution that is acceptable. ;-(

    I'm stumped!!!  Two brand-new lists (both Document Libraries), both with a brand-new Feedback workflow attached to each list...and one succeeds where the other one fails...Why would this happen?  Does this offer any useful information? 

    edit - formatting issues.




    • Edited by Get-SPKen Friday, February 17, 2012 11:09 PM
    • Edited by Get-SPKen Friday, February 17, 2012 11:10 PM
    • Edited by Get-SPKen Friday, February 17, 2012 11:11 PM
    •  
  • Tuesday, February 21, 2012 2:31 PM
     
     

    Rehan,

    I am sorry that I did not respond - I did not see your post.  I understand that workflows and event receives do not work with System Accounts, but am unaware of how to make all workflows in this site collection use the user accounts and not the system account.  I created one in SharePoint Designer on Friday, and it worked perfectly (and says it ran under my own account). 

  • Tuesday, February 28, 2012 7:29 PM
     
     

    I have been unable to resolve this issue, and wanted to bump this thread to see if anyone had more ideas.  Thanks!

    In short: SPD list workflow runs under my account and finishes successfully.  SP2010 list workflow runs under System account and is always "canceled by system account".  No idea why - both workflows do the same thing (gather approval from (at least, in testing) me when I upload to a document library).

  • Tuesday, March 13, 2012 7:18 AM
     
     

     How did you go with this? I'm having the same issue.

    If I find a resolution, I'll pop back to update.

  • Tuesday, March 13, 2012 9:38 PM
     
     

    Aidan,

    I have yet to find a solution for the issue.  Sadly, my network of friends who work in the IT field does not include anyone with SharePoint experience, and I haven't found answers online either. 

    • Proposed As Answer by Harold P. Gray Friday, March 23, 2012 3:49 PM
    • Unproposed As Answer by Harold P. Gray Friday, March 23, 2012 3:49 PM
    •  
  • Friday, March 23, 2012 4:12 PM
     
     Answered

    Here's a solution that worked for me - (I haven't found an alternative and I know it's a bit of a pain).

    1. The issue is that the "System Account" does not have an email address - and thus sending emails will fail with a null "From" address.

    2. The solution is to give the System Account an email address.

    3. BUT - The system account will most likely have two "profiles" - the "My Settings" and a "Profile".. Looks like the "My Settings" values are used in the case of the "SHAREPOINT\system" account...

    4. You can log in as the System Account and change the My Profile settings via the user info dropdown - upper right - open and set an email address. Won't let you change anything if you open "My Settings"

    5. You can use Central Admin / Profiles - but this didn't work fully for me... I was unable to edit the "SHAREPOINT\system" account

    Manage Profile Service /User Profile Service Applciation / Manage User Profiles

    6. FINALLY - I then fixed the issue fully by : (gnashing of teeth)...

    Open SQL Manager - Navigate to WSS_Content / Tables / UserInfo

    Open a New Query window

    Update the table - adding an address for tp_Login = "SHAREPOINT\system" ... (I also had to specifically do the same for the specific user account that "is" SHAREPOINT\system ... i.e. do two different updates...)

    UPDATE

    [WSS_Content].[dbo].[UserInfo]

    set

    tp_Email = 'validaddress@yourdomain.com'

    where

    tp_Title = 'System Account'

    go

    UPDATE

    [WSS_Content].[dbo].[UserInfo]

    set

    tp_Email = 'validaddress@yourdomain.com'

    where

    tp_Title = 'thedomain\accountlogin'     /* The account used as "Sharepoint\System" account */

    go

    • Marked As Answer by Get-SPKen Tuesday, July 03, 2012 3:22 PM
    •  
  • Tuesday, July 03, 2012 3:22 PM
     
     Answered

    I just wanted to update this: I was unable to find this old thread that I had made, and made a new one and posted my findings in it here: This solved my problem.  It took a while, but I solved it (unintentionally, I guess, as I'm uncertain as to what was wrong).

    Your answer was great, Harold, but it did nothing for my farm, unfortunately ;-(

    • Marked As Answer by Get-SPKen Tuesday, July 03, 2012 3:22 PM
    •  
  • Wednesday, April 03, 2013 1:35 AM
     
     

    Hi Get-SPKen,

    I know this is an old post but would like to share my experience with this same issue. Below is what i did to resolve my issue.

    1. Deactivated all the workflow features in the site collection
    2. Stopped the “Microsoft SharePoint Foundation Workflow Timer Service“ for all the servers through the Central Admin
    3. Started the service for all the servers.
    4. Activated all the workflow features in the site collection
    5. Created an OOTB workflow for the library.
    6. Started a new instance of the workflow manually. This workflow instance ran successfully.

    • Edited by Pramit John Wednesday, April 03, 2013 1:36 AM made text changes
    •  
  • Wednesday, April 03, 2013 5:43 AM
     
     

    Hi,

    Whats you farm configuration mean APP or Web Server.

    Stop workflow timer service from app server and it should be run on web server.

    http://social.msdn.microsoft.com/Forums/en-US/sharepointadminprevious/thread/02cde635-fcbe-47b6-807b-310228d1e64f

    thx


    iffi