sam
sam

Reputation: 85

Microsoft.WindowsAzure.Storage.StorageException: There is already a lease present

Am getting the below error with using the event hub binding.

  public static  void Run([EventHubTrigger("tlog_eh_policy", Connection = "EventHub_Conn")] EventData[] events, ILogger log, ExecutionContext context)                

Some of the messages are processed and saved by Azure function and some are skipped. I found the below error in the Azure function live metrics. Any idea on this

Microsoft.WindowsAzure.Storage.StorageException: There is already a lease present. at Microsoft.Azure.EventHubs.Processor.AzureStorageCheckpointLeaseManager.AcquireLeaseCoreAsync(AzureBlobLease lease) at Microsoft.Azure.EventHubs.Processor.PartitionManager.<>c__DisplayClass12_2.<b__2>d.MoveNext() Request Information RequestID:7fa2a7c1-a01e-0046-0b06-b2062d000000 RequestDate:Fri, 13 Dec 2019 22:44:14 GMT StatusMessage:There is already a lease present. ErrorCode:LeaseAlreadyPresent ErrorMessage:There is already a lease present. RequestId:7fa2a7c1-a01e-0046-0b06-b2062d000000 Time:2019-12-13T22:44:14.1251726Z

Upvotes: 2

Views: 6480

Answers (1)

Ivan Glasenberg
Ivan Glasenberg

Reputation: 29995

If the event hub connection string is used by more than 1 app / active component, there is the possibility cause the issue "There is already a lease present" due to concurrent blob storage usage.

So you can use the connection string just for 1 app / active component to avoid this issue.

Upvotes: 4

Related Questions