We use Microsoft Dynamics 365 version 1612 (8.2.3.114) (DB 8.2.2.2464) online.
In our instance we have setup a workflow that calls a plug-in assembly written in C#. This plug-in imports data from external system using REST API.
Recently the workflow crashes with a system error. These errors are different every time but they are in the preparation process before calling our plug-in.
The most recent error was:
System.Security.SecurityException: Microsoft Dynamics CRM has experienced an error. Reference number for administrators or support: #805A3E11
If we try re-running the workflow, then everything works fine for some time. Next, the error appears again after the workflow has executed successfully a couple of times. Any ideas about the cause for this problem?
More details about the error:
Error Message: Unhandled Exception: Microsoft.Crm.CrmException: System.Security.SecurityException: Microsoft Dynamics CRM has experienced an error. Reference number for administrators or support: #805A3E11 at Microsoft.Crm.Sandbox.SandboxCodeUnit.Execute(IExecutionContext context) at Microsoft.Crm.Workflow.Services.ProxyCustomActivity.Execute(CodeActivityContext executionContext) Exception Details Unhandled Exception: System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=8.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]: System.Security.SecurityException: Microsoft Dynamics CRM has experienced an error. Reference number for administrators or support: #805A3E11Detail: <OrganizationServiceFault xmlns:i="www.w3.org/.../XMLSchema-instance" xmlns="schemas.microsoft.com/.../Contracts"> <ActivityId>c847a1e8-e3e1-4fe5-a6c4-822ae3b9f3f8</ActivityId> <ErrorCode>-2147220970</ErrorCode> <ErrorDetails xmlns:d2p1="schemas.datacontract.org/.../System.Collections.Generic" /> <Message>System.Security.SecurityException: Microsoft Dynamics CRM has experienced an error. Reference number for administrators or support: #805A3E11</Message> <Timestamp>2018-11-16T16:26:06.0976984Z</Timestamp> <ExceptionRetriable>false</ExceptionRetriable> <ExceptionSource>PluginExecution</ExceptionSource> <InnerFault i:nil="true" /> <OriginalException>System.Security.SecurityException at System.ComponentModel.Win32Exception.GetObjectData(SerializationInfo info, StreamingContext context) at System.Runtime.Serialization.ObjectCloneHelper.GetObjectData(Object serObj, String& typeName, String& assemName, String[]& fieldNames, Object[]& fieldValues) at Microsoft.Crm.Sandbox.SandboxAppDomainHelper.Execute(IOrganizationServiceFactory organizationServiceFactory, String customActivityTypeName, IExecutionContext requestContext, Dictionary`2 sandboxServices, Boolean useDrawbridgeEnabled, Boolean chaosFailAppDomain) at Microsoft.Crm.Sandbox.SandboxWorker.ExecuteCustomWorkflowActivity(SandboxCallInfo callInfo, SandboxCustomActivityExecutionContext requestContext, Guid pluginAssemblyId, Int32 sourceHash, String assemblyName, Guid pluginTypeId, String pluginTypeName, SandboxRequestCounter& workerCounter, Boolean returnTraceInfo)</OriginalException> <TraceText i:nil="true" /> </OrganizationServiceFault> Server stack trace: at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc) at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout) at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation) at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message) Exception rethrown at [0]: at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg) at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type) at Microsoft.Crm.Sandbox.ISandboxHost.ExecuteCustomWorkflowActivityAndReturnTraceInfo(SandboxCallInfo callInfo, SandboxCustomActivityExecutionContext requestContext, Guid pluginAssemblyId, Int32 sourceHash, String assemblyName, Guid pluginTypeId, String pluginTypeName, String assemblyContents, Boolean returnTraceInfo) at Microsoft.Crm.Sandbox.SandboxCustomActivity.Execute(SandboxClient client, SandboxCallTracker callTracker, IExecutionContext requestContext, String assemblyContents, Boolean returnTraceInfo) at Microsoft.Crm.Sandbox.SandboxCodeUnit.Execute(IExecutionContext context)
*This post is locked for comments
The provided information is not directly related to our problem. We reviewed the articles about the plug-in isolation and the CRM limits and it doesn’t look like this is the reason for the issue. We are still unable to understand what caused that error.
The problem hasn’t appeared for the last 5 days. We assume it is something that happens in the Dynamics environment during some preparation steps just before calling our custom code.
However, we added some trace logging to our custom code and we hope that it will help us to understand if the problem happens while executing the workflow or before that and also it should give us some details about what exactly it throwing the exception if it happens while executing our code.
Thanks for your response!
We will review the provided information about the plug-in isolation and we will try adding some logging to our code. If we find something, we will share it.
Try adding some logging to the workflow. You say you are calling a REST Service. Maybe those calls take a long time to execute and times out .
Based on the call stack, it seems to fail when executing your workflow
at Microsoft.Crm.Sandbox.SandboxCodeUnit.Execute(IExecutionContext context)
at Microsoft.Crm.Workflow.Services.ProxyCustomActivity.Execute(CodeActivityContext executionContext)
Check this article: docs.microsoft.com/.../gg334752(v=crm.8) - It could explain your behavior:
If the sandbox worker process that hosts this custom code exceeds threshold CPU, memory, or handle limits or is otherwise unresponsive, that process will be killed by the platform. At that point any currently executing plug-in or custom workflow activity in that worker process will fail with exceptions. However, the next time that the plug-in or custom workflow activity is executed it will run normally.
You can see the CRM Online limits here: social.technet.microsoft.com/.../37177.dynamics-365-online-limitations.aspx
No, we don’t use ILMerge in our project.
The project contains many lines of source code and we are not very sure how posting it would help resolving the issue. However, I will talk with our client about sharing the source code.
Since it is working if you try to re-run it - I wonder if this couldn't be related to the Sandbox Service executing the workflow.
Are you using ILMerge in your project? Can you share your code?
André Arnaud de Cal...
291,969
Super User 2025 Season 1
Martin Dráb
230,842
Most Valuable Professional
nmaenpaa
101,156