question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Event Hub blob partition lease conflict

See original GitHub issue

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

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:2
  • Comments:20 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
acd-hficommented, Feb 11, 2020

@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.

2reactions
kjohanncommented, Oct 2, 2019

@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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Receive events using Event Processor Host - Azure Event Hubs
The key to scale for Event Hubs is the idea of partitioned consumers. ... of EventProcessorHost due to lease expiration and Epoch conflicts....
Read more >
What is causing Azure Event Hubs ...
Leases will be acquired for a set time, after which the EPH instance will loose the ownership on this Partition. now, lets say,...
Read more >
Azure Event Hub SDK Internals - Part 2 (Partition Manager ...
The Partition Manager checks if the lease-store and the checkpoint store ... The leasing mechanism of event hub is built on Azure Blobs....
Read more >
路边两盏灯 - 博客园
I think this is occurring due to Event Hubs' automatic lease ... on 10 storage blobs representing these 10 event hub partitions (with...
Read more >
Azure : Event Hub A First Look | Sacha's Blog - WordPress.com
The consumer can inform the Event Hub when it considers an event stream complete. If a consumer disconnects from a partition, when connection...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found