web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Error when calling a workflow - Microsoft.Crm.CrmException: System.Security.SecurityException

(0) ShareShare
ReportReport
Posted on by

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&amp; typeName, String&amp; assemName, String[]&amp; fieldNames, Object[]&amp; 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&amp; 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

I have the same question (0)
  • Radu Chiribelea Profile Picture
    6,667 on at

    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?

  • Community Member Profile Picture
    on at

    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.

  • Suggested answer
    Radu Chiribelea Profile Picture
    6,667 on at

    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

  • Community Member Profile Picture
    on at

    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.

  • Community Member Profile Picture
    on at

    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.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans