Adjusted the 'timeout' in the plugin: Timeout (615.0, read=600.0, write=10.0, connect=5.0), 'max_detries': 1 parameter did not take effect #14042

Closed
opened 2026-02-21 19:15:15 -05:00 by yindo · 15 comments
Owner

Originally created by @kuku-jiusgan on GitHub (May 20, 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.1.3

Cloud or Self Hosted

Self Hosted (Source), Self Hosted (Docker)

Steps to reproduce

因为报错[openai api compatible] Error: PluginlnvokeError: {"args":h,"error type":"ConnectionError","message":"HTTPConnectionPool(host='10.0.0.111'port=10002): Read timed out."},所以我调整了插件中的"timeout": Timeout(615.0, read=600.0, write=10.0, connect=5.0),"max_retries": 1参数,但是运行后发现没有生效

✔️ Expected Behavior

Modify a parameter to extend the timeout of the plugin

Actual Behavior

No response

Originally created by @kuku-jiusgan on GitHub (May 20, 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.1.3 ### Cloud or Self Hosted Self Hosted (Source), Self Hosted (Docker) ### Steps to reproduce 因为报错[openai api compatible] Error: PluginlnvokeError: {"args":h,"error type":"ConnectionError","message":"HTTPConnectionPool(host='10.0.0.111'port=10002): Read timed out."},所以我调整了插件中的"timeout": Timeout(615.0, read=600.0, write=10.0, connect=5.0),"max_retries": 1参数,但是运行后发现没有生效 ### ✔️ Expected Behavior Modify a parameter to extend the timeout of the plugin ### ❌ Actual Behavior _No response_
yindo closed this issue 2026-02-21 19:15:15 -05:00
Author
Owner

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

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

To address the issue where the timeout and max_retries settings did not take effect, ensure that you have correctly configured these settings in the appropriate files. For Dify, timeout settings should be configured in the docker-compose.middleware.yaml file, not in middleware.env, as changes in middleware.env do not take effect [1][2].

Here's what you can do:

  1. Verify Configuration: Double-check that the timeout settings are correctly set in the docker-compose.middleware.yaml file. The configuration should look like this:

    PYTHON_ENV_INIT_TIMEOUT: ${PLUGIN_PYTHON_ENV_INIT_TIMEOUT:-60}
    PLUGIN_MAX_EXECUTION_TIMEOUT: ${PLUGIN_MAX_EXECUTION_TIMEOUT:-60}
    
  2. Restart Docker Containers: After making changes, restart the Docker containers to apply the new settings:

    docker compose stop
    docker compose up -d
    
  3. Check for Errors: Ensure there are no syntax errors or misconfigurations in your YAML files that might prevent the settings from being applied.

If the issue persists, consider checking the logs for any errors or messages that might indicate why the settings are not being applied.

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 20, 2025): <!-- Greeting --> Hello @954299714! I'm [Dosu](https://dosu.dev), a bot here to help you with bugs, answer questions, and guide you in becoming a contributor. I'm here to assist while you wait for a human maintainer. Let's tackle this together! <!-- Answer --> To address the issue where the timeout and max_retries settings did not take effect, ensure that you have correctly configured these settings in the appropriate files. For Dify, timeout settings should be configured in the `docker-compose.middleware.yaml` file, not in `middleware.env`, as changes in `middleware.env` do not take effect <sup>[[1]](https://github.com/langgenius/dify/issues/17384)</sup><sup>[[2]](https://github.com/langgenius/dify/issues/14718)</sup>. Here's what you can do: 1. **Verify Configuration**: Double-check that the timeout settings are correctly set in the `docker-compose.middleware.yaml` file. The configuration should look like this: ```yaml PYTHON_ENV_INIT_TIMEOUT: ${PLUGIN_PYTHON_ENV_INIT_TIMEOUT:-60} PLUGIN_MAX_EXECUTION_TIMEOUT: ${PLUGIN_MAX_EXECUTION_TIMEOUT:-60} ``` 2. **Restart Docker Containers**: After making changes, restart the Docker containers to apply the new settings: ```bash docker compose stop docker compose up -d ``` 3. **Check for Errors**: Ensure there are no syntax errors or misconfigurations in your YAML files that might prevent the settings from being applied. If the issue persists, consider checking the logs for any errors or messages that might indicate why the settings are not being applied. <!-- 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/520e544d-9e20-47b1-bdb6-2d79859770c5?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/520e544d-9e20-47b1-bdb6-2d79859770c5?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/520e544d-9e20-47b1-bdb6-2d79859770c5?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/520e544d-9e20-47b1-bdb6-2d79859770c5?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/520e544d-9e20-47b1-bdb6-2d79859770c5?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/520e544d-9e20-47b1-bdb6-2d79859770c5?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/520e544d-9e20-47b1-bdb6-2d79859770c5?feedback_type=other)</sup>
Author
Owner

@crazywoola commented on GitHub (May 20, 2025):

You need to recreate the container.

@crazywoola commented on GitHub (May 20, 2025): You need to recreate the container.
Author
Owner

@kuku-jiusgan commented on GitHub (May 20, 2025):

您需要重新创建容器。

I have executed the sudo docker-compose down up - d command and modified the TIMEOUT parameter in docker-compose. middleware. yaml, but it still prompts timeout after 300 seconds. I suspect that the problem is due to timeout configuration in the plugin (openai'api_compatible). Then I modified the timeout parameter in the common_openai. py file in the openai'api_compatible plugin, but it did not work in actual testing

@kuku-jiusgan commented on GitHub (May 20, 2025): > 您需要重新创建容器。 I have executed the sudo docker-compose down up - d command and modified the TIMEOUT parameter in docker-compose. middleware. yaml, but it still prompts timeout after 300 seconds. I suspect that the problem is due to timeout configuration in the plugin (openai'api_compatible). Then I modified the timeout parameter in the common_openai. py file in the openai'api_compatible plugin, but it did not work in actual testing
Author
Owner

@kuku-jiusgan commented on GitHub (May 20, 2025):

您需要重新创建容器。

我已经执行了 sudo docker-compose down up -d 命令,并修改了 docker-compose.middleware.yaml 中的 TIMEOUT 参数,但 300 秒后仍然提示超时。我怀疑是插件(openai_api_compatible)中的超时配置问题。之后我修改了 openai_api_compatible 插件中 common_openai.py 文件中的 timeout 参数,但实际测试中并没有起作用。

#14718 (评论) 试试看

I tried it but it didn't work. I even upgraded to version 1.4, deleted and recreated the volume of plugin_daemon, but in the end, it still reported an error within 300 seconds

Image

@kuku-jiusgan commented on GitHub (May 20, 2025): > > > 您需要重新创建容器。 > > > > > > 我已经执行了 sudo docker-compose down up -d 命令,并修改了 docker-compose.middleware.yaml 中的 TIMEOUT 参数,但 300 秒后仍然提示超时。我怀疑是插件(openai_api_compatible)中的超时配置问题。之后我修改了 openai_api_compatible 插件中 common_openai.py 文件中的 timeout 参数,但实际测试中并没有起作用。 > > [#14718 (评论)](https://github.com/langgenius/dify/issues/14718#issuecomment-2893075078) 试试看 I tried it but it didn't work. I even upgraded to version 1.4, deleted and recreated the volume of plugin_daemon, but in the end, it still reported an error within 300 seconds ![Image](https://github.com/user-attachments/assets/f5d93a49-c394-4957-89cb-edbe8b53e8d5)
Author
Owner

@kuku-jiusgan commented on GitHub (May 20, 2025):

Image
The file configuration in the plugin has been modified to 600S

@kuku-jiusgan commented on GitHub (May 20, 2025): ![Image](https://github.com/user-attachments/assets/12d2d63c-66c5-45f6-9aa3-56ccf308fb82) The file configuration in the plugin has been modified to 600S
Author
Owner

@kuku-jiusgan commented on GitHub (May 20, 2025):

@crazywoola I have upgraded dify, pulled the image again and created the container, but it still prompts timeout。Thank you very much for your help

@kuku-jiusgan commented on GitHub (May 20, 2025): @crazywoola I have upgraded dify, pulled the image again and created the container, but it still prompts timeout。Thank you very much for your help
Author
Owner

@Cweixiao commented on GitHub (May 21, 2025):

@kuku-jiusgan I'm also facing this issue. I've made the same modifications you did, including changes to the .env file and docker-compose. I've also run the openai-api plugin myself and adjusted the timeout settings, but it still isn't working. Have you resolved this problem now?

@Cweixiao commented on GitHub (May 21, 2025): @kuku-jiusgan I'm also facing this issue. I've made the same modifications you did, including changes to the .env file and docker-compose. I've also run the openai-api plugin myself and adjusted the timeout settings, but it still isn't working. Have you resolved this problem now?
Author
Owner

@kuku-jiusgan commented on GitHub (May 21, 2025):

@Cweixiao I didn't solve this problem, it shouldn't be a plugin issue. I think it was caused by timeout configuration in the API service

@kuku-jiusgan commented on GitHub (May 21, 2025): @Cweixiao I didn't solve this problem, it shouldn't be a plugin issue. I think it was caused by timeout configuration in the API service
Author
Owner

@kuku-jiusgan commented on GitHub (May 21, 2025):

@Cweixiao 我解决了,这个问题应该是插件开发工具在打包插件时,默认了300秒,修改docker挂在的卷文件 llm.py,修改成3000就可以了

@kuku-jiusgan commented on GitHub (May 21, 2025): @Cweixiao 我解决了,这个问题应该是插件开发工具在打包插件时,默认了300秒,修改docker挂在的卷文件 llm.py,修改成3000就可以了
Author
Owner

@jiyif11 commented on GitHub (Jun 17, 2025):

@kuku-jiusgan llm.py 文件是openapi插件的还是dify的?openapi中llm.py并没有时间参数

@jiyif11 commented on GitHub (Jun 17, 2025): @kuku-jiusgan llm.py 文件是openapi插件的还是dify的?openapi中llm.py并没有时间参数
Author
Owner

@Jimmy-L99 commented on GitHub (Jul 14, 2025):

@kuku-jiusgan 老哥怎么改的,能详细说下么

@Jimmy-L99 commented on GitHub (Jul 14, 2025): @kuku-jiusgan 老哥怎么改的,能详细说下么
Author
Owner

@Mr-Yu-95 commented on GitHub (Aug 8, 2025):

@Jimmy-L99 @jiyif11 兄弟,知道怎么修改了么

@Mr-Yu-95 commented on GitHub (Aug 8, 2025): @Jimmy-L99 @jiyif11 兄弟,知道怎么修改了么
Author
Owner

@jiyif11 commented on GitHub (Aug 8, 2025):

@Mr-Yu-95 还是不知道

@jiyif11 commented on GitHub (Aug 8, 2025): @Mr-Yu-95 还是不知道
Author
Owner

@dadaBubbleGum commented on GitHub (Sep 18, 2025):

我也是这个问题,插件的common_openai.py的timeout修改不生效

@dadaBubbleGum commented on GitHub (Sep 18, 2025): 我也是这个问题,插件的common_openai.py的timeout修改不生效
Author
Owner

@kuku-jiusgan commented on GitHub (Sep 22, 2025):

可以参考以上内容解决

万里明月
@.***

@kuku-jiusgan commented on GitHub (Sep 22, 2025): 可以参考以上内容解决 万里明月 ***@***.***
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#14042