Last week we upgraded from CRM 2015 to CRM 2016 and also Installed SP1.
Since then on some random Service Activities we get a business process error when trying to delete or reassigning them. In the Error log it shows some generic info and mentions a plugin we use. Here is the error I get when trying to delete a Service Activity from an affected Case.
Unhandled Exception: System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=8.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]: System.Web.HttpUnhandledException: Microsoft Dynamics CRM has experienced an error. Reference number for administrators or support: #A03B2C8FDetail: <OrganizationServiceFault xmlns:i="www.w3.org/.../XMLSchema-instance" xmlns="schemas.microsoft.com/.../Contracts"> <ErrorCode>-2147220970</ErrorCode> <ErrorDetails xmlns:d2p1="schemas.datacontract.org/.../System.Collections.Generic" /> <Message>System.Web.HttpUnhandledException: Microsoft Dynamics CRM has experienced an error. Reference number for administrators or support: #A03B2C8F</Message> <Timestamp>2017-04-11T21:20:45.0755066Z</Timestamp> <InnerFault> <ErrorCode>-2147220891</ErrorCode> <ErrorDetails xmlns:d3p1="schemas.datacontract.org/.../System.Collections.Generic" /> <Message>An error occured while processing this request.</Message> <Timestamp>2017-04-11T21:20:45.0755066Z</Timestamp> <InnerFault i:nil="true" /> <TraceText> [MSCRM_Hours_Account_Plugin: MSCRM_Hours_Account_Plugin.Plugin] [78b3e2af-e559-e311-80bd-001e6764dea8: MSCRM_Hours_Account_Plugin.Plugin: Delete of serviceappointment] </TraceText> </InnerFault> <TraceText i:nil="true" /> </OrganizationServiceFault>
However in the Event Viewer I can see the "There should be only one owner party for an activity" error below.
The Web Service plug-in failed in OrganizationId: e66d88ca-93c6-44fc-8f1a-00c9595a3afc; SdkMessageProcessingStepId: 78b3e2af-e559-e311-80bd-001e6764dea8; EntityName: serviceappointment; Stage: 20; MessageName: Delete; AssemblyName: MSCRM_Hours_Account_Plugin.Plugin, MSCRM_Hours_Account_Plugin, Version=1.0.0.0, Culture=neutral, PublicKeyToken=797d3454956c826c; ClassName: MSCRM_Hours_Account_Plugin.Plugin; Exception: Unhandled Exception: Microsoft.Xrm.Sdk.SaveChangesException: An error occured while processing this request. at Microsoft.Xrm.Sdk.Client.OrganizationServiceContext.SaveChanges(SaveChangesOptions options) at MSCRM_Hours_Account_Plugin.Plugin.Execute(IServiceProvider serviceProvider) at Microsoft.Crm.Extensibility.V5PluginProxyStep.ExecuteInternal(PipelineExecutionContext context) at Microsoft.Crm.Extensibility.VersionedPluginProxyStepBase.Execute(PipelineExecutionContext context) Inner Exception: System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=8.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]: There should be only one owner party for an activityDetail: <OrganizationServiceFault xmlns:i="www.w3.org/.../XMLSchema-instance" xmlns="schemas.microsoft.com/.../Contracts"> <ErrorCode>-2147220989</ErrorCode> <ErrorDetails xmlns:d2p1="schemas.datacontract.org/.../System.Collections.Generic" /> <Message>There should be only one owner party for an activity</Message> <Timestamp>2017-04-11T17:28:31.2752068Z</Timestamp> <InnerFault> <ErrorCode>-2147220989</ErrorCode> <ErrorDetails xmlns:d3p1="schemas.datacontract.org/.../System.Collections.Generic" /> <Message>There should be only one owner party for an activity</Message> <Timestamp>2017-04-11T17:28:31.2752068Z</Timestamp> <InnerFault> <ErrorCode>-2147220989</ErrorCode> <ErrorDetails xmlns:d4p1="schemas.datacontract.org/.../System.Collections.Generic" /> <Message>There should be only one owner party for an activity</Message> <Timestamp>2017-04-11T17:28:31.2752068Z</Timestamp> <InnerFault i:nil="true" /> <TraceText i:nil="true" /> </InnerFault> <TraceText i:nil="true" /> </InnerFault> <TraceText i:nil="true" /> </OrganizationServiceFault> at Microsoft.Crm.Extensibility.OrganizationSdkServiceInternal.Execute(OrganizationRequest request, CorrelationToken correlationToken, CallerOriginToken callerOriginToken, WebServiceType serviceType, Boolean checkAdminMode, ExecutionContext executionContext) at Microsoft.Crm.Extensibility.InprocessServiceProxy.ExecuteCore(OrganizationRequest request) at Microsoft.Xrm.Sdk.Client.OrganizationServiceContext.Execute(OrganizationRequest request) at Microsoft.Xrm.Sdk.Client.OrganizationServiceContext.SaveChange(OrganizationRequest request, IList`1 results)
This seems to happen to any Service Activity assigned to specific cases. It doesn't happen with every case, very few in fact, but once it happens with a case any activity created will get the error if you attempt to delete it or assign it.
In trying to resolve this problem I found on Google that this can be related to activities having no owner, or having multiple owners. I tried to the 2 SQL scripts here to see if I could identify those records, but both queries return 0 results.
I don't know if this is related to our plugin, even though the business process error does mention it. It doesn't happen with the majority of activities or cases in our system and we go through a few hundred new ones per day. And this all worked perfectly before the update from 2016 to 2015. We didn't touch the plugins before or after the change.
Any ideas what else we could try? I can give more info if necessary.
*This post is locked for comments