PluginDaemonInternalServerError: killed by timeout #14221

Closed
opened 2026-02-21 19:16:09 -05:00 by yindo · 3 comments
Owner

Originally created by @1609676823 on GitHub (May 27, 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

V1.4.1

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

[Question] Dify V1.4.1 (PluginDaemonInternalServerError: killed by timeout)?

I. Environment Information

  1. Dify Version: v1.4.1
  2. Deployment Method:
    • Local Docker deployment (using the official docker-compose.yaml)
  3. Error Phenomenon:
    During long conversations, the error Run failed: [tongyi] Error: PluginDaemonInternalServerError: killed by timeout occurs. It is confirmed that the server timed out and forcibly interrupted the process.
    I am using the qwen-turbo-latest (Qwen3) model.

II. Specific Questions

Core Request

I hope to avoid conversation interruption by setting a custom timeout. Please answer the following:

  1. Does Dify V1.4.1 support setting timeout via environment variables?
  2. Which specific environment variables need to be configured? (e.g., how to add them in .env)
  3. What are the default values and recommended adjustment ranges for each timeout parameter?

Image

✔️ Expected Behavior

I hope to avoid conversation interruption by setting a custom timeout. Please answer the following:

  1. Does Dify V1.4.1 support setting timeout via environment variables?
  2. Which specific environment variables need to be configured? (e.g., how to add them in .env)
  3. What are the default values and recommended adjustment ranges for each timeout parameter?

Actual Behavior

PluginDaemonInternalServerError: killed by timeout

Image

Originally created by @1609676823 on GitHub (May 27, 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 V1.4.1 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce # [Question] Dify V1.4.1 (PluginDaemonInternalServerError: killed by timeout)? ## I. Environment Information 1. **Dify Version**: v1.4.1 2. **Deployment Method**: - Local Docker deployment (using the official `docker-compose.yaml`) 3. **Error Phenomenon**: During long conversations, the error `Run failed: [tongyi] Error: PluginDaemonInternalServerError: killed by timeout` occurs. It is confirmed that the server timed out and forcibly interrupted the process. I am using the `qwen-turbo-latest` (Qwen3) model. ## II. Specific Questions ### Core Request I hope to avoid conversation interruption by setting a custom timeout. Please answer the following: 1. **Does Dify V1.4.1 support setting timeout via environment variables?** 2. **Which specific environment variables need to be configured?** (e.g., how to add them in `.env`) 3. **What are the default values and recommended adjustment ranges for each timeout parameter?** ![Image](https://github.com/user-attachments/assets/f5632a6b-74bf-4e87-9b8c-5d247f9c8be9) ### ✔️ Expected Behavior I hope to avoid conversation interruption by setting a custom timeout. Please answer the following: 1. **Does Dify V1.4.1 support setting timeout via environment variables?** 2. **Which specific environment variables need to be configured?** (e.g., how to add them in `.env`) 3. **What are the default values and recommended adjustment ranges for each timeout parameter?** ### ❌ Actual Behavior PluginDaemonInternalServerError: killed by timeout ![Image](https://github.com/user-attachments/assets/ad752c9b-3252-4ebd-bc46-18baf85ca6c8)
yindo added the 🐞 bug label 2026-02-21 19:16:09 -05:00
yindo closed this issue 2026-02-21 19:16:09 -05:00
Author
Owner

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

Yes, Dify V1.4.1 supports setting timeout values via environment variables. This can help you avoid conversation interruptions like the PluginDaemonInternalServerError: killed by timeout you are experiencing.

1. Supported Timeout Environment Variables

You can configure several timeout-related environment variables in your .env file:

  • API_TOOL_DEFAULT_CONNECT_TIMEOUT (default: 10 seconds)
  • API_TOOL_DEFAULT_READ_TIMEOUT (default: 60 seconds)
  • HTTP_REQUEST_MAX_READ_TIMEOUT (no default, set as needed)
  • HTTP_REQUEST_MAX_WRITE_TIMEOUT (no default, set as needed)
  • SSRF_DEFAULT_TIME_OUT, SSRF_DEFAULT_CONNECT_TIME_OUT, SSRF_DEFAULT_READ_TIME_OUT, SSRF_DEFAULT_WRITE_TIME_OUT (no defaults, set as needed)
  • TEXT_GENERATION_TIMEOUT_MS (default: 60000 milliseconds, i.e., 60 seconds)
  • GUNICORN_TIMEOUT (default: 200 seconds, recommended: 360 seconds for longer SSE connections)

2. How to Configure

Add the desired variables to your .env file, for example:

API_TOOL_DEFAULT_CONNECT_TIMEOUT=30
API_TOOL_DEFAULT_READ_TIMEOUT=120
HTTP_REQUEST_MAX_READ_TIMEOUT=600
HTTP_REQUEST_MAX_WRITE_TIMEOUT=600
SSRF_DEFAULT_TIME_OUT=120
SSRF_DEFAULT_CONNECT_TIME_OUT=60
SSRF_DEFAULT_READ_TIME_OUT=120
SSRF_DEFAULT_WRITE_TIME_OUT=120
TEXT_GENERATION_TIMEOUT_MS=120000
GUNICORN_TIMEOUT=360

After editing .env, restart your containers:

docker-compose down
docker-compose up -d

3. Default Values & Recommendations

  • API_TOOL_DEFAULT_CONNECT_TIMEOUT: 10 seconds (default)
  • API_TOOL_DEFAULT_READ_TIMEOUT: 60 seconds (default)
  • HTTP_REQUEST_MAX_READ_TIMEOUT / HTTP_REQUEST_MAX_WRITE_TIMEOUT: No default, but 600 seconds (10 minutes) is commonly used
  • TEXT_GENERATION_TIMEOUT_MS: 60000 ms (60 seconds, default)
  • GUNICORN_TIMEOUT: 200 seconds (default), 360 seconds recommended for long SSE connections

Timeout values are in seconds unless otherwise noted (e.g., TEXT_GENERATION_TIMEOUT_MS is in milliseconds). Adjust these values based on your workload and expected conversation length. These variables are not present in the default .env.example and must be added manually.

References:

If you need to support especially long conversations, increase these values accordingly. If you have a specific integration (like a plugin or external model), check if there are any hardcoded timeouts in the codebase for that integration.

To reply, just mention my name @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other  Join Discord Share on X

@dosubot[bot] commented on GitHub (May 27, 2025): <!-- Answer --> Yes, Dify V1.4.1 supports setting timeout values via environment variables. This can help you avoid conversation interruptions like the `PluginDaemonInternalServerError: killed by timeout` you are experiencing. **1. Supported Timeout Environment Variables** You can configure several timeout-related environment variables in your `.env` file: - `API_TOOL_DEFAULT_CONNECT_TIMEOUT` (default: 10 seconds) - `API_TOOL_DEFAULT_READ_TIMEOUT` (default: 60 seconds) - `HTTP_REQUEST_MAX_READ_TIMEOUT` (no default, set as needed) - `HTTP_REQUEST_MAX_WRITE_TIMEOUT` (no default, set as needed) - `SSRF_DEFAULT_TIME_OUT`, `SSRF_DEFAULT_CONNECT_TIME_OUT`, `SSRF_DEFAULT_READ_TIME_OUT`, `SSRF_DEFAULT_WRITE_TIME_OUT` (no defaults, set as needed) - `TEXT_GENERATION_TIMEOUT_MS` (default: 60000 milliseconds, i.e., 60 seconds) - `GUNICORN_TIMEOUT` (default: 200 seconds, recommended: 360 seconds for longer SSE connections) **2. How to Configure** Add the desired variables to your `.env` file, for example: ```env API_TOOL_DEFAULT_CONNECT_TIMEOUT=30 API_TOOL_DEFAULT_READ_TIMEOUT=120 HTTP_REQUEST_MAX_READ_TIMEOUT=600 HTTP_REQUEST_MAX_WRITE_TIMEOUT=600 SSRF_DEFAULT_TIME_OUT=120 SSRF_DEFAULT_CONNECT_TIME_OUT=60 SSRF_DEFAULT_READ_TIME_OUT=120 SSRF_DEFAULT_WRITE_TIME_OUT=120 TEXT_GENERATION_TIMEOUT_MS=120000 GUNICORN_TIMEOUT=360 ``` After editing `.env`, restart your containers: ```bash docker-compose down docker-compose up -d ``` **3. Default Values & Recommendations** - `API_TOOL_DEFAULT_CONNECT_TIMEOUT`: 10 seconds (default) - `API_TOOL_DEFAULT_READ_TIMEOUT`: 60 seconds (default) - `HTTP_REQUEST_MAX_READ_TIMEOUT` / `HTTP_REQUEST_MAX_WRITE_TIMEOUT`: No default, but 600 seconds (10 minutes) is commonly used - `TEXT_GENERATION_TIMEOUT_MS`: 60000 ms (60 seconds, default) - `GUNICORN_TIMEOUT`: 200 seconds (default), 360 seconds recommended for long SSE connections Timeout values are in seconds unless otherwise noted (e.g., `TEXT_GENERATION_TIMEOUT_MS` is in milliseconds). Adjust these values based on your workload and expected conversation length. These variables are not present in the default `.env.example` and must be added manually. **References:** - [Timeout variable usage in code](https://github.com/langgenius/dify/blob/main/api/core/tools/custom_tool/tool.py) - [Community guidance on HTTP request timeouts](https://github.com/langgenius/dify/issues/19376) - [List of supported timeout variables](https://github.com/langgenius/dify/issues/12880) - [TEXT_GENERATION_TIMEOUT_MS documentation](https://github.com/crazywoola/dify-docs-mintlify/blob/main/ja-jp/getting-started/install-self-hosted/environments.mdx) - [GUNICORN_TIMEOUT documentation](https://github.com/crazywoola/dify-docs-mintlify/blob/main/zh-hans/getting-started/install-self-hosted/environments.mdx) If you need to support especially long conversations, increase these values accordingly. If you have a specific integration (like a plugin or external model), check if there are any hardcoded timeouts in the codebase for that integration. <!-- Dosu Comment Footer --> *To reply, just mention my name [@dosu](https://go.dosu.dev/dosubot).* --- <sup>How did I do? [Good](https://app.dosu.dev/response-feedback/de1fd0a9-d0c0-40d9-959f-d273b18deb90?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/de1fd0a9-d0c0-40d9-959f-d273b18deb90?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/de1fd0a9-d0c0-40d9-959f-d273b18deb90?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/de1fd0a9-d0c0-40d9-959f-d273b18deb90?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/de1fd0a9-d0c0-40d9-959f-d273b18deb90?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/de1fd0a9-d0c0-40d9-959f-d273b18deb90?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/de1fd0a9-d0c0-40d9-959f-d273b18deb90?feedback_type=other)</sup>&nbsp;&nbsp;[![Join Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![Share on X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/langgenius/dify/issues/20305)
Author
Owner

@1609676823 commented on GitHub (May 27, 2025):

I all set 3600s, but also killed by timeout 0.0

@1609676823 commented on GitHub (May 27, 2025): I all set 3600s, but also killed by timeout 0.0
Author
Owner

@1609676823 commented on GitHub (May 27, 2025):

"It was inexplicably force-stopped after about five minutes, even though I had set a very long timeout."

@1609676823 commented on GitHub (May 27, 2025): "It was inexplicably force-stopped after about five minutes, even though I had set a very long timeout."
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#14221