Showing posts with label Workflow. Show all posts
Showing posts with label Workflow. Show all posts

Thursday, December 31, 2015

SharePoint 2013: Something went wrong. To try again, reload the page and then start the workflow

Problem

When users try to manually start a 2013 workflow on a list item, they experience the following error message:
They experience this error message when attempting to start any 2013 workflow.  They do not experience this error message when starting 2010 workflows.

Solution

  • Verify that all 2013 workflow services have been started.

References

  • None

Notes

  • When I experienced this error message, I first checked if a simple 2013 workflow would run. When that also failed, I suspected that it was 2013 workflow infrastructure related.  For this farm, all workflow services (aside from the usual client services) ran on a single application server.  To begin troubleshooting, I first checked the status of all 2013 workflow services on the application server.  I then discovered that the Service Bus Message Broker service was stopped.  After starting this service again, and I reloaded the page, and I was able to start 2013 workflows again without issue.  No need to re-publish the workflow.

Tuesday, September 1, 2015

SharePoint 2013: [workflow] failed to start or run

Problem

You have created a workflow attached to a list that is triggered via a custom information management policy involving retention date. You find that the workflow does complete, but only after a long delay.  Looking in the Workflow History for the list item, you see the following:

Date OccurredEvent TypeUser IDDescriptionOutcome
9/1/2015 10:25 AMErrorSystem Account[workflow] failed to start
9/1/2015 10:25 AMErrorSystem Account[workflow] failed to run
9/1/2015 10:49 AMCommentSystem Account[workflow] triggered

And this experience is repeatable.  Each time the workflow is triggered; it first fails to start; it then fails to run; and then, a few minutes later, it does in fact complete.  The workflow history provides no immediate clues as to what the cause might be.  However, it does at least provide a time stamp, and using this, along with the ULS logs, will enable the cause to eventually be identified and resolved.  In this case, the cause was eventually found to involve McAfee On-Access Scan (OAS), and the solution was simply to turn off and on OAS.  Next, I present my troubleshooting steps.

Troubleshooting

  1. Reviewed list item workflow history.
  2. Created new list items configured to trigger information management retention policy, and then re-ran appropriate timer jobs: issue was repeatable.
  3. Checked server system and application event logs on both WFE, seeking events that occurred at about the same time as the workflow time stamps: no events found.
  4. Reviewed ULS logs on both WFE's for events occuring at about the same time: identified key ULS entry (among others having same correlation ID):
    Process: OWSTIMER.EXE
    Product: SharePoint Foundation
    Category: Legacy Workflow Instrastructure
    Level: Unexpected
    tbdRunWorkflow: Microsoft.SharePoint.SPException: <error><compilererror column="-1" line="-1" text="Compilation failed. Could not load file or assembly 'Xoml.8a0e3a04_01c8_4fa3_a7dc_a23122cdcf10.2.4096.-1.0.dll' or one of its dependencies. Access is denied."></compilererror></error>  
     at Microsoft.SharePoint.Workflow.SPNoCodeXomlCompiler.LoadXomlAssembly(SPWorkflowAssociation association, SPWeb web)  
     at Microsoft.SharePoint.Workflow.SPWinOeHostServices.LoadDeclarativeAssembly(SPWorkflowAssociation association, Boolean fallback)  
     at Microsoft.SharePoint.Workflow.SPWinOeHostServices.CreateInstance(SPWorkflow workflow)  
     at Microsoft.SharePoint.Workflow.SPWinOeEngine.RunWorkflow(SPWorkflowHostService host, SPWorkflow workflow, Collection`1 events, TimeSpan timeOut)  
     at Microsoft.SharePoint.Workflow.SPWorkflowManager.RunWorkflowElev(SPWorkflow workflow, Collection`1 events, SPWorkflowRunOptionsInternal runOptions)
  5. Created new list item configured to trigger information management retention policy, re-ran appropriate timer jobs, and then reviewed ULS logs to determine if above entry was repeated: it was.
  6. Performed Internet search: found promising posting [4] indicating that anti-virus may be involved.
  7. Disabled McAfee OAS, created new list item configured to trigger information management retention policy, and then re-ran appropriate timer jobs: workflow completed without any issue.
  8. Created new list items configured to trigger information management retention policy, and then re-ran appropriate timer jobs: workflow completed without any issue.
  9. Re-enabled McAfee OAS, created new list item configured to trigger information management retention policy, and then re-ran appropriate timer job: workflow completed without any issue.
  10. Created new list items configured to trigger information management retention policy, and then re-ran appropriate timer jobs: workflow completed without any issue.

Solution

  • Disable anti-virus.

References

  • Information Management Policy for retention involves to key timer jobs: Expiration policy and Information management policy.  The first look at each list item and applies the information management policy retention setting that you configured, updating the hidden Expiration Date column for a list item.  The second jobs reviews the Expiration Date column and then executes the information management policy configured for the condition if the condition requirement is met.
  • Farm topology: small, three-tier, having one app, two WFEs, and one SQL Server instance.
  • Due to employing network load balancing (in this case Windows NLB), you will need to check both ULS logs to find the ULS entries mentioned above.  This is due to the fact that information management policy may be run on either WFE and you don't know which.
  • .NET version being used: to determine this, launch IIS, and then go to the Application Pools listing. One column that is displayed is the .NET Framework Version.
  • Location of Temporary ASP.NET Files folder: for default installations, patched through June 2015, this would be: C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files

Monday, July 20, 2015

SharePoint 2013: Workflow 2013: Sorry, something went wrong

Problem

Your users report that, when they launch a 2013 workflow, nothing happens for a minute or two, and then they are presented with the Sorry, something went wrong, page (below).  Workflow foundation is installed to a SharePoint application server.  Your farm is patched through June 2015.

Troubleshooting
  1. Tested all 2013 workflows available from the web application and found that all 2013 workflows failed.  
  2. Testing 2010 workflows and found that they continued to function as expected. 
  3. Checked that the following services were started on the server hosting Workflow Foundation:
    1. Service Bus Gateway
    2. Service Bus Message Broker
    3. Windows Fabric Host Service
    4. Workflow Manager Backend
  4. Checked the Unified Logging System (ULS) logs and found a block of messages associated with the correlation ID.  Some examples:
    A runtime exception was detected. Details follow. Message: Thread was being aborted. Technical Details: System.Threading.ThreadAbortException: Thread was being aborted. at System.Threading.WaitHandle.WaitOneNative(SafeHandle waitableSafeHandle, UInt32 millisecondsTimeout, Boolean hasThreadAffinity, Boolean exitContext) at System.Threading.WaitHandle.InternalWaitOne(SafeHandle waitableSafeHandle, Int64 millisecondsTimeout, Boolean hasThreadAffinity, Boolean exitContext) at Microsoft.Workflow.Common.AsyncResult.End[TAsyncResult](IAsyncResult result) at Microsoft.Workflow.Client.HttpGetResponseAsyncResult`1.End(IAsyncResult result) at Microsoft.Workflow.Client.ClientHelpers.SendRequest[T](HttpWebRequest request, T content) at Microsoft.Workflow.Client.HttpWorkflowNotificationPublisher.OnPublishNotification(String address, WorkflowNotification notification, ICredentials credentials, String userCulture, Guid traceActivityId, TimeSpan requestTimeout) at Microsoft.Workflow.Client.WorkflowNotificationPublisher.PublishNotification(String address, WorkflowNotification notification, ICredentials credentials, String userCulture, Guid traceActivityId, TimeSpan requestTimeout) at Microsoft.Workflow.Client.WorkflowManagementClient.PublishNotification(WorkflowNotification notification, IDictionary`2 activationMetadata, Int64 expectedScopeRevision) at Microsoft.SharePoint.WorkflowServices.WorkflowProxy.PublishEvent(String eventSource, String eventType, IDictionary`2 payload, SPUserToken userToken)
    and
    Leaving Monitored Scope (Event Receiver (Microsoft.SharePoint.WorkflowServices, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c, Microsoft.SharePoint.WorkflowServices.ContentSubscriptionEventReceiver)). Execution Time=118831.7039
    and others
    This block of messages recurred whenever a 2013 workflow was initiated.
  5. Launched elevated SharePoint Management Shell, and then executed the following to check on Workflow and Service Bus configuration status:
    Get-WFFarm Get-WFFarmStatus Get-SBFarm Get-SBFarmStatus
  6. Opened a browser, and then connected to:
    https://[FQDN]:12290 or http://[FQDN]:12291
    where FQDN is the fully qualified domain name of the server hosting the farm's workflow foundation.
  7. Check installed versions
    1. Workflow Manager 1.0: 2.0.20922.0
    2. Workflow Manager client 1.0: 2.0.40131.0
    3. Service Bus 1.0: 2.0.20922.0
    4. Windows Fabric: 1.0.960.0
After performing these steps, you find that everything checks out as you would expect if everything was running normally; and no immediately obvious issue is found. Yet, the fact remains that when a 2013 workflow is triggered, it eventually returns an error.

Solution
  1. Perform upgrade using: Psconfig.exe -cmd upgrade -inplace b2b -wait -force.
References
  • I discovered this solution accidentally: after installing the July 2015 patches, which requires you to execute psconfig in order to do the upgrade, and then doing the usual regression testing, I found that, as a bonus, the workflow problem was resolved. Later, I was informed by Microsoft Support that psconfig was one of the options they were considering to resolve our workflow problem (I had previously opened a support ticket with them).

Friday, March 20, 2015

SharePoint 2013: How to set the hyperlink list column values from Workflow

Tip

Workflows can be used to set the values of both Picture and Hyperlink list column-types. The Picture column-type has just a single value, URL, that you can set.  The Hyperlink column-type, however, has two values: URL and Description.  So, if you create a workflow tied to a list having this column type, and then you try to set both these values, well..., you don't see either of these fields show up in Designer!  You just see the name of the column.  So what do you do?  How do you update both values with a single workflow Set statement?

Simple: if you want to set both the URL and the Description values of this column-type, you must enter them both into the value area, but separated by a comma ",".  That's it.  It really is that simple.  Let's examine this more closely.

Review

Here's a table that has been configured with Choice and Hyperlink column types.
The Choice column has been configured with three values: Nature, Science and Space.
And here's a workflow created on this list.  The workflow is triggered on change of the MyChoice column. Setting the column to a new value triggers the workflow to set the MyLink column, as determined by the If-branches:
If you look closely, you can see that the MyLink column is being set to two values separated by the comma:
The first value must be the URL; the second, the Description.  Let's create a new item, and then change it to see the workflow in action.
Opening up this list item in edit mode, we can see that both the URL and Description properties were in fact set:


References
  • Many thanks to Jonathan Adams with Serious SharePoint for posting the simple solution to setting hyperlink column types from workflow.  His posting was for SharePoint 2010, but is still applicable to SharePoint 2013.
  • Note that the column that shows the status of a specific workflow does not become available until you actually publish the workflow.  Thus, if you want to add the workflow status column to a list view, you have to wait until you publish the workflow before you can do this.

Friday, January 31, 2014

SharePoint 2010 Workflow: An unexpected error has occurred

Problem

You are developing existing workflows on your SharePoint 2010 farm development site.  You delete an existing workflow, while working in SharePoint Designer 2010.  You then test another workflow. After selecting Workflows from the list item dropdown menu, your browser is navigated to the standard helpful informative SharePoint 2010 error mesage:
An unexpected error has occurred
This error occurs no matter what list item workflow history you try to look at.  In fact, you cannot get to the list's workflow page at all.  Neither can you view workflow history or settings.  Troubleshooting steps follow.

Troubleshooting
  1. Restored the deleted workflow from the Recycle Bin, and then tested: still experienced error message.
  2. Noted the correlation ID presented in the error message.
  3. Launched ULSViewer, and then connected it to live feed.
  4. Searched for the correlation ID and found this event:
    System.ArgumentException: Column '[SomeColumnName]' does not exist. It may have been deleted by another user. /Path/To/List at Microsoft.SharePoint.SPFieldCollection.GetFieldByInternalName(String strName, Boolean bThrowException) at Microsoft.SharePoint.Workflow.SPWorkflow.GetIStatusAsText(Int32 iStatus) at Microsoft.SharePoint.Workflow.SPWorkflow.GetIStatusAsHtml(Int32 iStatus) at Microsoft.SharePoint.Workflow.SPWorkflow.GetIStatusAsHtml() at Microsoft.SharePoint.ApplicationPages.WorkflowPage.StrStatus(SPWorkflow wf) at ASP._layouts_workflow_aspx.__Render__control11(HtmlTextWriter __w, Control parameterContainer) at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) at System.Web.UI.HtmlControls.HtmlContainerControl.Render(HtmlTextWriter writer) at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) at System.Web.UI.HtmlControls.HtmlForm.RenderChildren(HtmlTextWriter writer) at System.Web.UI.HtmlControls.HtmlForm.Render(HtmlTextWriter output) at System.Web.UI.HtmlControls.HtmlForm.RenderControl(HtmlTextWriter writer) at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) at System.Web.UI.HtmlControls.HtmlContainerControl.Render(HtmlTextWriter writer) at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) at Microsoft.SharePoint.WebControls.UnsecuredLayoutsPageBase.RenderChildren(HtmlTextWriter writer) at System.Web.UI.Page.Render(HtmlTextWriter writer) at Microsoft.SharePoint.WebControls.UnsecuredLayoutsPageBase.Render(HtmlTextWriter writer) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
  5. Noted the SomeColumnName in the event.  This column was completely unfamiliar.  Noted that the column type was not indicated.
  6. With ULSViewer up, tested the error for repeatability, by attempted several times to connect to a list item's workflow history page: error was reproducable and correlated with events appearing in the trace log, viewed in ULSViewer.
  7. In SharePoint Designer, checked Association Columns, but did not find SomeColumnName.  Also checked Local Variables, but also not successful.
  8. Attempted to view workflow information on an archived copy of the list co-located in the same site.  This was successful.
  9. Then, using SharePoint Designer, alternatively compared list column listings between the two versions: discovered a column in the archived list missing from the current one.  However, the displayed column name bore no resemblance to that shown in the ULS event message.
  10. Then, connected to the site as Administrator and added a new field, SomeColumnName, to the list, as single line string.  Tested again: unsuccessful.  However, the error message correlated with the error message changed:
    System.ArgumentException: Column '[SomeNewColumnName]' does not exist. It may have been deleted by another user. /Path/To/List at Microsoft.SharePoint.SPFieldCollection.GetFieldByInternalName(String strName, Boolean bThrowException) at Microsoft.SharePoint.Workflow.SPWorkflow.GetIStatusAsText(Int32 iStatus) at Microsoft.SharePoint.Workflow.SPWorkflow.GetIStatusAsHtml(Int32 iStatus) at Microsoft.SharePoint.Workflow.SPWorkflow.GetIStatusAsHtml() at Microsoft.SharePoint.ApplicationPages.WorkflowPage.StrStatus(SPWorkflow wf) at ASP._layouts_workflow_aspx.__Render__control11(HtmlTextWriter __w, Control parameterContainer) at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) at System.Web.UI.HtmlControls.HtmlContainerControl.Render(HtmlTextWriter writer) at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) at System.Web.UI.HtmlControls.HtmlForm.RenderChildren(HtmlTextWriter writer) at System.Web.UI.HtmlControls.HtmlForm.Render(HtmlTextWriter output) at System.Web.UI.HtmlControls.HtmlForm.RenderControl(HtmlTextWriter writer) at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) at System.Web.UI.HtmlControls.HtmlContainerControl.Render(HtmlTextWriter writer) at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) at Microsoft.SharePoint.WebControls.UnsecuredLayoutsPageBase.RenderChildren(HtmlTextWriter writer) at System.Web.UI.Page.Render(HtmlTextWriter writer) at Microsoft.SharePoint.WebControls.UnsecuredLayoutsPageBase.Render(HtmlTextWriter writer) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
  11. Changed column type to Choice, populated some choices, and repeated test: still unsuccessful.  Same event message appearing in ULS.
  12. Removed all workflows from the site and then again tested:  still experienced error message.
    1. Conclusion: issue remains tied to list.
  13. Exported list from production farm, using CA, and then imported to development farm site using PowerShell.  Connected to site through SharePoint Designer: the workflows were not exported.  Testing unnecessary.
    1. Conclusion: workflows are not stored at the list level.
  14. Exported site (not site collection) from production farm, using PowerShell, and then restored site to dev farm using PowerShell. Opened browser, navigated to list, checked workflow history: this time able to view without error, but no history was listed. Navigated to list workflows and found none.
    1. Conclusion: workflows are not stored at the site level.
  15. Stopped IIS on both WFEs. In CA,"detached" content databases from web application (this is a SharePoint detach). Restored backup copies of DBs (in SQL Svr); and then mapped appropriate accounts to restored DBs (in SQL Svr). In CA, "attached" content databases to web application. Started IIS on both WFEs.  Navigated to list and checked workflows: no error, workflow history existed, workflows worked.
    1. Conclusion: workflows are stored at the site collection level.
Review

This was my first entry into developing workflows and troubleshooting them.  Further research subsequent to implementing this solution identified a possible workaround not requiring database restore methods (reference 4).

Lessons Learned

Recovery from a poorly handled workflow deletion requires a site collection restore.

References
  1. SharePoint 2010 List workflow status – unexpected error
  2. SharePoint 2010: Manager
  3. Troubleshoot workflow errors (SharePoint Foundation 2010)
  4. How to migrate SharePoint 2010 List based workflows
  5. SharePoint Designer Workflow Overview
  6. How to Delete/Remove a Workflow from SharePoint Designer
  7. HOWTO: Remove a Workflow from a List or Library