I am working with elsa workflow framework in dotnet core. The first two steps in the workflow work fine. However in the third step, I am getting the error displayed in image ""Fault: Response has already started"". The sample flowchart image is . Thanks in advance
This happens when a response has already started. There are many reasons I can think of that would cause this, but from looking at your workflow, it's hard to see why.
One reason could be that you have multiple workflow instances in the system that are somehow being resumed at the same time. This happens when a workflow isn't correlated, and the signal being received triggers all of them. This would cause multiple attempts to write an HTTP response.
Another reason could be that there's a bug in Elsa 1. For that, you could submit an issue on GitHub with steps to reproduce the problem.
However, Elsa 1 is no longer being maintained, so you might want to consider migrating to Elsa 2.
Alternatively, if you (have to) stay with Elsa 1, you might consider cloning the source code and reference the projects directly and use the debugger to set breakpoints at various places to see where and why an HTTP response is started. This way, you are bound to find out that an HTTP response is written (could be a simple status code that is being set) from at least two places during the same request.
发布评论
评论(1)
当响应已经开始时会发生这种情况。我能想到导致这种情况的原因有很多,但是从您的工作流程来看,很难看出原因。
原因之一可能是系统中有多个工作流实例以某种方式同时恢复。当工作流程不相关并且接收到的信号触发所有工作流程时,就会发生这种情况。这将导致多次尝试写入 HTTP 响应。
另一个原因可能是 Elsa 1 中存在错误。为此,您可以在 GitHub 上提交问题,并提供重现该问题的步骤。
但是,Elsa 1 不再得到维护,因此您可能需要考虑迁移到 Elsa 2。
或者,如果您(必须)保留 Elsa 1,您可以考虑克隆源代码并直接引用项目并使用调试器在不同位置设置断点以查看 HTTP 响应的启动位置和原因。这样,您一定会发现在同一个请求期间至少有两个地方写入了 HTTP 响应(可能是正在设置的简单状态代码)。
This happens when a response has already started. There are many reasons I can think of that would cause this, but from looking at your workflow, it's hard to see why.
One reason could be that you have multiple workflow instances in the system that are somehow being resumed at the same time. This happens when a workflow isn't correlated, and the signal being received triggers all of them. This would cause multiple attempts to write an HTTP response.
Another reason could be that there's a bug in Elsa 1. For that, you could submit an issue on GitHub with steps to reproduce the problem.
However, Elsa 1 is no longer being maintained, so you might want to consider migrating to Elsa 2.
Alternatively, if you (have to) stay with Elsa 1, you might consider cloning the source code and reference the projects directly and use the debugger to set breakpoints at various places to see where and why an HTTP response is started. This way, you are bound to find out that an HTTP response is written (could be a simple status code that is being set) from at least two places during the same request.