SharePoint Workflow Issue Post September Patches

Last week I encountered an issue where the workflows setup in our SharePoint 2010 environment were failing.

It turns out that the September 2018 patches were to blame. Mainly a .NET Framework one. Basically it removes the trusted assemblies from the web.config files which means that the Web Application dont trust the assemblies when they are called.

The patch is rolled out to all versions of .NET Framework and all Operating Systems. A full list of the KBs can be found here

Error:

Server was unable to process request —> Failed to publish workflow…….
System.CodeDom.CodeBinaryOperatorExpression is not marked as authorized in the application configuration file.

NintexWorkflowError

Solution:

There has been no talk about a new patch to fix this issue, but the workaround is to re-add the trusted assemblies back into web.config.

On the SharePoint Web Front Ends, go to the web application that has the Workflow issues and navigate to the web.config file.
If you have multiple Web Front Ends, dont forget to repeat for all.

Within the Web.config, find the below and added the authorized assemblies below the

<configuration>

<System.Workflow.ComponentModel.WorkflowCompiler>

Add authorized type code here.

SharePoint 2007 and 2010

       <authorizedType Assembly=”System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089″ NameSpace=”System.CodeDom” TypeName=”CodeBinaryOperatorExpression” Authorized=”True” />

              <authorizedType Assembly=”System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089″ NameSpace=”System.CodeDom” TypeName=”CodePrimitiveExpression” Authorized=”True” />

              <authorizedType Assembly=”System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089″ NameSpace=”System.CodeDom” TypeName=”CodeMethodInvokeExpression” Authorized=”True” />

              <authorizedType Assembly=”System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089″ NameSpace=”System.CodeDom” TypeName=”CodeMethodReferenceExpression” Authorized=”True” />

              <authorizedType Assembly=”System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089″ NameSpace=”System.CodeDom” TypeName=”CodeFieldReferenceExpression” Authorized=”True” />

              <authorizedType Assembly=”System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089″ NameSpace=”System.CodeDom” TypeName=”CodeThisReferenceExpression” Authorized=”True” />

              <authorizedType Assembly=”System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089″ NameSpace=”System.CodeDom” TypeName=”CodePropertyReferenceExpression” Authorized=”True” />

SharePoint 2013 and 2016

    <authorizedType Assembly=”System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089″ NameSpace=”System.CodeDom” TypeName=”CodeBinaryOperatorExpression” Authorized=”True” />

              <authorizedType Assembly=”System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089″ NameSpace=”System.CodeDom” TypeName=”CodePrimitiveExpression” Authorized=”True” />

              <authorizedType Assembly=”System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089″ NameSpace=”System.CodeDom” TypeName=”CodeMethodInvokeExpression” Authorized=”True” />

              <authorizedType Assembly=”System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089″ NameSpace=”System.CodeDom” TypeName=”CodeMethodReferenceExpression” Authorized=”True” />

              <authorizedType Assembly=”System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089″ NameSpace=”System.CodeDom” TypeName=”CodeFieldReferenceExpression” Authorized=”True” />

              <authorizedType Assembly=”System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089″ NameSpace=”System.CodeDom” TypeName=”CodeThisReferenceExpression” Authorized=”True” />

              <authorizedType Assembly=”System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089″ NameSpace=”System.CodeDom” TypeName=”CodePropertyReferenceExpression” Authorized=”True” />

Nintex Workflow

There is an additional assembly that needs to be added into the web.config for Nintex Workflow to work.

SharePoint 2007 and 2010

<authorizedType Assembly=”System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089″ NameSpace=”System.CodeDom” TypeName=”CodeTypeReferenceExpression” Authorized=”True” />

SharePoint 2013 and SharePoint 2016

<authorizedType Assembly=”System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089″ NameSpace=”System.CodeDom” TypeName=”CodeTypeReferenceExpression” Authorized=”True” />

 

Now you should be able to run your workflows without an issue.

For more information, Rodney Viana (MSFT for Microsoft SharePoint) first reported the issue here.

 

 

SharePoint Error – Stale URI Endpoint

Got the following error in Event Viewer:

An exception occurred while addresses for connected app.

StaleURI#1

In this case, it was because I removed a Service Application that did not remove itself cleanly.

The easiest way to clean up this error is to log onto the database server and remove it from the Configuration database.

NP – Use the GUID from the error message and insert it into the GUID where statement below:

SELECT *
FROM dbo.FARM_CONFIG_DB
WHERE GUID LIKE ‘%81293e27%’
GO

DELETE
FROM dbo.FARM_CONFIG_DB
WHERE GUID LIKE ‘%81293e27%’
GO

SELECT *
FROM dbo.FARM_CONFIG_DB
WHERE GUID LIKE ‘%81293e27%’
GO

Patching SharePoint 2016

Pre-Reqs:

  1. SharePoint Shell Access permissions on the Farm and Admin databases, as well as any Web Applications databases.
  2. Farm Administrators within SharePoint Central Administration.
  3. Local administrator on all the SharePoint Farm servers.

Install the SharePoint Cumulative Update on all SharePoint servers in your farm. Then run the below command on the Central Admin server first, then your application servers then the Web Front Ends last.

Command:

Run the command in SharePoint Powershell:
psconfig.exe -cmd -upgrade -inplace b2b -wait -cmd applicationcontent -install -cmd installfeatures -cmd secureresources

PatchingSharepoint

Note – if you have 1 unsuccessful configuration, sometime i find if you run it a second time it will work. This could be because there is a lock on the database or CA.

Rollback:

The only rollback method for patching SharePoint is restoring all the virtual machines in the farm including the Distributed Cache and Web Front Ends, as well as all SharePoint related databases.

You cant go to Installed Updates and try to uninstall it from there as you it wont allow you to uninstall.

You will find a tonne of issues if you only restore the databases. I know as this happened to me and it was near impossible to resolve.

Note, this is unsupported via Microsoft so only do it as a last resort.

 

SharePoint Server Showing Upgrade Required

Issue:

One of the Sharepoint App Servers is showing Upgrade Required within the Farm Information on the Central Admin site.
I had run the Upgrade command successfully, and checked within Central Administration and it was still showing Upgrade Required.
Re-ran the Upgrade just incase and same result.

Solution:

A nifty Sharepoint trick so that Sharepoint will go and do a fresh update and check of the binaries.

Get-SPProduct –Local

To check the Farm Version, run the below:

$farm = Get-SPFarm
$farm.BuildVersion

Access Denied SharePoint

I was recently trying to re-provision a solution through Farm Solutions within Central Administration for SharePoint.

Once I clicked deploy on the solution I got the below error.

Access Denied Sharepoint #1

Weird. I doubled check that I had the correct permissions, which I did.

Solution

Run Internet Explorer as Administrator by holding shift key and right clicking on the Internet Explorer icon and select Run as Administrator.

This will then run IE under the machine Administrator account.