Foundatio.AzureServiceBus icon indicating copy to clipboard operation
Foundatio.AzureServiceBus copied to clipboard

The lock supplied is invalid. Either the lock expired, or the message has already been removed

Open Bakanych opened this issue 3 years ago • 5 comments

Hi guys, not sure what I'm doing wrongly, but I just specified AzureServiceBusConnectionString in appsettings.json and ran AzureServiceBusMessageBusTests. Almost all of them were failed with the similar error message

Error sending work item to worker: The lock supplied is invalid. Either the lock expired, or the message has already been removed from the queue, or was received by a different receiver instance.

I had same issues when tried to use the latest nuget package.

Any ideas?

Bakanych avatar Aug 10 '21 14:08 Bakanych

Can you provide more specifics on the message bus instance you created. Size / Features etc..

niemyjski avatar Aug 10 '21 14:08 niemyjski

Hi @niemyjski , it's pretty standard one:

    "sku": {
        "name": "Standard",
        "tier": "Standard"
    },
    "type": "Microsoft.ServiceBus/Namespaces",
    "location": "West Europe",

ConnectionString looks like this:

Endpoint=sb://<name>.servicebus.windows.net/;SharedAccessKeyName=<keyname>;SharedAccessKey=<key>

Which kind of features can be an issue? I remember I created it using defaults.

Bakanych avatar Aug 10 '21 15:08 Bakanych

Thanks for that, I'm double checked our build as tests should be running as part of the build, but that doesn't seem to be the case after looking :. I updated the test connection string and will run the tests locally. Is there any chance you could look into this?

niemyjski avatar Aug 11 '21 13:08 niemyjski

Sure, I'll help with pleasure. Just let me know how :)

Bakanych avatar Aug 12 '21 01:08 Bakanych

I'd start by debugging the unit tests and figure out why we are getting the lock id error, you may need to clone the foundatio project and locally update project references to step through.

niemyjski avatar Aug 12 '21 13:08 niemyjski