elsa-workflows / elsa-workflows/elsa-core

Elsa webhooks are not working

Open
#3,349 1 comment 0 reactions 0 assignees View on GitHub
bug triaged
Dominant language
C#
Stars
7.9k
Forks
1.5k
Avg merge
15h 22m
Merged PRs (30d)
114

Description

Tested on version 2.9.0

How to replicate:

Create a webhook with a path starting with /
Add the webhook to a workflow, publish it and try to access it.

Details below:
```[{"errorMessage":"Workflow faulted at 2022-10-12T20:07:51Z with error: An exception was thrown whilst setting 'HttpEndpoint.Path'. See the inner exception for further details.","exception":{"Type":"Elsa.Exceptions.CannotSetActivityPropertyValueException","Message":"An exception was thrown whilst setting 'HttpEndpoint.Path'. See the inner exception for further details.","StackTrace":" at Elsa.Services.ActivityPropertyProviders.SetNestedActivityPropertiesAsync(Object nestedInstance, ActivityExecutionContext activityExecutionContext, IDictionary2 providers, IActivityPropertyDefaultValueResolver defaultValueResolver, String nestedInstanceName, CancellationToken cancellationToken)\r\n at Elsa.Services.ActivityPropertyProviders.SetActivityPropertiesAsync(IActivity activity, ActivityExecutionContext activityExecutionContext, CancellationToken cancellationToken)\r\n at Elsa.Services.Workflows.ActivityActivator.ActivateActivityAsync(ActivityExecutionContext context, Type type, CancellationToken cancellationToken)\r\n at Elsa.Services.ActivityActivatorExtensions.ActivateActivityAsync[T](IActivityActivator activityActivator, ActivityExecutionContext context, CancellationToken cancellationToken)\r\n at Elsa.Activities.Webhooks.ActivityTypes.WebhookActivityTypeProvider.<>c__DisplayClass7_0.<g__ActivateActivityAsync|1>d.MoveNext()\r\n--- End of stack trace from previous location ---\r\n at Elsa.Services.Workflows.WorkflowRunner.CanExecuteAsync(WorkflowExecutionContext workflowExecutionContext, IActivityBlueprint activityBlueprint, Boolean resuming, CancellationToken cancellationToken)\r\n at Elsa.Services.Workflows.WorkflowRunner.BeginWorkflow(WorkflowExecutionContext workflowExecutionContext, IActivityBlueprint activity, CancellationToken cancellationToken)","InnerException":{"Type":"System.ArgumentException","Message":"Object of type 'Microsoft.AspNetCore.Http.PathString' cannot be converted to type 'System.String'.","StackTrace":" at System.RuntimeType.TryChangeType(Object value, Binder binder, CultureInfo culture, Boolean needsSpecialCast)\r\n at System.RuntimeType.CheckValue(Object value, Binder binder, CultureInfo culture, BindingFlags invokeAttr)\r\n at System.Reflection.MethodBase.CheckArguments(StackAllocedArguments& stackArgs, ReadOnlySpan1 parameters, Binder binder, BindingFlags invokeAttr, CultureInfo culture, Signature sig)\r\n at System.Reflection.RuntimeMethodInfo.InvokeOneParameter(Object obj, BindingFlags invokeAttr, Binder binder, Object parameter, CultureInfo culture)\r\n at System.Reflection.RuntimePropertyInfo.SetValue(Object obj, Object value, BindingFlags invokeAttr, Binder binder, Object[] index, CultureInfo culture)\r\n at System.Reflection.PropertyInfo.SetValue(Object obj, Object value)\r\n at Elsa.Services.ActivityPropertyProviders.SetNestedActivityPropertiesAsync(Object nestedInstance, ActivityExecutionContext activityExecutionContext, IDictionary`2 providers, IActivityPropertyDefaultValueResolver defaultValueResolver, String nestedInstanceName, CancellationToken cancellationToken)","InnerException":null,"Data":{}},"Data":{}},"workflow":{"name":null,"version":21,"instanceId":"7af1487c1875406da041c2ee78c0cb31"}}]```

Contributor guide

Open the contributing guide

Research direction

Start with WebhookActivityTypeProvider and the HttpEndpoint.Path assignment in the ActivityPropertyProviders stack trace. Reproduce the leading-slash webhook workflow described in the issue, then verify that publishing and accessing it completes without the PathString-to-String exception.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
api, backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 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.