Azurite: Event Hub blob partition lease conflict

This webjob works fine running on Windows with the Windows Storage Emulator.

Which service(blob, file, queue, table) does this issue concern?

blob

Which version of the Azurite was used?

v2

Where do you get Azurite? (npm, DockerHub, NuGet, Visual Studio Code Extension)

DockerHub

What’s the Node.js version?

6.11.2

What problem was encountered?

Microsoft.Azure.WebJobs.Host.Listeners.FunctionListenerException: The listener for function 'RouterHost.Route' was unable to start. ---> Microsoft.Azure.EventHubs.Processor.EventProcessorRuntimeException: Out of retries creating lease for partition ---> Microsoft.Window
sAzure.Storage.StorageException: Conflict
   at Microsoft.WindowsAzure.Storage.Core.Executor.Executor.ExecuteAsyncInternal[T](RESTCommand`1 cmd, IRetryPolicy policy, OperationContext operationContext, CancellationToken token)
   at Microsoft.WindowsAzure.Storage.Blob.CloudBlockBlob.UploadFromStreamAsyncHelper(Stream source, Nullable`1 length, AccessCondition accessCondition, BlobRequestOptions options, OperationContext operationContext, IProgress`1 progressHandler, CancellationToken cancella
tionToken)
   at Microsoft.Azure.EventHubs.Processor.AzureStorageCheckpointLeaseManager.CreateLeaseIfNotExistsAsync(String partitionId)
   at Microsoft.Azure.EventHubs.Processor.AzureStorageCheckpointLeaseManager.CreateLeaseIfNotExistsAsync(String partitionId)
   at Microsoft.Azure.EventHubs.Processor.PartitionManager.RetryAsync(Func`1 lambda, String partitionId, String retryMessage, String finalFailureMessage, String action, Int32 maxRetries)
   --- End of inner exception stack trace ---
   at Microsoft.Azure.EventHubs.Processor.PartitionManager.RetryAsync(Func`1 lambda, String partitionId, String retryMessage, String finalFailureMessage, String action, Int32 maxRetries)
   at Microsoft.Azure.EventHubs.Processor.PartitionManager.InitializeStoresAsync()
   at Microsoft.Azure.EventHubs.Processor.PartitionManager.StartAsync()
   at Microsoft.Azure.EventHubs.Processor.EventProcessorHost.RegisterEventProcessorFactoryAsync(IEventProcessorFactory factory, EventProcessorOptions processorOptions)
   at Medumo.WebJobs.Extensions.EventHub.Binding.EventHubListener.StartAsync(CancellationToken cancellationToken)
   at Microsoft.Azure.WebJobs.Host.Listeners.FunctionListener.StartAsync(CancellationToken cancellationToken, Boolean allowRetry) in C:\projects\azure-webjobs-sdk-rqm4t\src\Microsoft.Azure.WebJobs.Host\Listeners\FunctionListener.cs:line 69

Steps to reproduce the issue?

  • Use macOS
  • docker run -d -t -p 10000:10000 -p 10001:10001 -p 10002:10002 -v /Users/myuser/azurite:/opt/azurite/folder arafato/azurite
  • Create .NET Core 2.2 class library
  • Setup HostBuilder to search for EventHubTriggerAttribute
  • Set up a EventHubTrigger class/function (see here)
  • Run WebJob with dotnet run --project MyWebJobProject

Have you found a mitigation/solution?

No

About this issue

  • Original URL
  • State: open
  • Created 5 years ago
  • Reactions: 2
  • Comments: 20 (2 by maintainers)

Most upvoted comments

@gabrieljoelc It seems that it was a param that was only added in v3. It is used to ignore unsupported headers in requests (which was my issue using the VSCode extension w/an Event Hub trigger). You would just add the --loose param when starting the v3 Azurite blob.

@XiaoningLiu I am having a very similar issue on v 3.2.0-preview (both using the docker image and running via node on Windows). I have an Azure Function with an EventHub-trigger (Azure Function SDK 1.0.29). I’m using version 3.0.6 of Microsoft.Azure.WebJobs.Extensions.EventHub (I see there’s an v4 out of this, but I cannot get my project to run with it). My app starts just fine, and it can process messages. However, when it tries to write checkpoints it fails: ConsoleError

Attaching an outtake of debug.log from around the time of execution: outtake.log

Never mind the differences in timestamps from the screenshot btw. Separate runs, same errors!

It may be something related to an older API-version being used. My project also uses Microsoft.Azure.WebJobs.Extensions.Storage (version 3.0.8). This package has a dependency on WindowsAzure.Storage which is now deprecated.

Similar problem here running azurite@3.2.0-preview when trying to test Azure Event Hubs locally.

I started azurite in debug mode ans then ran my function using func start. My event hub uses multiple partitions which all report the same logs and errors as below:

127.0.0.1 - - [04/Nov/2019:06:10:15 +0000] "HEAD /devstoreaccount1/azure-webjobs-eventhub/xxx.servicebus.windows.net/test/$Default/0 HTTP/1.1" 200 156
127.0.0.1 - - [04/Nov/2019:06:10:15 +0000] "HEAD /devstoreaccount1/azure-webjobs-eventhub/xxx.servicebus.windows.net/test/$Default/0 HTTP/1.1" 200 156
127.0.0.1 - - [04/Nov/2019:06:10:15 +0000] "PUT /devstoreaccount1/azure-webjobs-eventhub/xxx.servicebus.windows.net/test/$Default/0?comp=lease HTTP/1.1" 201 -
127.0.0.1 - - [04/Nov/2019:06:10:15 +0000] "PUT /devstoreaccount1/azure-webjobs-eventhub/xxx.servicebus.windows.net/test/$Default/0 HTTP/1.1" 201 -


127.0.0.1 - - [04/Nov/2019:06:10:25 +0000] "PUT /devstoreaccount1/azure-webjobs-eventhub/xxx.servicebus.windows.net/test/$Default/0?comp=lease&timeout=10 HTTP/1.1" 409 -

[11/4/19 6:10:25 AM] EventProcessorHost error (Action=Renewing Lease, HostName=xxxxx, PartitionId=0)
[11/4/19 6:10:25 AM] Microsoft.Azure.EventHubs.Processor: Conflict. Microsoft.WindowsAzure.Storage: Conflict.

Hope this helps narrow down the problem a bit.