Open captaris opened 1 month ago
Can you provide detailed steps to reproduce this and or a sample project? Which version of Elsa are you seeing this?
Teacher: Hello The steps to reproduce the error are as follows:
I also get this issue on my custom activities. They were working on an older version of Elsa (I think 3.1). I updated today and they aren't working now. I think the problem is related to when my workflow is resuming from a bookmark, it removes the bookmark, which causes it to immediately remove the activities related to the bookmark, which is the activity thats resuming. So when it tries to find the one to resume its already been removed.
This is a guess based on what I see in the logs and the code I was able to step through. I dont fully understand the life cycle of bookmarks and running from code its not so easy to unwind the pull of the new code to compare
System.Exception: Lost an owner context at Elsa.Workflows.Services.WorkflowStateExtractor.ExtractCompletionCallbacks(WorkflowState state, WorkflowExecutionContext workflowExecutionContext) at Elsa.Workflows.Services.WorkflowStateExtractor.Extract(WorkflowExecutionContext workflowExecutionContext) at Elsa.Workflows.Services.WorkflowRunner.RunAsync(WorkflowExecutionContext workflowExecutionContext) at Elsa.Workflows.Services.WorkflowRunner.RunAsync(WorkflowGraph workflowGraph, WorkflowState workflowState, RunWorkflowOptions options, CancellationToken cancellationToken) at Elsa.Workflows.Runtime.Services.WorkflowHost.ResumeWorkflowAsync(ResumeWorkflowHostParams params, CancellationToken cancellationToken) at Elsa.Workflows.Runtime.Services.DefaultWorkflowRuntime.ResumeWorkflowAsync(String workflowInstanceId, ResumeWorkflowRuntimeParams options) at Elsa.Workflows.Runtime.Services.DefaultWorkflowRuntime.ResumeWorkflowAsync(String workflowInstanceId, ResumeWorkflowRuntimeParams options) at Elsa.Workflows.Runtime.Services.DefaultWorkflowRuntime.ResumeWorkflowsAsync(IEnumerable
1 bookmarks, ResumeWorkflowRuntimeParams runtimeParams) at Elsa.Workflows.Runtime.Services.DefaultWorkflowRuntime.ResumeWorkflowsAsync(String activityTypeName, Object bookmarkPayload, TriggerWorkflowsOptions options) at Elsa.Workflows.Runtime.Services.DefaultWorkflowInbox.ResumeWorkflowsSynchronouslyAsync(WorkflowInboxMessage message, CancellationToken cancellationToken) at Elsa.Workflows.Runtime.Services.DefaultWorkflowInbox.BroadcastAsync(WorkflowInboxMessage message, BroadcastWorkflowInboxMessageOptions options, CancellationToken cancellationToken) at Elsa.Workflows.Runtime.Handlers.ReadWorkflowInboxMessage.HandleAsync(WorkflowInboxMessageReceived notification, CancellationToken cancellationToken) at Elsa.Mediator.PublishingStrategies.SequentialProcessingStrategy.PublishAsync(NotificationStrategyContext context) at Elsa.Mediator.Middleware.Notification.Components.NotificationHandlerInvokerMiddleware.InvokeAsync(NotificationContext context) at Elsa.Mediator.Middleware.Notification.NotificationPipeline.ExecuteAsync(NotificationContext context) at Elsa.Mediator.Services.DefaultMediator.SendAsync(INotification notification, IEventPublishingStrategy strategy, CancellationToken cancellationToken) at Elsa.Workflows.Runtime.Services.DefaultWorkflowInbox.SubmitAsync(NewWorkflowInboxMessage newMessage, WorkflowInboxMessageDeliveryParams params, CancellationToken cancellationToken) at Elsa.Workflows.Runtime.Services.EventPublisher.PublishInternalAsync(String eventName, Boolean dispatchAsynchronously, String correlationId, String workflowInstanceId, String activityInstanceId, Object payload, CancellationToken cancellationToken) at Elsa.Workflows.Runtime.Services.EventPublisher.PublishAsync(String eventName, String correlationId, String workflowInstanceId, String activityInstanceId, Object payload, CancellationToken cancellationToken) at Elsa.Workflows.Api.Endpoints.Events.TriggerPublic.Trigger.HandleAsync(CancellationToken cancellationToken) at FastEndpoints.Endpoint
2.ExecAsync(CancellationToken ct) at FastEndpoints.Endpoint2.ExecAsync(CancellationToken ct) at Elsa.Http.Middleware.HttpWorkflowsMiddleware.InvokeAsync(HttpContext httpContext, IServiceProvider serviceProvider) at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context) at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context) at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddlewareImpl.Invoke(HttpContext context) at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddlewareImpl.Invoke(HttpContext context) at Microsoft.WebTools.BrowserLink.Net.BrowserLinkMiddleware.InvokeAsync(HttpContext context) at Microsoft.AspNetCore.Watch.BrowserRefresh.BrowserRefreshMiddleware.InvokeAsync(HttpContext context) at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.ProcessRequests[TContext](IHttpApplication
1 application)