Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics AX (Archived)

Workflow stuck in pending status

Posted on by 515

Hi Team,

Suddenly in live enviornment we are facing issue with workflows.Some workflows are stuck in Pending status without any workflow item creation(no user assignment) few are completed by user but status on transaction table is not update like from Released PR-Completed , or some workflows which are cancelled now unable to resubmit.

I ran Tutorial_WorkflowProcessor form many times but it was taking too long to complete so i have to force stop the process. I checked SysworkflowMessagetable as well but it is empty in my case. 

I ran Workflow configuration wizard and check batch job history for Workflow messaging batch job which are showing Waiting status. For Workflow messging batch job i got error log in batch history before 2-3 hrs from now which shows following error,there is no current error log niether any workflow is getting executed.

"Cannot edit a record in Workflow Messages Table (SysWorkflowMessageTable). Workflow message id: {00000000-0000-0000-0000-000000000000}, {00000000-0000-0000-0000-000000000000}.
Deadlock, where one or more users have simultaneously locked the whole table or part of it."

Microsoft.Dynamics.Ax.Xpp.DeadlockException: Exception of type 'Microsoft.Dynamics.Ax.Xpp.DeadlockException' was thrown.
at Microsoft.Dynamics.Ax.MSIL.Interop.throwException(Int32 ExceptionValue)
at Microsoft.Dynamics.Ax.MSIL.cqlCursorIL.UpdateAll(IntPtr table)
at Dynamics.Ax.Application.SysWorkflowQueueTask.assignBatchAffinity(Guid _affinity, Int64 _minRecId, Int64 _maxRecId, Boolean , Boolean ) in SysWorkflowQueueTask.assignBatchAffinity.xpp:line 47
at Dynamics.Ax.Application.SysWorkflowQueueTask.@assignBatchAffinity(Guid _affinity, Int64 _minRecId, Boolean )
at Dynamics.Ax.Application.SysWorkflowQueueTask.assignBatchAffinity(Guid _affinity)
at Dynamics.Ax.Application.SysWorkflowQueueTask.Run() in SysWorkflowQueueTask.run.xpp:line 21
at Dynamics.Ax.Application.BatchRun.runJobStatic(Int64 batchId) in BatchRun.runJobStatic.xpp:line 50
at BatchRun::runJobStatic(Object[] )
at Microsoft.Dynamics.Ax.Xpp.ReflectionCallHelper.MakeStaticCall(Type type, String MethodName, Object[] parameters)
at BatchIL.taskThreadEntry(Object threadArg)

Kindly help.

Thanks,

Shri

*This post is locked for comments

  • Suggested answer
    Prashant Singh Profile Picture
    Prashant Singh 8,797 on at
    RE: Workflow stuck in pending status

    Dear Shri,

    Could you please check the bacth job assiciated with the workflow.

    If this is OK. Please try to delete the batch job related to workflow and create it again through wizard.

  • Dhanshri Profile Picture
    Dhanshri 515 on at
    RE: Workflow stuck in pending status

    Thanks Ludwig!

    I will check these this. Also, to add few points on this issue,I observed Batch history for Workflow messaging workflow and noticed there was error after 10 min since 3rd April till 5th April 2019 2.28pm After that there is no any log for error. The workflows which has been raised during this time have some issues as mentioned above.

    BatchJob-error.png

    I noticed below error was common since 3rd April till before last error message.The last error log was as mentioned in the initial thread.

    BatchJob-error.png

    I found resolution from one of the blog for this error where it was mentioned to update few entries from SysworklfowMessageTable but in my instance I don't have any entry in this table.

    Now, there is no any error log in the system.Does it mean issue is resolved as in production i can't check by approving or recalling any request now.

    Thanks,

    Shri

  • Suggested answer
    Ludwig Reinhard Profile Picture
    Ludwig Reinhard Microsoft Employee on at
    RE: Workflow stuck in pending status

    Hello Shri,

    I would recommend that you have a look at the following fixes on LCS, ideally in combination with a colleague from the development department

    KB 3185821Deadlocks on UPDATE ACCOUNTINGEVENT coming from Classes\SubledgerJournalTransferCommand\executeTransfer

    KB 2886683Deadlock exception during a batch Job (Process Ledger Transactions)

    If those fixes do not seem to be applicable and help, try to debug the issue to find the root cause triggering this deadlock.

    Best regards,

    Ludwig

  • Dhanshri Profile Picture
    Dhanshri 515 on at
    RE: Workflow stuck in pending status

    Yes Ludwig, for one Payment voucher workflow as Approver was unable to get the request,user tried to recall the workflow but after recall its status changed to cancelled and now user is unable to submit it again. Generally after recall user can resubmit the request for payment voucher.

    Now I again kept Tutorial_workflowprocessor form to run.It is running since last 3 hours,yet to complete.but I can see below error on screen-

    "Can't edit record in system cache flush."

    Thanks,

    Shri

  • Suggested answer
    Ludwig Reinhard Profile Picture
    Ludwig Reinhard Microsoft Employee on at
    RE: Workflow stuck in pending status

    Hello Shri,

    Have you tried to recall the WF?

    Is that actually possible?

    Best regards,

    Ludwig

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,269 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans