dapr / dapr/dotnet-sdk

WorkflowConsoleApp example does not run (in devcontainer)

Open
#1,101 0 comments 0 reactions 0 assignees View on GitHub
kind/bug
Dominant language
C#
Stars
1.2k
Forks
378
Avg merge
2d 1h
Merged PRs (30d)
6

Description

## Expected Behavior

The WorkflowConsoleApp should run in a devcontainer

## Actual Behavior

1. With the `"ghcr.io/devcontainers/features/docker-from-docker:2"` configuration in the devcontainer.json the App cannot reach Redis running outside of the devcontainer
2. Correcting the above to `"ghcr.io/devcontainers/features/docker-in-docker:2"` allows the App to start. But it crashes on the first request.

> Sidecar work-item streaming connection established.
> *** Restocking inventory...
> *** Paperclips: 100
> *** Cars: 100
> *** Computers: 100
> Enter the name of one of the following items to order [Paperclips, Cars, Computers].
> To restock items, type 'restock'.
> Cars
> How many Cars would you like to purchase?
> 1
> Starting order workflow 'cars-41fa87b8' purchasing 1 Cars
> Unhandled exception. warn: Microsoft.DurableTask[12]
> cars-41fa87b8: 'OrderProcessingWorkflow' orchestrator failed with an unhandled exception: System.ObjectDisposedException: Cannot access a disposed object.
> Object name: 'IServiceProvider'.
> at Microsoft.Extensions.DependencyInjection.ServiceLookup.ThrowHelper.ThrowObjectDisposedException()
> at Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope.GetService(Type serviceType)
> at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(IServiceProvider provider, Type serviceType)
> at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService[T](IServiceProvider provider)
> at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.CreateAsyncScope(IServiceProvider provider)
> at Microsoft.DurableTask.Worker.Grpc.GrpcDurableTaskWorker.Processor.OnRunOrchestratorAsync(OrchestratorRequest request).
> Dapr.DaprException: Get workflow operation failed: the Dapr endpoint indicated a failure. See InnerException for details.
> ---> Grpc.Core.RpcException: Status(StatusCode="InvalidArgument", Detail="no component or empty component was provided")
> at Dapr.Client.DaprClientGrpc.GetWorkflowAsync(String instanceId, String workflowComponent, CancellationToken cancellationToken) in /workspaces/dotnet-sdk/src/Dapr.Client/DaprClientGrpc.cs:line 1534
> --- End of inner exception stack trace ---
> at Dapr.Client.DaprClientGrpc.GetWorkflowAsync(String instanceId, String workflowComponent, CancellationToken cancellationToken) in /workspaces/dotnet-sdk/src/Dapr.Client/DaprClientGrpc.cs:line 1557
> at Dapr.Client.DaprClient.WaitForWorkflowStartAsync(String instanceId, String workflowComponent, CancellationToken cancellationToken) in /workspaces/dotnet-sdk/src/Dapr.Client/DaprClient.cs:line 1022
> at Program.$(String[] args) in /workspaces/dotnet-sdk/examples/Workflow/WorkflowConsoleApp/Program.cs:line 123
> at Program.(String[] args)
>

## Steps to Reproduce the Problem

1. clone dotnet-sdk
3. open the project in VSCode
4. open in devcontainer
5. start the WorkflowConsoleApp following the README instructions
6. Order 1 Cars

## Release Note

RELEASE NOTE:

Contributor guide

Open the contributing guide

Research direction

Start with the devcontainer.json configuration and the WorkflowConsoleApp README instructions, then inspect examples/Workflow/WorkflowConsoleApp/Program.cs around line 123. Reproduce the devcontainer setup and order request, following the Dapr.Client stack trace to distinguish the connectivity and disposed-service failures. Done means the app starts in the devcontainer and completes the first order request without either error.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, docker, grpc, redis
Domain
backend, devops
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.