AI cannot perform streaming output #13659

Closed
opened 2026-02-21 19:13:12 -05:00 by yindo · 11 comments
Owner

Originally created by @wbext on GitHub (May 7, 2025).

Self Checks

  • This is only for bug report, if you would like to ask a question, please head to Discussions.
  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
  • [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

1.2.0

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

Unlike the issues of other users, I simply used the LLM module in the workflow canvas to output the content of the AI's response. However, the result is that the AI cannot display the streaming output but shows the blocking output. There is another problem: during the operation of the workflow, the canvas view does not follow the module that is currently running, which is very abnormal and quite different from Dify in the cloud.The following screenshot shows the situation of the AI's output. It neither has streaming output, nor does it display the running status of the workflow during the AI's output process (I have already enabled the function to display the running status of the workflow).

Image

✔️ Expected Behavior

My anticipated situation is that the streaming output can be successfully achieved, and the running status of the workflow can be displayed during the AI's output process.

Actual Behavior

No response

Originally created by @wbext on GitHub (May 7, 2025). ### Self Checks - [x] This is only for bug report, if you would like to ask a question, please head to [Discussions](https://github.com/langgenius/dify/discussions/categories/general). - [x] I have searched for existing issues [search for existing issues](https://github.com/langgenius/dify/issues), including closed ones. - [x] I confirm that I am using English to submit this report (我已阅读并同意 [Language Policy](https://github.com/langgenius/dify/issues/1542)). - [x] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:) - [x] Please do not modify this template :) and fill in all the required fields. ### Dify version 1.2.0 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce Unlike the issues of other users, I simply used the LLM module in the workflow canvas to output the content of the AI's response. However, the result is that the AI cannot display the streaming output but shows the blocking output. There is another problem: during the operation of the workflow, the canvas view does not follow the module that is currently running, which is very abnormal and quite different from Dify in the cloud.The following screenshot shows the situation of the AI's output. It neither has streaming output, nor does it display the running status of the workflow during the AI's output process (I have already enabled the function to display the running status of the workflow). <img width="813" alt="Image" src="https://github.com/user-attachments/assets/1e8db476-4209-4a79-b6cc-3f36d52851ff" /> ### ✔️ Expected Behavior My anticipated situation is that the streaming output can be successfully achieved, and the running status of the workflow can be displayed during the AI's output process. ### ❌ Actual Behavior _No response_
yindo added the 🐞 bug label 2026-02-21 19:13:12 -05:00
yindo closed this issue 2026-02-21 19:13:12 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (May 7, 2025):

Hello @wbext! I'm Dosu, a friendly bot here to help you with bugs, answer questions, and assist you in becoming a contributor. I'm here while you wait for a human maintainer. Let’s tackle this together!

I found some relevant information regarding streaming output issues in Dify's self-hosted environment:

  1. Known Limitations: In Dify v1.0.1, there is a known bug where streaming output fails when there are nodes with exception handling settings in the chat flow. This issue is expected to be fixed in a future version, and currently, there is no workaround available for version 1.0.1 [1]. However, a similar issue in Dify v1.0.0 was fixed in version 1.1.3, where streaming now works correctly with Fail Branch error handling enabled [2].

  2. Configuration Requirements: To enable streaming output, ensure that your .env file is properly configured with timeout settings. Example values include:

    • HTTP_REQUEST_MAX_READ_TIMEOUT=600
    • HTTP_REQUEST_MAX_WRITE_TIMEOUT=600
      These settings help prevent interruptions in streaming output [3].
  3. Troubleshooting: If you experience streaming output issues, check if conditional branches are used in your workflow. Workflows with conditional branches cannot stream output, and using a variable aggregator after conditional branches might help [4].

  4. Module Execution Tracking: The workflow canvas should display the running status of modules. Ensure that the settings controlling these displays, such as showRunningBorder, showSuccessBorder, showFailedBorder, and showExceptionBorder, are correctly configured [5][6].

If these suggestions do not resolve your issue, consider checking for updates or patches that might address streaming output problems in newer versions of Dify.

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other

@dosubot[bot] commented on GitHub (May 7, 2025): <!-- Greeting --> Hello @wbext! I'm [Dosu](https://dosu.dev), a friendly bot here to help you with bugs, answer questions, and assist you in becoming a contributor. I'm here while you wait for a human maintainer. Let’s tackle this together! <!-- Answer --> I found some relevant information regarding streaming output issues in Dify's self-hosted environment: 1. **Known Limitations**: In Dify v1.0.1, there is a known bug where streaming output fails when there are nodes with exception handling settings in the chat flow. This issue is expected to be fixed in a future version, and currently, there is no workaround available for version 1.0.1 <sup>[[1]](https://github.com/langgenius/dify/issues/16004)</sup>. However, a similar issue in Dify v1.0.0 was fixed in version 1.1.3, where streaming now works correctly with Fail Branch error handling enabled <sup>[[2]](https://github.com/langgenius/dify/issues/14997)</sup>. 2. **Configuration Requirements**: To enable streaming output, ensure that your `.env` file is properly configured with timeout settings. Example values include: - `HTTP_REQUEST_MAX_READ_TIMEOUT=600` - `HTTP_REQUEST_MAX_WRITE_TIMEOUT=600` These settings help prevent interruptions in streaming output <sup>[[3]](https://github.com/langgenius/dify/issues/14416)</sup>. 3. **Troubleshooting**: If you experience streaming output issues, check if conditional branches are used in your workflow. Workflows with conditional branches cannot stream output, and using a variable aggregator after conditional branches might help <sup>[[4]](https://github.com/langgenius/dify/issues/14010)</sup>. 4. **Module Execution Tracking**: The workflow canvas should display the running status of modules. Ensure that the settings controlling these displays, such as `showRunningBorder`, `showSuccessBorder`, `showFailedBorder`, and `showExceptionBorder`, are correctly configured <sup>[[5]](https://github.com/langgenius/dify/blob/main/web/app/components/workflow/run/status.tsx)</sup><sup>[[6]](https://github.com/langgenius/dify/blob/main/web/app/components/workflow/run/node.tsx)</sup>. If these suggestions do not resolve your issue, consider checking for updates or patches that might address streaming output problems in newer versions of Dify. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.* --- <sup>Help Dosu learn! Give it feedback: [Great Response](https://app.dosu.dev/response-feedback/83f2be6f-5b75-482f-b187-fbca2f24aac8?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/83f2be6f-5b75-482f-b187-fbca2f24aac8?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/83f2be6f-5b75-482f-b187-fbca2f24aac8?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/83f2be6f-5b75-482f-b187-fbca2f24aac8?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/83f2be6f-5b75-482f-b187-fbca2f24aac8?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/83f2be6f-5b75-482f-b187-fbca2f24aac8?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/83f2be6f-5b75-482f-b187-fbca2f24aac8?feedback_type=other)</sup>
Author
Owner

@LeeeeeeM commented on GitHub (May 7, 2025):

Dev or production environment?

https://github.com/langgenius/dify/discussions/19129

U should config your nginx if it's production env

@wbext

@LeeeeeeM commented on GitHub (May 7, 2025): Dev or production environment? https://github.com/langgenius/dify/discussions/19129 U should config your nginx if it's production env @wbext
Author
Owner

@Moiyu1998 commented on GitHub (May 7, 2025):

For all of my models, I’m unable to get streaming output, whether in chat mode or text generation mode. Are you experiencing the same situation?

@Moiyu1998 commented on GitHub (May 7, 2025): For all of my models, I’m unable to get streaming output, whether in chat mode or text generation mode. Are you experiencing the same situation?
Author
Owner

@wbext commented on GitHub (May 7, 2025):

开发环境还是生产环境?

#19129

如果是生产环境,您应该配置您的 nginx

@wbext

It is indeed a production environment. Do you think that insufficient network configuration leads to the inability of streaming output?

@wbext commented on GitHub (May 7, 2025): > 开发环境还是生产环境? > > [#19129](https://github.com/langgenius/dify/discussions/19129) > > 如果是生产环境,您应该配置您的 nginx > > [@wbext](https://github.com/wbext) It is indeed a production environment. Do you think that insufficient network configuration leads to the inability of streaming output?
Author
Owner

@wbext commented on GitHub (May 7, 2025):

对于我的所有模型,我都无法获得流式输出,无论是在聊天模式还是文本生成模式下。您是否遇到同样的情况?

对于我的所有模型,我都无法获得流式输出,无论是在聊天模式还是文本生成模式下。您是否遇到同样的情况?

Yes, I can't perform streaming output in all modes, which is the same as your situation.

@wbext commented on GitHub (May 7, 2025): > 对于我的所有模型,我都无法获得流式输出,无论是在聊天模式还是文本生成模式下。您是否遇到同样的情况? > 对于我的所有模型,我都无法获得流式输出,无论是在聊天模式还是文本生成模式下。您是否遇到同样的情况? Yes, I can't perform streaming output in all modes, which is the same as your situation.
Author
Owner

@Moiyu1998 commented on GitHub (May 7, 2025):

It does seem to be a bug. I have reported this issue in the dify-official-plugins code repository as well, but no one has addressed it yet.

@Moiyu1998 commented on GitHub (May 7, 2025): It does seem to be a bug. I have reported this issue in the dify-official-plugins code repository as well, but no one has addressed it yet.
Author
Owner

@wbext commented on GitHub (May 8, 2025):

It does seem to be a bug. I have reported this issue in the dify-official-plugins code repository as well, but no one has addressed it yet.

I've found the problem. The original Nginx configuration file supported caching but not Server-Sent Events (SSE) configuration. As a result, the messages were cached and only output after the response was completed. Here are the changes I made to the Nginx configuration file:

Image
@wbext commented on GitHub (May 8, 2025): > It does seem to be a bug. I have reported this issue in the dify-official-plugins code repository as well, but no one has addressed it yet. I've found the problem. The original Nginx configuration file supported caching but not Server-Sent Events (SSE) configuration. As a result, the messages were cached and only output after the response was completed. Here are the changes I made to the Nginx configuration file: <img width="522" alt="Image" src="https://github.com/user-attachments/assets/28fc9376-f12f-4297-aa05-ab3c359ee28e" />
Author
Owner

@LeeeeeeM commented on GitHub (May 8, 2025):

It does seem to be a bug. I have reported this issue in the dify-official-plugins code repository as well, but no one has addressed it yet.

I've found the problem. The original Nginx configuration file supported caching but not Server-Sent Events (SSE) configuration. As a result, the messages were cached and only output after the response was completed. Here are the changes I made to the Nginx configuration file:

Image

@wbext yeah, u got it.

@LeeeeeeM commented on GitHub (May 8, 2025): > > It does seem to be a bug. I have reported this issue in the dify-official-plugins code repository as well, but no one has addressed it yet. > > I've found the problem. The original Nginx configuration file supported caching but not Server-Sent Events (SSE) configuration. As a result, the messages were cached and only output after the response was completed. Here are the changes I made to the Nginx configuration file: > > <img alt="Image" width="522" src="https://private-user-images.githubusercontent.com/134917942/441580075-28fc9376-f12f-4297-aa05-ab3c359ee28e.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NDY2OTI1OTUsIm5iZiI6MTc0NjY5MjI5NSwicGF0aCI6Ii8xMzQ5MTc5NDIvNDQxNTgwMDc1LTI4ZmM5Mzc2LWYxMmYtNDI5Ny1hYTA1LWFiM2MzNTllZTI4ZS5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwNTA4JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDUwOFQwODE4MTVaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT0wZmE4ODlkNWU0NDQwNjkwNTEwZDVkM2VhNjA2NzViNjQwMDg5NzZlYzI0ZDljZTk3YmQzYzYyYWU5NGM5MDQwJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.tTcOni7kTy31H4rJsmqcx8r-QxcmXMif89idttJbXeQ"> @wbext yeah, u got it.
Author
Owner

@Moiyu1998 commented on GitHub (May 8, 2025):

@wbext May I ask which file you modified? Also, could I see a complete screenshot of the entire file content?

@Moiyu1998 commented on GitHub (May 8, 2025): @wbext May I ask which file you modified? Also, could I see a complete screenshot of the entire file content?
Author
Owner

@wbext commented on GitHub (May 8, 2025):

请问您修改了哪个文件?另外,我可以看到整个文件内容的完整屏幕截图吗?

If you are on a Linux server and deploying Dify locally using Docker, you should modify the code in the configuration file of the Nginx server. The path of this configuration file is generally in etc/nginx/conf.d. This file is not included in the Dify source code files. It comes with the Nginx server.

@wbext commented on GitHub (May 8, 2025): > 请问您修改了哪个文件?另外,我可以看到整个文件内容的完整屏幕截图吗? If you are on a Linux server and deploying Dify locally using Docker, you should modify the code in the configuration file of the Nginx server. The path of this configuration file is generally in etc/nginx/conf.d. This file is not included in the Dify source code files. It comes with the Nginx server.
Author
Owner

@dosubot[bot] commented on GitHub (Aug 30, 2025):

Hi, @wbext. I'm Dosu, and I'm helping the Dify team manage their backlog and am marking this issue as stale.

Issue Summary:

  • You reported that in Dify v1.2.0 self-hosted via Docker, AI responses did not stream and the workflow canvas did not track running modules.
  • Troubleshooting included checking conditional branches, timeout settings, and Nginx configuration suggestions.
  • You identified the root cause as missing Server-Sent Events (SSE) support in the Nginx config causing caching and delayed output.
  • Modifying the Nginx configuration to support SSE resolved the streaming issue.
  • The fix requires editing the Nginx config file outside of the Dify source code.

Next Steps:

  • Please confirm if this issue remains relevant with the latest version of Dify; if so, feel free to comment to keep the discussion open.
  • Otherwise, I will automatically close this issue in 15 days.

Thank you for your understanding and contribution!

@dosubot[bot] commented on GitHub (Aug 30, 2025): Hi, @wbext. I'm [Dosu](https://dosu.dev), and I'm helping the Dify team manage their backlog and am marking this issue as stale. **Issue Summary:** - You reported that in Dify v1.2.0 self-hosted via Docker, AI responses did not stream and the workflow canvas did not track running modules. - Troubleshooting included checking conditional branches, timeout settings, and Nginx configuration suggestions. - You identified the root cause as missing Server-Sent Events (SSE) support in the Nginx config causing caching and delayed output. - Modifying the Nginx configuration to support SSE resolved the streaming issue. - The fix requires editing the Nginx config file outside of the Dify source code. **Next Steps:** - Please confirm if this issue remains relevant with the latest version of Dify; if so, feel free to comment to keep the discussion open. - Otherwise, I will automatically close this issue in 15 days. Thank you for your understanding and contribution!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#13659