Closed aute closed 7 months ago
Hey @aute, long time no debug! Hope you're ready to untangle some code spaghetti with me again. 🍝
To resolve the issue in Dify version 0.6.0 where configuring a Directed Cyclic Graph (DAG) within a workflow causes the system to crash in a self-hosted Docker environment, you can follow these steps:
Ensure Compatibility: First, make sure that your Docker and Docker Compose versions meet the prerequisites mentioned in the Docker Compose Deployment guide. Dify requires Docker 19.03 or later and Docker Compose 1.25.1 or later for Linux platforms, and appropriate versions for macOS and Windows with WSL 2 enabled.
Check for Updates: The issue might have been recognized and fixed in a newer version, so it's crucial to check if there's an update available for Dify. You can do this by pulling the latest changes from the Dify repository and updating your Docker containers. Use the following commands:
cd dify/docker
git pull origin main
docker compose down
docker compose pull
docker compose up -d
This ensures you have the latest version of Dify, which might include a fix for the issue.
Review JavaScript Console and Network Logs: Since the crash results in a JavaScript application error in the browser console, closely examine the error message and stack trace for clues about the failure. JavaScript errors often point directly to the problematic code or give hints about what went wrong. Additionally, check the network tab in your browser's developer tools for failed network requests that might indicate backend issues.
Report the Issue: If after updating Dify the problem persists, consider reporting the issue to the Dify developers. Include detailed information about your Docker environment, the steps to reproduce the issue, and any relevant logs or error messages from both the browser console and Docker logs. This can help the developers diagnose and address the issue more effectively.
Temporary Workaround: As a temporary workaround, avoid configuring Directed Cyclic Graphs within workflows if possible, until a fix is released. If your workflow absolutely requires a DAG configuration, consider setting up a development environment outside Docker for this specific purpose, though this might not be ideal or feasible in all cases.
Remember, software environments and dependencies are constantly evolving, so staying updated can be key to resolving such issues.
It should be fixed in the latest preview.2.
@crazywoola cloud.dify.ai With this configuration, the page still crashes
DSL:
app:
description: ''
icon: "\U0001F916"
icon_background: '#FFEAD5'
mode: advanced-chat
name: "\u5DE5\u4F5C\u6D41\u6D4B\u8BD5"
workflow:
features:
file_upload:
image:
enabled: false
number_limits: 3
transfer_methods:
- local_file
- remote_url
opening_statement: ''
retriever_resource:
enabled: false
sensitive_word_avoidance:
enabled: false
speech_to_text:
enabled: false
suggested_questions: []
suggested_questions_after_answer:
enabled: false
text_to_speech:
enabled: false
language: ''
voice: ''
graph:
edges:
- data:
sourceType: llm
targetType: answer
id: llm-answer
source: llm
sourceHandle: source
target: answer
targetHandle: target
type: custom
- data:
sourceType: answer
targetType: llm
id: answer-1712631599229
source: answer
sourceHandle: source
target: '1712631599229'
targetHandle: target
type: custom
- data:
sourceType: llm
targetType: llm
id: 1712631599229-llm
source: '1712631599229'
sourceHandle: source
target: llm
targetHandle: target
type: custom
nodes:
- data:
desc: ''
selected: false
title: "\u5F00\u59CB"
type: start
variables: []
height: 54
id: '1712631571094'
position:
x: 80
y: 282
positionAbsolute:
x: 80
y: 282
selected: false
sourcePosition: right
targetPosition: left
type: custom
width: 244
- data:
context:
enabled: false
variable_selector: []
desc: ''
memory:
window:
enabled: false
size: 10
model:
completion_params:
temperature: 0.7
mode: chat
name: ''
provider: ''
prompt_template:
- role: system
text: ''
selected: false
title: LLM
type: llm
variables: []
vision:
enabled: false
height: 54
id: llm
position:
x: 380
y: 282
positionAbsolute:
x: 380
y: 282
selected: false
sourcePosition: right
targetPosition: left
type: custom
width: 244
- data:
answer: '{{#llm.text#}}'
desc: ''
selected: false
title: "\u76F4\u63A5\u56DE\u590D"
type: answer
variables: []
height: 107
id: answer
position:
x: 680
y: 282
positionAbsolute:
x: 680
y: 282
selected: false
sourcePosition: right
targetPosition: left
type: custom
width: 244
- data:
context:
enabled: false
variable_selector: []
desc: ''
model:
completion_params:
frequency_penalty: 0
max_tokens: 512
presence_penalty: 0
temperature: 0.7
top_p: 1
mode: chat
name: gpt-4
provider: openai
prompt_template:
- role: system
text: '{{#sys.query#}}
{{#llm.text#}}
'
selected: true
title: LLM 2
type: llm
variables: []
vision:
enabled: false
height: 98
id: '1712631599229'
position:
x: 980
y: 282
positionAbsolute:
x: 980
y: 282
selected: true
sourcePosition: right
targetPosition: left
type: custom
width: 244
viewport:
x: -107.42682239454302
y: 174.42779870390524
zoom: 0.7659653705592298
It should be fixed in the latest preview.2.
Actually, this issue still exists in main branch with default configuration and cloud.dify.ai. Is it solved in any branch?
It should be fixed in the latest preview.2.
I can still find this problem? Is there any fix way?
Self Checks
Dify version
0.6.0
Cloud or Self Hosted
Self Hosted (Docker)
Steps to reproduce
I can configure a Directed Cyclic Graph in the workflow.
But it won't function properly and will cause the page to crash.
✔️ Expected Behavior
Expected Behavior: The system should support Directed Cyclic Graphs and function properly; Fallback solution: Prohibit the configuration of Directed Cyclic Graphs during setup.
❌ Actual Behavior
Directed Cyclic Graph configurations can be made, but they do not function properly and lead to page crashes.