Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

business process error

Posted on by 220

Hi Experts i got error when sending emails with attachment, when i download the log file here's the error

Unhandled Exception: System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=8.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]: ERRORDetail:
<OrganizationServiceFault xmlns:i="www.w3.org/.../XMLSchema-instance" xmlns="schemas.microsoft.com/.../Contracts">
<ErrorCode>-2147220891</ErrorCode>
<ErrorDetails xmlns:d2p1="schemas.datacontract.org/.../System.Collections.Generic">
<KeyValuePairOfstringanyType>
<d2p1:key>CallStack</d2p1:key>
<d2p1:value xmlns:d4p1="www.w3.org/.../XMLSchema" i:type="d4p1:string"> at Microsoft.Crm.Extensibility.VersionedPluginProxyStepBase.Execute(PipelineExecutionContext context)
at Microsoft.Crm.Extensibility.Pipeline.Execute(PipelineExecutionContext context)
at Microsoft.Crm.Extensibility.MessageProcessor.Execute(PipelineExecutionContext context)
at Microsoft.Crm.Extensibility.InternalMessageDispatcher.Execute(PipelineExecutionContext context)
at Microsoft.Crm.Extensibility.ExternalMessageDispatcher.ExecuteInternal(IInProcessOrganizationServiceFactory serviceFactory, IPlatformMessageDispatcherFactory dispatcherFactory, String messageName, String requestName, Int32 primaryObjectTypeCode, Int32 secondaryObjectTypeCode, ParameterCollection fields, CorrelationToken correlationToken, CallerOriginToken originToken, UserAuth userAuth, Guid callerId, Guid callerRegardingObjectId, UserType userType, Guid transactionContextId, Int32 invocationSource, Nullable`1 requestId, Version endpointVersion)
at Microsoft.Crm.Extensibility.ExternalMessageDispatcher.Execute(IInProcessOrganizationServiceFactory serviceFactory, IPlatformMessageDispatcherFactory dispatcherFactory, String messageName, String requestName, Int32 primaryObjectTypeCode, Int32 secondaryObjectTypeCode, ParameterCollection fields, CorrelationToken correlationToken, CallerOriginToken originToken, UserAuth userAuth, Guid callerId, Guid callerRegardingObjectId, UserType userType, Guid transactionContextId, Int32 invocationSource, Nullable`1 requestId)
at Microsoft.Crm.Extensibility.OrganizationSdkServiceInternal.ExecuteRequestRequestWithInstrumentation(OrganizationRequest request, CorrelationToken correlationToken, CallerOriginToken callerOriginToken, WebServiceType serviceType, UserAuth userAuth, Guid targetUserId, OrganizationContext context, Boolean returnResponse, Boolean checkAdminMode, Object operation, UserType targetUserType)
at Microsoft.Crm.Extensibility.OrganizationSdkServiceInternal.ExecuteRequest(OrganizationRequest request, CorrelationToken correlationToken, CallerOriginToken callerOriginToken, WebServiceType serviceType, Boolean checkAdminMode, ExecutionContext executionContext)
at Microsoft.Crm.Extensibility.OrganizationSdkServiceInternal.Execute(OrganizationRequest request, CorrelationToken correlationToken, CallerOriginToken callerOriginToken, WebServiceType serviceType, Boolean checkAdminMode, ExecutionContext executionContext)</d2p1:value>
</KeyValuePairOfstringanyType>
<KeyValuePairOfstringanyType>
<d2p1:key>OperationStatus</d2p1:key>
<d2p1:value xmlns:d4p1="www.w3.org/.../XMLSchema" i:type="d4p1:string">0</d2p1:value>
</KeyValuePairOfstringanyType>
<KeyValuePairOfstringanyType>
<d2p1:key>SubErrorCode</d2p1:key>
<d2p1:value xmlns:d4p1="www.w3.org/.../XMLSchema" i:type="d4p1:string">-2146233088</d2p1:value>
</KeyValuePairOfstringanyType>
</ErrorDetails>
<Message>ERROR</Message>
<Timestamp>2019-01-10T02:19:27.2304804Z</Timestamp>
<InnerFault i:nil="true" />
<TraceText>

[Microsoft.Crm.ObjectModel: Microsoft.Crm.ObjectModel.SyncWorkflowExecutionPlugin]
[644e1dd7-2a7f-18fb-b8ed-ed78c3f92c2b: ] //SampleID
Starting sync workflow 'Attachment - Send Email', Id: 644e1dd7-2a7f-18fb-b8ed-ed78c3f92c2b //SampleID
Entering ConditionStep1_step: Send Email
Entering ConditionStep3_step: For Customer
Entering CustomActivityStep5_step: Create the Customer document
Sync workflow 'Attachment - Send Email' terminated with error 'ERROR'

</TraceText>
</OrganizationServiceFault>

And on the crmdrop logs i got this error

 

 

>Crm Exception: Message: Entity Reference cannot have Id and Key Attributes empty., ErrorCode: -2147220989, InnerException: System.ArgumentException: Entity Reference cannot have Id and Key Attributes empty.
[2019-01-10 09:59:03.556] Process:CrmAsyncService |Organization:00000000-0000-0000-0000-000000000000 |Thread: 52 |Category: Exception |User: 00000000-0000-0000-0000-000000000000 |Level: Error |ReqId: 00000000-0000-0000-0000-000000000000 | CrmArgumentException..ctor ilOffset = 0x12
at CrmArgumentException..ctor(String message) ilOffset = 0x12
at OrganizationSdkServiceInternal.Retrieve(EntityReference entityReference, ColumnSet columnSet, CorrelationToken correlationToken, CallerOriginToken callerOriginToken, WebServiceType serviceType, Boolean checkAdminMode) ilOffset = 0x41
at InprocessServiceProxy.RetrieveCore(String entityName, Guid id, ColumnSet columnSet) ilOffset = 0x28
at OrganizationServiceProxy.Retrieve(String entityName, Guid id, ColumnSet columnSet) ilOffset = 0x0
at EntityDictionary.TryRetrieveEntity(String key) ilOffset = 0xF3
at EntityDictionary.System.Collections.Generic.IDictionary<System.String,Microsoft.Xrm.Sdk.Entity>.get_Item(String key) ilOffset = 0x1B
at VisualBasicValue`1.Execute(CodeActivityContext context) ilOffset = 0x45
at ActivityExecutor.ExecuteInResolutionContext(ActivityInstance parentInstance, Activity`1 expressionActivity) ilOffset = 0x29
at InArgument`1.TryPopulateValue(LocationEnvironment targetEnvironment, ActivityInstance activityInstance, ActivityExecutor executor) ilOffset = 0x0
at ActivityInstance.InternalTryPopulateArgumentValueOrScheduleExpression(RuntimeArgument argument, Int32 nextArgumentIndex, ActivityExecutor executor, IDictionary`2 argumentValueOverrides, Location resultLocation, Boolean isDynamicUpdate) ilOffset = 0x16
at ActivityInstance.ResolveArguments(ActivityExecutor executor, IDictionary`2 argumentValueOverrides, Location resultLocation, Int32 startIndex) ilOffset = 0x9C
at ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation) ilOffset = 0x40
at ActivityExecutor.TryExecuteNonEmptyWorkItem(WorkItem workItem) ilOffset = 0x31
at ActivityExecutor.OnExecuteWorkItem(WorkItem workItem) ilOffset = 0x25
at Callbacks.ExecuteWorkItem(WorkItem workItem) ilOffset = 0xD
at Scheduler.OnScheduledWork(Object state) ilOffset = 0xB2
at SendOrPostThunk.UnhandledExceptionFrame(Object state) ilOffset = 0x0
at ScheduledOverlapped.IOCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* nativeOverlapped) ilOffset = 0x22
at IOCompletionThunk.UnhandledExceptionFrame(UInt32 error, UInt32 bytesRead, NativeOverlapped* nativeOverlapped) ilOffset = 0x5
at _IOCompletionCallback.PerformIOCompletionCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* pOVERLAP) ilOffset = 0x1E

and i check on the event view i got this error? maybe the error on the SQL?

Error: Deletion Service encountered an internal error for
OrganizationId: 644e1dd7-2a7f-18fb-b8ed-ed78c3f92c2b //SampleID 
OrgName: CRM
Exception: System.Data.SqlClient.SqlException (0x80131904): Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.
The statement has been terminated. ---> System.ComponentModel.Win32Exception (0x80004005): The wait operation timed out
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)
at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, SqlDataReader ds, Boolean describeParameterEncryptionRequest)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean asyncWrite)
at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean asyncWrite)
at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
at Microsoft.Crm.DeletionService.CleanUpPOA(CrmDbConnection connection, Int64 versionNumberExpired)
at Microsoft.Crm.DeletionService.Run(IDeletionServiceProvider deletionServiceProvider)
ClientConnectionId:644e1dd7-2a7f-18fb-b8ed-ed78c3f92c2b //Sample ID
Error Number:-2,State:0,Class:11.

 

 

*This post is locked for comments

  • Alex Fun Wei Jie Profile Picture
    Alex Fun Wei Jie 33,626 on at
    RE: business process error

    Hi,

    let's debug your custom workflow in prod environment you mentioned.

    ssharmacrm.wordpress.com/.../how-to-debug-a-custom-workflow-activity-in-dynamics-crm

  • Suggested answer
    Adrian Begovich Profile Picture
    Adrian Begovich 21,009 Super User 2024 Season 2 on at
    RE: business process error

    Hi KaeL,

    Your test is not comprehensive as the custom workflow may have code that breaks on certain records or configurations. You mentioned that the workflow has been working for over two years and this makes me suspect that the workflow has a rare edge case for which it does not work and throws an exception.

    If you examine the workflows source code, you can follow the below tracing to determine why the workflow is breaking.

    <TraceText>

    [Microsoft.Crm.ObjectModel: Microsoft.Crm.ObjectModel.SyncWorkflowExecutionPlugin]

    [644e1dd7-2a7f-18fb-b8ed-ed78c3f92c2b: ] //SampleID

    Starting sync workflow 'Attachment - Send Email', Id: 644e1dd7-2a7f-18fb-b8ed-ed78c3f92c2b //SampleID

    Entering ConditionStep1_step: Send Email

    Entering ConditionStep3_step: For Customer

    Entering CustomActivityStep5_step: Create the Customer document

    Sync workflow 'Attachment - Send Email' terminated with error 'ERROR'

    </TraceText>

  • KaeL Profile Picture
    KaeL 220 on at
    RE: business process error

    Thanks for the reply, i test on my test CRM, i just download all of the solution from the production(having a error) and upload to the test environment and i test sending emails with the attachment/ all of the workflow that we've used on the production but its working well on my test CRM.

  • Alex Fun Wei Jie Profile Picture
    Alex Fun Wei Jie 33,626 on at
    RE: business process error

    Hi,

    Then you have to fix the custom workflow.

  • KaeL Profile Picture
    KaeL 220 on at
    RE: business process error

    Yes sir some of the steps was a custom workflow, i already restarted the CRM Async Service and still i got this error and it happens all of the custom workflow that has a attachment. Thank you so much for the reply

  • Suggested answer
    Adrian Begovich Profile Picture
    Adrian Begovich 21,009 Super User 2024 Season 2 on at
    RE: business process error

    Hi KaeL,

    I recommend getting in contact with the developer of the workflow, as they will be able to pinpoint the issue using the information found in the logs you posted.

  • Verified answer
    gdas Profile Picture
    gdas 50,085 on at
    RE: business process error

    Hi,

    The error says "Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.

    The statement has been terminated"

    Do you have any plugins ? Workflow?

    I think this error coming due to attachment , slowness,does it happening for all emails?

    Seems you are using onpremise , Try to restart CRM async service .

  • KaeL Profile Picture
    KaeL 220 on at
    RE: business process error

    Hi Sir Good Day

    Some part of the steps on the workflow was a custom code, i want to share the code but the code was been develop by other developer. and i dont know how to open to check the code. but all of the workflow working for more than 2 years and then suddenly most of the workflow did not work.

    Thank you so much for the reply

  • Alex Fun Wei Jie Profile Picture
    Alex Fun Wei Jie 33,626 on at
    RE: business process error

    Hi,

    is this a custom workflow? if yes, could you share the 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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans