web
You’re offline. This is a read only version of the page.
close
Skip to main content
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)
  • epark06 Profile Picture
    1,328 on at
    RE: Async Workflow is failing randomly with an lock error

    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.

  • Martin Donnelly Profile Picture
    1,030 on at
    RE: Async Workflow is failing randomly with an lock error

    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.

  • Shyam D Profile Picture
    15 on at
    RE: Async Workflow is failing randomly with an lock error

    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?

  • Nitesh Sharma Profile Picture
    on at
    RE: Async Workflow is failing randomly with an lock error

    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

  • epark06 Profile Picture
    1,328 on at
    RE: Async Workflow is failing randomly with an lock error

    Never mind, I just had to resume the jobs.

  • epark06 Profile Picture
    1,328 on at
    RE: Async Workflow is failing randomly with an lock error

    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

  • Ummacrm Profile Picture
    270 on at
    RE: Async Workflow is failing randomly with an lock error

    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.

  • Community Member Profile Picture
    on at
    RE: Async Workflow is failing randomly with an lock error

    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.

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…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
HR-09070029-0 Profile Picture

HR-09070029-0 2

#1
Aric Levin - MVP Profile Picture

Aric Levin - MVP 2 Moderator

#3
ED-30091530-0 Profile Picture

ED-30091530-0 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans