help! The iteration node reports an error in parallel mode, but it runs normally in serial mode. #26215
Replies: 1 comment
-
This is a known bug in Dify 1.9.0: when you use an LLM node inside an iteration node with parallel mode enabled, you get the "Working outside of application context" error because Flask's app context isn't available in parallel threads or processes. You can fix this by either upgrading to a newer Dify version (the bug is resolved in later releases), or downgrading to 1.8.1 if you need an immediate workaround. If you are modifying code, wrap your parallel execution logic like this: with flask_app.app_context():
# your parallel execution logic here See this issue for details and solutions. To reply, just mention @dosu. How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Self Checks
Content
My iteration node only contains an LLM node. When parallel mode is not enabled, it can run normally. However, after enabling parallel mode, the following error is reported:
"""
Run failed: Working outside of application context.
This typically means that you attempted to use functionality that needed
the current application. To solve this, set up an application context
with app.app_context(). See the documentation for more information.
"""
I don't know where to set the app_context, and I haven't found a solution in the documentation. Seeking advice from experts!
Beta Was this translation helpful? Give feedback.
All reactions