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)

Async Workflow is failing randomly with an lock error

(0) ShareShare
ReportReport
Posted on by

Hi Experts,

 

I need pointers on the below issue.

 

Environment: CRM 2015 On Premise

 

Issue:

 

We are using multiple system workflows and few of them are failing randomly with error messages mentioned below.

Failed workflows are doing different tasks.

 

Cannot obtain lock on resource:'Email_eef9495e-3917-e611-8129-002dd80f0748', mode:Update - stored procedure sp_getapplock returned error code -3.

 

Plugin Trace:

 

[Microsoft.Xrm.Sdk.Workflow: Microsoft.Xrm.Sdk.Workflow.Activities.AssignEntity]

[AssignStep4: Assign Opportunity Owner]

 

Error Message:

 

Unhandled Exception: System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=7.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]: Cannot obtain lock on resource:'Email_eef9495e-3917-e611-8129-002dd80f0748', mode:Update - stored procedure sp_getapplock returned error code -3.Detail:

<OrganizationServiceFault xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.microsoft.com/xrm/2011/Contracts">

  <ErrorCode>-2147204295</ErrorCode>

  <ErrorDetails xmlns:d2p1="http://schemas.datacontract.org/2004/07/System.Collections.Generic" />

  <Message>Cannot obtain lock on resource:'Email_eef9495e-3917-e611-8129-002dd80f0748', mode:Update - stored procedure sp_getapplock returned error code -3.</Message>

  <Timestamp>2016-05-11T05:29:52.1315526Z</Timestamp>

  <InnerFault>

    <ErrorCode>-2147204295</ErrorCode>

    <ErrorDetails xmlns:d3p1="http://schemas.datacontract.org/2004/07/System.Collections.Generic" />

    <Message>Cannot obtain lock on resource:'Email_eef9495e-3917-e611-8129-002dd80f0748', mode:Update - stored procedure sp_getapplock returned error code -3.</Message>

    <Timestamp>2016-05-11T05:29:52.1315526Z</Timestamp>

    <InnerFault i:nil="true" />

    <TraceText i:nil="true" />

  </InnerFault>

  <TraceText>[Microsoft.Xrm.Sdk.Workflow: Microsoft.Xrm.Sdk.Workflow.Activities.AssignEntity]

[AssignStep4: Assign Opportunity Owner]

</TraceText>

</OrganizationServiceFault>

   at Microsoft.Crm.Extensibility.OrganizationSdkServiceInternal.Execute(OrganizationRequest request, CorrelationToken correlationToken, CallerOriginToken callerOriginToken, WebServiceType serviceType, Boolean checkAdminMode)

   at Microsoft.Crm.Extensibility.InprocessServiceProxy.ExecuteCore(OrganizationRequest request)

   at Microsoft.Crm.Workflow.Services.AssignActivityService.Assign(String entityName, Guid entityId, AssignType assignType, Guid assignTo, IOrganizationService sdkService)

   at Microsoft.Crm.Workflow.Services.AssignActivityService.<>c__DisplayClass1.<AssignInternal>b__0(IOrganizationService sdkService)

   at Microsoft.Crm.Workflow.Services.ActivityServiceBase.ExecuteInTransactedContext(ActivityDelegate activityDelegate)

   at Microsoft.Crm.Workflow.Services.AssignActivityService.AssignInternal(Guid entityId, String entityName, AssignType assignType, Guid assignTo)

   at Microsoft.Crm.Workflow.Services.AssignActivityService.ExecuteInternal(ActivityContext executionContext, AssignEntity assignEntity)

   at Microsoft.Crm.Workflow.Services.AssignActivityService.Execute(ActivityContext executionContext, AssignEntity assignEntity)

   at System.Activities.CodeActivity.InternalExecute(ActivityInstance instance, ActivityExecutor executor, BookmarkManager bookmarkManager)

   at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation)

 

 

ASK: 

Is anybody experiencing this error message? If yes what is the next step in order to resolve this.

Is this a known issue?

*This post is locked for comments

I have the same question (0)
  • Community Member Profile Picture
    on at

    Stop all async services (maintenance one as well). Clear the locks from db manually. Restart the services.

    OR

    Restart the SQL server, that will release the locks.

  • Ummacrm Profile Picture
    270 on at

    Your timing is off.  Add a check or a timing trigger might resolve the problem if this issue continues to happen after restarting async / sql box.

  • epark06 Profile Picture
    1,328 on at

    Hi, our case is almost identical to this. Here is our workflow. We have restarted async services multiple times. Can someone please help?

    oppassign.PNG

  • epark06 Profile Picture
    1,328 on at

    Never mind, I just had to resume the jobs.

  • Nitesh Sharma Profile Picture
    on at

    I have similar issue.. Also we are using online version , so could not re-start Jobs

    I did resume workflow and it fixed the issue

  • Shyam D Profile Picture
    15 on at

    We are also facing the same issue, but in Online version. We can't reset the database. Neither it is always good to go in the workflow session and resume it.  Has anyone find any complete solution for this?

  • Martin Donnelly Profile Picture
    1,030 on at

    Bring to mind what causes deadlocks -- two "users" requesting the same resources in different orders and each getting part of their request granted.

    You have to review ALL the workflows, plugins/assemblies and client-side calls that are attempting to access the entity record in the pre-process (asynchronously.)

    This is not bad administration; this is bad development.

  • epark06 Profile Picture
    1,328 on at

    In our case (OPD) we restarted async and almost ALL workflows were "stuck" in Waiting. I realized these workflows were triggered from the async restart and were from some custom plugins, which we did not need. After cancelling them, then the essential workflows started to work again.

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