Error/Issue:
Recently found that a few of the logic app instances were failing with following error:
"Failed to complete the message with the lock token 'xxxxx'. The lock on the message has been lost"
Why it happened
When the message is received in ReceiveAndDelete mode, the message is automatically removed from the queue.
When the message is received in PeekLock mode and if the message is not completed or if the message lock is expired, the message will be automatically available for other receivers.
Thus the message received in PeekLock mode should be removed from the queue by calling Complete() method.
And while performing this complete action, the above mentioned occur and reason is the service bus lock duration.
Default lock duration for the Azure Service Bus transport is set to 30 seconds. Maximum lock duration allowed by the broker service is 5 minutes.
Thus in a scenario, where steps before marking queue message complete took over 5 minutes, the lock was released on that message and thus not available for complete action.
What to do
That's it, after saving it tested the workflow and now there was no error even after the duration went above 5 minutes
Related Post
- Interview questions and answers on Logic Apps
- Getting Started with Logic Apps - Enterprise Application Integration
- Getting Started with Logic Apps - EDI X12 Fundamentals
- Getting Started with Logic Apps - What happened to the Request?
- Getting Started with Logic Apps - Fundamentals
- Getting Started with Logic Apps - AS2
- Getting Started with Logic Apps - XML to EDI X12
- The provided map definition is not valid
- Required property 'content' expects a value but got null. Path ''.'
- Getting Started with Logic Apps - File Routing
- Installing and Configuring On Premises Data Gateway - By adding user to Active Directory
- Inserting data in On Premises SQL Database using Logic Apps
- Inserting Multiple Records In On Prem SQL Using Logic App
- Check your request parameters to make sure the Path “” exists on your file system