Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in AppLeaseStarter task, when running Durable Function and Azurite in docker container using docker compose. #1010

Open
JohanKlijn opened this issue Nov 29, 2023 · 1 comment

Comments

@JohanKlijn
Copy link

When running Azure Durable Function in a docker container and using Azurite as storage account/provider an exception occurs in the DurableTask.AzureStorage.Partitioning.AppLeaseManager.

Environment

  • A container containing a simple Durable Function
  • A container running Azurite
  • Containers are started using docker compose

The connection string used by the Durable Function is using the "default developers connection string" and pointing to the host "".
Full connnection string:

DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://host.docker.internal:9990/devstoreaccount1;QueueEndpoint=http://host.docker.internal:9991/devstoreaccount1;TableEndpoint=http://host.docker.internal:9992/devstoreaccount1;

Steps to reproduce
I created a repo which allows you to easily reproduce the issue. Perform the following steps to reproduce the issue:

  1. Clone the repo https://github.com/JohanKlijn/AzDurableFunctionsOnContainersSample
  2. Run the following command in the root of the repo
docker build . -f "docker\Dockerfile" -t azfunctiononcontainer
  1. Start the container by running the following command from the directory .\docker
docker compose up

When the containers are running the first error will be:

docker-azfunctiononcontainer-1  | fail: DurableTask.AzureStorage[122]
docker-azfunctiononcontainer-1  |       mytaskhub-applease: Error in AppLeaseStarter task. Exception: DurableTask.AzureStorage.Storage.DurableTaskStorageException: The specified blob does not exist.
docker-azfunctiononcontainer-1  |        ---> Microsoft.WindowsAzure.Storage.StorageException: The specified blob does not exist.
docker-azfunctiononcontainer-1  |          at Microsoft.WindowsAzure.Storage.Core.Executor.Executor.ExecuteAsyncInternal[T](RESTCommand`1 cmd, IRetryPolicy policy, OperationContext operationContext, CancellationToken token)
docker-azfunctiononcontainer-1  |          at Microsoft.WindowsAzure.Storage.Blob.CloudBlob.DownloadRangeToStreamAsync(Stream target, Nullable`1 offset, Nullable`1 length, AccessCondition accessCondition, BlobRequestOptions options, OperationContext operationContext, IProgress`1 progressHandler, CancellationToken cancellationToken)
docker-azfunctiononcontainer-1  |          at DurableTask.AzureStorage.Storage.AzureStorageClient.WrapFunctionWithReturnType(Func`3 storageRequest, OperationContext context, CancellationToken cancellationToken) in /_/src/DurableTask.AzureStorage/Storage/AzureStorageClient.cs:line 157
docker-azfunctiononcontainer-1  |          at DurableTask.AzureStorage.TimeoutHandler.ExecuteWithTimeout[T](String operationName, String account, AzureStorageOrchestrationServiceSettings settings, Func`3 operation, AzureStorageOrchestrationServiceStats stats, String clientRequestId)
docker-azfunctiononcontainer-1  |          at DurableTask.AzureStorage.Storage.AzureStorageClient.MakeStorageRequest[T](Func`3 storageRequest, String accountName, String operationName, String clientRequestId, Boolean force)

after the first error the following error keeps occurring:

docker-azfunctiononcontainer-1  | fail: DurableTask.AzureStorage[122]
docker-azfunctiononcontainer-1  |       mytaskhub-applease: Error in AppLeaseStarter task. Exception: System.InvalidOperationException: AppLeaseManager has already started
docker-azfunctiononcontainer-1  |          at DurableTask.AzureStorage.Partitioning.AppLeaseManager.StartAppLeaseAsync() in /_/src/DurableTask.AzureStorage/Partitioning/AppLeaseManager.cs:line 250
docker-azfunctiononcontainer-1  |          at DurableTask.AzureStorage.Partitioning.AppLeaseManager.AppLeaseManagerStarter(CancellationToken cancellationToken) in /_/src/DurableTask.AzureStorage/Partitioning/AppLeaseManager.cs:line 146

Full log file is attachted to this issue.
Log running Durable Function and Azurite in docker.txt

@JohanKlijn
Copy link
Author

Anyone?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant