Azure / LogicAppsUX

https://learn.microsoft.com/azure/logic-apps
MIT License
75 stars 81 forks source link

ServiceBus built-in complete action fails to complete messages on ServiceBus queue #2356

Closed rob-thijssen closed 1 year ago

rob-thijssen commented 1 year ago

Describe the Bug with repro steps

  1. Setup workflow with built-in ServiceBus trigger "When messages are available in a queue (peek-lock)"
  2. Add any action (eg. Compose)
  3. Add built-in ServiceBus action "Complete the message action"

Add a new item to the queue the trigger is listening to. When running the workflow, the message with messageId SOMETIMES (50/50 chance) not complete as result of a bad request

  "code": "ServiceProviderActionFailed",
  "message": "The service provider action failed with error code 'ServiceOperationFailed' and error message 'The Service Bus receiver was not found to perform operation 'completeMessage' on message id '5115677d-c322-4c35-b377-524490118728'.'.```

After the lock release a new run is triggered. This run the message is might still not be completed successfully, or is succesfully completed.

### What type of Logic App Is this happening in?

Standard (Portal)

### Are you using Preview Designer or GA Designer

Generally Available

### Workflow JSON

```json
{
  "definition": {
    "$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#",
    "actions": {
      "Complete_the_message": {
        "type": "ServiceProvider",
        "inputs": {
          "parameters": {
            "messageId": "@item()?['messageId']"
          },
          "serviceProviderConfiguration": {
            "connectionName": "servicebus",
            "operationId": "completeMessage",
            "serviceProviderId": "/serviceProviders/serviceBus"
          }
        },
        "runAfter": {
          "Compose": [
            "SUCCEEDED"
          ]
        }
      },
      "Compose": {
        "type": "Compose",
        "inputs": "@triggerBody()?['contentData']",
        "runAfter": {}
      }
    },
    "contentVersion": "1.0.0.0",
    "outputs": {},
    "triggers": {
      "When_messages_are_available_in_a_queue_(peek-lock)": {
        "type": "ServiceProvider",
        "inputs": {
          "parameters": {
            "queueName": "@parameters('myworkflow').queueName"
          },
          "serviceProviderConfiguration": {
            "connectionName": "serviceBus",
            "operationId": "peekLockQueueMessages",
            "serviceProviderId": "/serviceProviders/serviceBus"
          }
        },
        "splitOn": "@triggerOutputs()?['body']"
      }
    }
  },
  "kind": "Stateful"
}

Screenshots or Videos

image image

Browser

Edge

Additional context

No response

rob-thijssen commented 1 year ago

Edit: I submitted the issue in the wrong github repo. This is a runtime issue. Created a new issue here: https://github.com/Azure/logicapps/issues/773