This project is read-only.
3
Vote

Sandbox process email issues while Auto Number active.

description

Hi,
We have a significant problem which we can only seem to resolve by removing the Advanced Auto Number solution but was wondering if you might have any idea of the cause or a means to resolve.

The same issue is documented in the following post (which I've been reading via a translator).

German article

We too have a problem affecting the email router which Autonumber is active. Basically, outgoing mail, when trying to attach a 5mb+ file the sandbox process appears to become 'unavailable'.

Equally, if a message with an attachment over 5mb tried to arrive, the sandbox process cannot receive it.

Below is a hacked down trace. They get muddled a bit as stuff is trying to get in but at the same time I attempted to attach something to an outgoing message to trigger the error.
>Crm Exception: Message: The plug-in execution failed because no Sandbox Worker processes are currently available. Please try again.
System.ServiceModel.CommunicationException: Microsoft Dynamics CRM has experienced an error. Reference number for administrators or support: #E4BE2201, ErrorCode: -2147204723
[2013-05-24 16:20:06.733] Process: w3wp |Organization:2485c2e6-0398-e211-a8ba-005056a512c2 |Thread:   24 |Category: Sandbox |User: 76801487-cd8b-e211-a8ba-005056a512c2 |Level: Error | SandboxPlugin.Execute
>Execute: CrmException: Xbitz.Crm.AdvancedCRMAutoNumber, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b0dbcd530d1b2c81; 8004418D; The plug-in execution failed because no Sandbox Worker processes are currently available. Please try again.
>System.ServiceModel.CommunicationException: Microsoft Dynamics CRM has experienced an error. Reference number for administrators or support: #E4BE2201
[2013-05-24 16:20:06.734] Process: w3wp |Organization:2485c2e6-0398-e211-a8ba-005056a512c2 |Thread:   24 |Category: Platform |User: 76801487-cd8b-e211-a8ba-005056a512c2 |Level: Error | MessageProcessor.Execute
>MessageProcessor fail to process message 'Create' for 'activitymimeattachment'.
[2013-05-24 16:20:10.954] Process: w3wp |Organization:2485c2e6-0398-e211-a8ba-005056a512c2 |Thread:   24 |Category: Platform |User: 76801487-cd8b-e211-a8ba-005056a512c2 |Level: Error | AttachmentManager.UploadAttachments
>Create attachment failed for WKC Manual Handling Awareness Course 260313.pdf. ErrorMessage: The plug-in execution failed because no Sandbox Worker processes are currently available. Please try again.
>System.ServiceModel.CommunicationException: Microsoft Dynamics CRM has experienced an error. Reference number for administrators or support: #E4BE2201
[2013-05-24 16:20:11.237] Process: w3wp |Organization:2485c2e6-0398-e211-a8ba-005056a512c2 |Thread:   24 |Category: Exception |User: 76801487-cd8b-e211-a8ba-005056a512c2 |Level: Error | CrmException..ctor
    at CrmException..ctor(String message, Exception innerException, Int32 errorCode, Boolean isFlowControlException)
    at CrmException..ctor(String message, Int32 errorCode)
    at CrmObjectNotFoundException..ctor(BusinessEntityMoniker moniker)
    …
    
    …
>Crm Exception: Message: email With Id = 7c9c6262-85c4-e211-ab45-005056995a19 Does Not Exist, ErrorCode: -2147220969
[2013-05-24 16:20:11.247] Process: w3wp |Organization:2485c2e6-0398-e211-a8ba-005056a512c2 |Thread:   24 |Category: Platform |User: 76801487-cd8b-e211-a8ba-005056a512c2 |Level: Error | EmailService.Deliver
>Email deliver failed to update the email. ErrorMessage: email With Id = 7c9c6262-85c4-e211-ab45-005056995a19 Does Not Exist
[2013-05-24 16:20:13.744] Process: w3wp |Organization:2485c2e6-0398-e211-a8ba-005056a512c2 |Thread:   24 |Category: Exception |User: 76801487-cd8b-e211-a8ba-005056a512c2 |Level: Error | CrmException..ctor
    at CrmException..ctor(String message, Exception innerException, Int32 errorCode, Boolean isFlowControlException)
    at CrmException..ctor(Exception innerException, Int32 errorCode, Object[] arguments)
    at SoapExtensionExceptionHandlerBase.PrivateGetCrmExceptionNoDependencies(Exception exception)
    at SoapExtensionExceptionHandlerBase.GetCrmException(Exception exception)
    at CrmException.ConvertPluginException(Exception originalException, Boolean isAsync, Boolean unwrapTargetInvocationException)
    at CrmException.ConvertPluginException
    …
    
    …
>Crm Exception: Message: Generic SQL error., ErrorCode: -2147204784, InnerException: System.Data.SqlClient.SqlException (0x80131904): The INSERT statement conflicted with the FOREIGN KEY constraint "email_email_hash". The conflict occurred in database "HRSSCDevP2_MSCRM", table "dbo.ActivityPointerBase", column 'ActivityId'.
The INSERT statement conflicted with the FOREIGN KEY constraint "email_email_hash". The conflict occurred in database "HRSSCDevP2_MSCRM", table "dbo.ActivityPointerBase", column 'ActivityId'.
The statement has been terminated.
The statement has been terminated.
   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
...

...   
[2013-05-24 16:20:13.748] Process: w3wp |Organization:2485c2e6-0398-e211-a8ba-005056a512c2 |Thread:   24 |Category: Platform.Sdk |User: 76801487-cd8b-e211-a8ba-005056a512c2 |Level: Error | VersionedPluginProxyStepBase.Execute
>Web Service Plug-in failed in SdkMessageProcessingStepId: {D0CABB1B-EA3E-DB11-86A7-000A3A5473E8}; EntityName: email; Stage: 30; MessageName: DeliverIncoming; AssemblyName: Microsoft.Crm.Extensibility.InternalOperationPlugin, Microsoft.Crm.ObjectModel, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35; ClassName: Microsoft.Crm.Extensibility.InternalOperationPlugin; Exception: Unhandled Exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
…

…
Microsoft.Crm.Extensibility.VersionedPluginProxyStepBase.Execute(PipelineExecutionContext context)
Inner Exception: System.Data.SqlClient.SqlException: The INSERT statement conflicted with the FOREIGN KEY constraint "email_email_hash". The conflict occurred in database "HRSSCDevP2_MSCRM", table "dbo.ActivityPointerBase", column 'ActivityId'.
The INSERT statement conflicted with the FOREIGN KEY constraint "email_email_hash". The conflict occurred in database "HRSSCDevP2_MSCRM", table "dbo.ActivityPointerBase", column 'ActivityId'.
The statement has been terminated.
The statement has been terminated.
   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
…

...
[2013-05-24 16:20:13.748] Process: w3wp |Organization:2485c2e6-0398-e211-a8ba-005056a512c2 |Thread:   24 |Category: Exception |User: 76801487-cd8b-e211-a8ba-005056a512c2 |Level: Error | CrmException..ctor
    at CrmException..ctor(String message, Exception innerException, Int32 errorCode, Boolean isFlowControlException)
    at CrmException..ctor(Exception innerException, Int32 errorCode, Object[] arguments)
    at SoapExtensionExceptionHandlerBase.PrivateGetCrmExceptionNoDependencies(Exception exception)
    at SoapExtensionExceptionHandlerBase.GetCrmException(Exception exception)
…

…
>Crm Exception: Message: Generic SQL error., ErrorCode: -2147204784, InnerException: System.Data.SqlClient.SqlException (0x80131904): The INSERT statement conflicted with the FOREIGN KEY constraint "email_email_hash". The conflict occurred in database "HRSSCDevP2_MSCRM", table "dbo.ActivityPointerBase", column 'ActivityId'.
The INSERT statement conflicted with the FOREIGN KEY constraint "email_email_hash". The conflict occurred in database "HRSSCDevP2_MSCRM", table "dbo.ActivityPointerBase", column 'ActivityId'.
The statement has been terminated.
The statement has been terminated.
   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
…
Any help would be much appreciated. We didn't realise we had a problem until the system had been live for some time so are reluctant to have to remove the Auto number in order to restore the attachment size functionality.

Regards,
Jamie

comments

mdocter wrote Sep 17, 2013 at 9:05 AM

Hello Jamie,

Did you find a fix or workaround for this issue?
If so, I would be happy to hear it!

Kind regards,

Maarten

mdocter wrote Sep 17, 2013 at 10:52 AM

I had the same problem with the e-mail router and incoming e-mails (with attachments larger than 5 Mb), but I found a workaround that worked for my situation.
The current solution registers a single Pre Create Plugin Step which has no 'Primary Entity' specified, so the autonumber Plugin runs on every entity (and that is probably the problem). So I disabled this Step and created Pre Create Steps with the same settings (but I specified the Primary Entity) for only the entities that where really requiring an autonumber. And that fixed my problem. Hope this helps.

wrote Nov 28, 2013 at 8:45 AM

beates wrote Feb 10, 2014 at 9:04 AM

We are experiencing the same issue with the Outlook client when tracking e-mails with CRM including certain file types and size. Implementing the above mentioned workaround did not fix the issue. The solution is in production and we need to solve this issue in a timely manner....

So if there are any other workarounds or a fix for this issue I would like to hear about them!