dapr / dapr

Dapr is a portable, event-driven, runtime for building distributed applications across cloud and edge.

Home Page:https://dapr.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Workflow Failure with --resources-path parameter

Sbaia opened this issue · comments

When registering a workflow in an application and then running the application with the --resources-path parameter in Dapr, the workflow fails to function. Instead, Dapr returns the following error:

{ "errorCode": "ERR_GET_WORKFLOW", "message": "error while getting workflow info on instance 'xxx': failed to get workflow metadata for 'xxx': Failed to fetch orchestration metadata: did not find address for actor dapr.internal.default.test.workflow/xxx" }

However, when the resources-path parameter is not used, the workflow functions correctly.

In what area(s)?

/area runtime

What version of Dapr?

1.13.2

Expected Behavior

The workflow should function properly when running the application with the --resources-path parameter.

Actual Behavior

The workflow fails to function, and Dapr returns an error regarding orchestration metadata.

Steps to Reproduce the Problem

  1. Create this simple .NET project with Dapr.Workflow NuGet Package

using Dapr.Workflow;
using Microsoft.AspNetCore.Builder;

var builder = WebApplication.CreateBuilder();
var services = builder.Services;
services.AddDaprWorkflow(options =>
{
options.RegisterWorkflow<object, object>(
"test",
async (context, input) =>
{
await Task.Delay(TimeSpan.FromSeconds(10)).ConfigureAwait(false);
return null;
});
});
if (string.IsNullOrEmpty(Environment.GetEnvironmentVariable("DAPR_GRPC_PORT")))
{
throw new Exception("DAPR_GRPC_PORT environment variable is not set");
}

var app = builder.Build();
app.Run();

  1. run dapr application with
    dapr run --app-id test --dapr-http-port 3599 --dapr-grpc-port 4599 --resources-path ./components -- dotnet run
  2. start workflow with
    `POST http://localhost:3599/v1.0-beta1/workflows/dapr/test/start?instanceID=xxx
    Content-Type: application/json

{}
`
4. the workflow will fail.
5. if re-run dapr application without --resources-path ./components , the workflow start