dify icon indicating copy to clipboard operation
dify copied to clipboard

Unable to configure the API

Open 188zhuyaqi opened this issue 9 months ago • 56 comments

Self Checks

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

Dify version

1.0.0

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

My system is Linux and I installed Dify version 1.0.0. All the processes went smoothly until the time came to configure the model API. At that moment, the system got stuck at the save prompt window and remained stuck without reporting any error messages. It just kept hanging until the browser console output a request timeout message. Apart from this, there were no other information.

Uncaught (in promise) TimeoutError: Request timed out: POST http://150.158.xx.xxx:8080/console/api/workspaces/current/model-providers/langgenius/tongyi/tongyi
    at 3451-f3b01e497296e6f6.js:1:4366

(I have processed the IP here. If you need to test it, I can provide it to you.)

Image

Image

I myself have eliminated many issues. For instance, I tried two different browsers, including Edge. I uninstalled and reinstalled it five times but still encountered the same problem. Later, I downloaded version 0.15.3 and found that it worked successfully just once. Although it took a while to save the page, it was still successful. Then I switched back to version 1.0.0 (here, the version I switched to is not upgrading from 0.15.3. I deployed two versions). After switching back to version 1.0.0, I configured it again. This time, it was surprisingly successful. Just as I was happy, I found that when configuring other APIs, the same problem occurred again. I really don't understand why this is happening. I can only ask you for help helplessly. This issue pertains to all API configurations being like this, not just a single one.

Image Image

✔️ Expected Behavior

No response

❌ Actual Behavior

Uncaught (in promise) TimeoutError: Request timed out: POST http://150.158.xx.xxx:8080/console/api/workspaces/current/model-providers/langgenius/tongyi/tongyi at 3451-f3b01e497296e6f6.js:1:4366

188zhuyaqi avatar Mar 02 '25 06:03 188zhuyaqi

Hello @188zhuyaqi! I'm here to assist you with any bugs, questions, or contributions you have regarding Dify. Let's work together to solve the issue you're experiencing.

I found a similar unsolved discussion regarding a "request timed out" issue when saving the model in Dify [1]. Additionally, there is an open issue titled "add model failed" that might be related [2].

To address the "TimeoutError" when configuring the model API in Dify version 1.0.0 on a self-hosted Linux system, you can try the following steps:

  1. Restart Docker Containers: Use the following commands to restart the Docker containers:

    docker compose stop
    docker compose up -d
    
  2. Adjust Gunicorn Timeout: Increase the GUNICORN_TIMEOUT setting to allow for longer request processing times. The default is 200 seconds, but it is recommended to set it to 360 seconds to support longer SSE connection times. You can do this by setting the environment variable in your Docker configuration:

    GUNICORN_TIMEOUT=360
    
  3. Check Network Proxy Settings: If you are in a region with restricted access to certain services like OpenAI or HuggingFace, ensure that your HTTP and HTTPS proxy settings are correctly configured. Use the internal Docker host address if the proxy is deployed on the host machine [3].

These steps should help resolve the timeout issue and improve the configuration process for the model API.

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] avatar Mar 02 '25 06:03 dosubot[bot]

Docker has been rebooted and reinstalled no less than 5 times My GUNICORN_TIMEOUT parameter is already 360 but the problem still occurs, The model services I have configured do not require the use of proxies

188zhuyaqi avatar Mar 02 '25 06:03 188zhuyaqi

me too

lisontowind avatar Mar 02 '25 07:03 lisontowind

Hello @188zhuyaqi! I'm here to assist you with any bugs, questions, or contributions you have regarding Dify. Let's work together to solve the issue you're experiencing.

I found a similar unsolved discussion regarding a "request timed out" issue when saving the model in Dify [1]. Additionally, there is an open issue titled "add model failed" that might be related [2].

To address the "TimeoutError" when configuring the model API in Dify version 1.0.0 on a self-hosted Linux system, you can try the following steps:

  1. Restart Docker Containers: Use the following commands to restart the Docker containers: docker compose stop docker compose up -d
  2. Adjust Gunicorn Timeout: Increase the GUNICORN_TIMEOUT setting to allow for longer request processing times. The default is 200 seconds, but it is recommended to set it to 360 seconds to support longer SSE connection times. You can do this by setting the environment variable in your Docker configuration: GUNICORN_TIMEOUT=360
  3. Check Network Proxy Settings: If you are in a region with restricted access to certain services like OpenAI or HuggingFace, ensure that your HTTP and HTTPS proxy settings are correctly configured. Use the internal Docker host address if the proxy is deployed on the host machine [3].

These steps should help resolve the timeout issue and improve the configuration process for the model API.

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

@dosu After "Restart Docker Containers", encounter INTERNAL SERVER ERROR, can't save API Key setting. Edge browser console log: POST http://localhost/console/api/workspaces/current/model-providers/langgenius/siliconflow/siliconflow 500 (INTERNAL SERVER ERROR)

rosenjiang avatar Mar 02 '25 08:03 rosenjiang

Hello @188zhuyaqi! I'm here to assist you with any bugs, questions, or contributions you have regarding Dify. Let's work together to solve the issue you're experiencing. I found a similar unsolved discussion regarding a "request timed out" issue when saving the model in Dify [1]. Additionally, there is an open issue titled "add model failed" that might be related [2]. To address the "TimeoutError" when configuring the model API in Dify version 1.0.0 on a self-hosted Linux system, you can try the following steps:

  1. Restart Docker Containers: Use the following commands to restart the Docker containers: docker compose stop docker compose up -d
  2. Adjust Gunicorn Timeout: Increase the GUNICORN_TIMEOUT setting to allow for longer request processing times. The default is 200 seconds, but it is recommended to set it to 360 seconds to support longer SSE connection times. You can do this by setting the environment variable in your Docker configuration: GUNICORN_TIMEOUT=360
  3. Check Network Proxy Settings: If you are in a region with restricted access to certain services like OpenAI or HuggingFace, ensure that your HTTP and HTTPS proxy settings are correctly configured. Use the internal Docker host address if the proxy is deployed on the host machine [3].

These steps should help resolve the timeout issue and improve the configuration process for the model API. 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

@dosu After "Restart Docker Containers", encounter INTERNAL SERVER ERROR, can't save API Key setting. Edge browser console log: POST http://localhost/console/api/workspaces/current/model-providers/langgenius/siliconflow/siliconflow 500 (INTERNAL SERVER ERROR)

I've got the same issue here, seemed that can't save the api-key in v1.0.0.

JasonkayZK avatar Mar 02 '25 09:03 JasonkayZK

To resolve the "INTERNAL SERVER ERROR" when saving the API Key setting in Dify, try restarting your Dify instance. This has been confirmed to resolve similar issues. Additionally, check the logs of the 'api' container for more insights into the error. You can do this using the command:

docker-compose logs api

This might provide more information on the cause of the error and help in diagnosing the issue further [1][2].

This is a tough nut to crack, could really use your help on this, @takatost.

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] avatar Mar 02 '25 09:03 dosubot[bot]

To resolve the "INTERNAL SERVER ERROR" when saving the API Key setting in Dify, try restarting your Dify instance. This has been confirmed to resolve similar issues. Additionally, check the logs of the 'api' container for more insights into the error. You can do this using the command:

docker-compose logs api This might provide more information on the cause of the error and help in diagnosing the issue further [1][2].

This is a tough nut to crack, could really use your help on this, @takatost.

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

pi-1 | File "/app/api/.venv/lib/python3.12/site-packages/flask/app.py", line 917, in full_dispatch_request api-1 | rv = self.dispatch_request() api-1 | ^^^^^^^^^^^^^^^^^^^^^^^ api-1 | File "/app/api/.venv/lib/python3.12/site-packages/flask/app.py", line 902, in dispatch_request api-1 | return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args) # type: ignore[no-any-return] api-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ api-1 | File "/app/api/.venv/lib/python3.12/site-packages/flask_restful/init.py", line 489, in wrapper api-1 | resp = resource(*args, **kwargs) api-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^ api-1 | File "/app/api/.venv/lib/python3.12/site-packages/flask/views.py", line 110, in view api-1 | return current_app.ensure_sync(self.dispatch_request)(**kwargs) # type: ignore[no-any-return] api-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ api-1 | File "/app/api/.venv/lib/python3.12/site-packages/flask_restful/init.py", line 604, in dispatch_request api-1 | resp = meth(*args, **kwargs) api-1 | ^^^^^^^^^^^^^^^^^^^^^ api-1 | File "/app/api/controllers/console/wraps.py", line 147, in decorated api-1 | return view(*args, **kwargs) api-1 | ^^^^^^^^^^^^^^^^^^^^^ api-1 | File "/app/api/libs/login.py", line 94, in decorated_view api-1 | return current_app.ensure_sync(func)(*args, **kwargs) api-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ api-1 | File "/app/api/controllers/console/wraps.py", line 27, in decorated api-1 | return view(*args, **kwargs) api-1 | ^^^^^^^^^^^^^^^^^^^^^ api-1 | File "/app/api/controllers/console/workspace/model_providers.py", line 102, in post api-1 | model_provider_service.save_provider_credentials( api-1 | File "/app/api/services/model_provider_service.py", line 145, in save_provider_credentials api-1 | provider_configuration.add_or_update_custom_credentials(credentials) api-1 | File "/app/api/core/entities/provider_configuration.py", line 248, in add_or_update_custom_credentials api-1 | provider_record, credentials = self.custom_credentials_validate(credentials) api-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ api-1 | File "/app/api/core/entities/provider_configuration.py", line 231, in custom_credentials_validate api-1 | credentials = model_provider_factory.provider_credentials_validate( api-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ api-1 | File "/app/api/core/model_runtime/model_providers/model_provider_factory.py", line 155, in provider_credentials_validate api-1 | self.plugin_model_manager.validate_provider_credentials( api-1 | File "/app/api/core/plugin/manager/model.py", line 97, in validate_provider_credentials api-1 | for resp in response: api-1 | ^^^^^^^^ api-1 | File "/app/api/core/plugin/manager/base.py", line 189, in _request_with_plugin_daemon_response_stream api-1 | self._handle_plugin_daemon_error(error.error_type, error.message) api-1 | File "/app/api/core/plugin/manager/base.py", line 223, in _handle_plugin_daemon_error api-1 | raise PluginDaemonInternalServerError(description=message) api-1 | core.plugin.manager.exc.PluginDaemonInternalServerError: PluginDaemonInternalServerError: killed by timeout api-1 | 2025-03-02 08:25:00.617 ERROR [Dummy-18] [app.py:875] - Exception on /console/api/workspaces/current/model-providers/langgenius/jina/jina [POST] api-1 | Traceback (most recent call last): api-1 | File "/app/api/.venv/lib/python3.12/site-packages/flask/app.py", line 917, in full_dispatch_request api-1 | rv = self.dispatch_request() api-1 | ^^^^^^^^^^^^^^^^^^^^^^^ api-1 | File "/app/api/.venv/lib/python3.12/site-packages/flask/app.py", line 902, in dispatch_request api-1 | return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args) # type: ignore[no-any-return] api-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ api-1 | File "/app/api/.venv/lib/python3.12/site-packages/flask_restful/init.py", line 489, in wrapper api-1 | resp = resource(*args, **kwargs) api-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^ api-1 | File "/app/api/.venv/lib/python3.12/site-packages/flask/views.py", line 110, in view api-1 | return current_app.ensure_sync(self.dispatch_request)(**kwargs) # type: ignore[no-any-return] api-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ api-1 | File "/app/api/.venv/lib/python3.12/site-packages/flask_restful/init.py", line 604, in dispatch_request api-1 | resp = meth(*args, **kwargs) api-1 | ^^^^^^^^^^^^^^^^^^^^^ api-1 | File "/app/api/controllers/console/wraps.py", line 147, in decorated api-1 | return view(*args, **kwargs) api-1 | ^^^^^^^^^^^^^^^^^^^^^ api-1 | File "/app/api/libs/login.py", line 94, in decorated_view api-1 | return current_app.ensure_sync(func)(*args, **kwargs) api-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ api-1 | File "/app/api/controllers/console/wraps.py", line 27, in decorated api-1 | return view(*args, **kwargs) api-1 | ^^^^^^^^^^^^^^^^^^^^^ api-1 | File "/app/api/controllers/console/workspace/model_providers.py", line 102, in post api-1 | model_provider_service.save_provider_credentials( api-1 | File "/app/api/services/model_provider_service.py", line 145, in save_provider_credentials api-1 | provider_configuration.add_or_update_custom_credentials(credentials) api-1 | File "/app/api/core/entities/provider_configuration.py", line 248, in add_or_update_custom_credentials api-1 | provider_record, credentials = self.custom_credentials_validate(credentials) api-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ api-1 | File "/app/api/core/entities/provider_configuration.py", line 231, in custom_credentials_validate api-1 | credentials = model_provider_factory.provider_credentials_validate( api-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ api-1 | File "/app/api/core/model_runtime/model_providers/model_provider_factory.py", line 155, in provider_credentials_validate api-1 | self.plugin_model_manager.validate_provider_credentials( api-1 | File "/app/api/core/plugin/manager/model.py", line 97, in validate_provider_credentials api-1 | for resp in response: api-1 | ^^^^^^^^ api-1 | File "/app/api/core/plugin/manager/base.py", line 189, in _request_with_plugin_daemon_response_stream api-1 | self._handle_plugin_daemon_error(error.error_type, error.message) api-1 | File "/app/api/core/plugin/manager/base.py", line 223, in _handle_plugin_daemon_error api-1 | raise PluginDaemonInternalServerError(description=message) api-1 | core.plugin.manager.exc.PluginDaemonInternalServerError: PluginDaemonInternalServerError: killed by timeout api-1 | 2025-03-02 09:36:54.623 ERROR [Dummy-19] [app.py:875] - Exception on /console/api/workspaces/current/model-providers/langgenius/siliconflow/siliconflow [POST] api-1 | Traceback (most recent call last): api-1 | File "/app/api/.venv/lib/python3.12/site-packages/flask/app.py", line 917, in full_dispatch_request api-1 | rv = self.dispatch_request() api-1 | ^^^^^^^^^^^^^^^^^^^^^^^ api-1 | File "/app/api/.venv/lib/python3.12/site-packages/flask/app.py", line 902, in dispatch_request api-1 | return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args) # type: ignore[no-any-return] api-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ api-1 | File "/app/api/.venv/lib/python3.12/site-packages/flask_restful/init.py", line 489, in wrapper api-1 | resp = resource(*args, **kwargs) api-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^ api-1 | File "/app/api/.venv/lib/python3.12/site-packages/flask/views.py", line 110, in view api-1 | return current_app.ensure_sync(self.dispatch_request)(**kwargs) # type: ignore[no-any-return] api-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ api-1 | File "/app/api/.venv/lib/python3.12/site-packages/flask_restful/init.py", line 604, in dispatch_request api-1 | resp = meth(*args, **kwargs) api-1 | ^^^^^^^^^^^^^^^^^^^^^ api-1 | File "/app/api/controllers/console/wraps.py", line 147, in decorated api-1 | return view(*args, **kwargs) api-1 | ^^^^^^^^^^^^^^^^^^^^^ api-1 | File "/app/api/libs/login.py", line 94, in decorated_view api-1 | return current_app.ensure_sync(func)(*args, **kwargs) api-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ api-1 | File "/app/api/controllers/console/wraps.py", line 27, in decorated api-1 | return view(*args, **kwargs) api-1 | ^^^^^^^^^^^^^^^^^^^^^ api-1 | File "/app/api/controllers/console/workspace/model_providers.py", line 102, in post api-1 | model_provider_service.save_provider_credentials( api-1 | File "/app/api/services/model_provider_service.py", line 145, in save_provider_credentials api-1 | provider_configuration.add_or_update_custom_credentials(credentials) api-1 | File "/app/api/core/entities/provider_configuration.py", line 248, in add_or_update_custom_credentials api-1 | provider_record, credentials = self.custom_credentials_validate(credentials) api-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ api-1 | File "/app/api/core/entities/provider_configuration.py", line 231, in custom_credentials_validate api-1 | credentials = model_provider_factory.provider_credentials_validate( api-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ api-1 | File "/app/api/core/model_runtime/model_providers/model_provider_factory.py", line 155, in provider_credentials_validate api-1 | self.plugin_model_manager.validate_provider_credentials( api-1 | File "/app/api/core/plugin/manager/model.py", line 97, in validate_provider_credentials api-1 | for resp in response: api-1 | ^^^^^^^^ api-1 | File "/app/api/core/plugin/manager/base.py", line 189, in _request_with_plugin_daemon_response_stream api-1 | self._handle_plugin_daemon_error(error.error_type, error.message) api-1 | File "/app/api/core/plugin/manager/base.py", line 223, in _handle_plugin_daemon_error api-1 | raise PluginDaemonInternalServerError(description=message) api-1 | core.plugin.manager.exc.PluginDaemonInternalServerError: PluginDaemonInternalServerError: killed by timeout

so, what's the next? @dosu.

rosenjiang avatar Mar 02 '25 09:03 rosenjiang

same problem

xiangsanliu avatar Mar 02 '25 10:03 xiangsanliu

俺也一样。。。接入模型的时候一直报错 ,要么是: { "code": "bad_request", "message": "The browser (or proxy) sent a request that this server could not understand.", "status": 400 }

要么是: Request URL: http://localhost/console/api/workspaces/current/model-providers/langgenius/wenxin/wenxin Request Method: POST Status Code: 500 INTERNAL SERVER ERROR

1006928117 avatar Mar 02 '25 12:03 1006928117

我也一样,之前0.15版本很正常,我重新安装了1.0版本后,添加api始终出错,卡死或者提示

Image

abc77654 avatar Mar 03 '25 02:03 abc77654

尝试了几种: deepseek的api可以正常输入保存: gemini输入后无反应,不能保存; 火山方舟、硅基流动、通义千问、智谱均报错,internal sever error

zbaos260 avatar Mar 03 '25 03:03 zbaos260

尝试了几种: deepseek的api可以正常输入保存: gemini输入后无反应,不能保存; 火山方舟、硅基流动、通义千问、智谱均报错,internal sever error

我目前一个都无法添加,哎,等修复bug,我尝试了我关闭本地翻墙工具,都是一样的

abc77654 avatar Mar 03 '25 03:03 abc77654

一样的,api无法保存,求解

Image

kevinwang04 avatar Mar 03 '25 07:03 kevinwang04

Try https://github.com/langgenius/dify/issues/14736#issuecomment-2693905382 & https://github.com/langgenius/dify/issues/14682#issuecomment-2694019566

crazywoola avatar Mar 03 '25 10:03 crazywoola

To resolve the "PluginDaemonInternalServerError: killed by timeout" error when saving the API Key setting in Dify, you should upgrade the Dify official plugins to version 0.0.6. This upgrade has been confirmed to resolve the timeout issue that occurs during credential validation. Additionally, you can add the following configuration line to your docker-compose.yaml file after line 560 to increase the Python environment initialization timeout, which may also help:

PYTHON_ENV_INIT_TIMEOUT: 320

After making these changes, restart the Docker containers with the following commands:

  1. docker compose stop
  2. docker compose up -d

These steps should help address the timeout issue you're experiencing [1][2][3].

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] avatar Mar 03 '25 11:03 dosubot[bot]

Image The Qwen API cannot save. But it's not a network issue.

lisontowind avatar Mar 03 '25 14:03 lisontowind

If you upgrade to version 0.05 and have already filled in the API key, this problem will occur, whereas the Tongyi plugin version 0.04 does not have this issue.

Image

lisontowind avatar Mar 03 '25 14:03 lisontowind

mark, 看看怎么解决

forachange avatar Mar 04 '25 00:03 forachange

mark 某位知名主播说过,不会升级就别学别人升级!

likang105030 avatar Mar 04 '25 06:03 likang105030

回退到Tongyi 插件0.04 版本解决

lisontowind avatar Mar 04 '25 06:03 lisontowind

马克某位知名播主说过,不会升级就别学别人升级!

你应该根本就没有看别人说了什么就对别人进行攻击 首先你说的不会升级问题根本就不存在 整个叙述中都不存在升级这个词,完全就是无中生有,何来升级一说呢?全程都是直接安装的指定的版本,并且重装了不下5次,最最终安装了其他版本才得以解决,足以证明这是1.0.0版本的问题

188zhuyaqi avatar Mar 04 '25 06:03 188zhuyaqi

To resolve the "PluginDaemonInternalServerError: killed by timeout" error when saving the API Key setting in Dify, you should upgrade the Dify official plugins to version 0.0.6. This upgrade has been confirmed to resolve the timeout issue that occurs during credential validation. Additionally, you can add the following configuration line to your docker-compose.yaml file after line 560 to increase the Python environment initialization timeout, which may also help:要解决在 Dify 中保存 API 密钥设置时出现的“PluginDaemonInternalServerError: killed by timeout”错误,您应该将 Dify 官方插件升级到版本 0.0.6。此升级已被证实可以解决在凭证验证期间出现的超时问题。此外,您可以在第 560 行之后添加以下配置行到您的 docker-compose.yaml 文件中,以增加 Python 环境初始化的超时时间,这可能也有帮助:

PYTHON_ENV_INIT_TIMEOUT: 320 After making these changes, restart the Docker containers with the following commands:在做出这些更改后,使用以下命令重新启动 Docker 容器:

  1. docker compose stop
  2. docker compose up -d

These steps should help address the timeout issue you're experiencing [1][2][3].这些步骤应有助于解决您遇到的超时问题 [1] [2] [3]

To continue talking to Dosu, mention @dosu.继续与 Dosu 交谈,请提及。

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

it is no use

zhiwenliao avatar Mar 04 '25 10:03 zhiwenliao

mark 某位知名主播说过,不会升级就别学别人升级!

新装的也是同样的问题,应该怎么说?

jhe123456 avatar Mar 04 '25 13:03 jhe123456

any solution?-_-!

dcxs avatar Mar 05 '25 03:03 dcxs

兄弟们,找到可行的办法了。

这里应该是可以设置这个超时时间的默认值: /langgenius/dify-plugin-daemon/tree/main /internal/types/app/default.go setDefaultInt(&config.PluginMaxExecutionTimeout, 240)

这里应该是可以通过环境变量改变这个默认值: /internal/types/app/config.go PluginMaxExecutionTimeout int envconfig:"PLUGIN_MAX_EXECUTION_TIMEOUT" validate:"required"

我直接扩大10倍,就没这个timeout的问题了。 一开始只在.env里加了还没用,后来在docker-compose里也加上才生效,家在plugin哪一段。

dereksolar avatar Mar 05 '25 03:03 dereksolar

docker-compose.yaml

docker-compose.yaml
...
...
...
# plugin daemon
plugin_daemon:
  image: langgenius/dify-plugin-daemon:0.0.3-local
  restart: always
  environment:
    # Use the shared environment variables.
    <<: *shared-api-worker-env
    DB_DATABASE: ${DB_PLUGIN_DATABASE:-dify_plugin}
    SERVER_PORT: ${PLUGIN_DAEMON_PORT:-5002}
    SERVER_KEY: ${PLUGIN_DAEMON_KEY:-lYkiYYT6owG+71oLerGzA7GXCgOT++6ovaezWAjpCjf+Sjc3ZtU+qUEi}
    MAX_PLUGIN_PACKAGE_SIZE: ${PLUGIN_MAX_PACKAGE_SIZE:-52428800}
    PPROF_ENABLED: ${PLUGIN_PPROF_ENABLED:-false}
    DIFY_INNER_API_URL: ${PLUGIN_DIFY_INNER_API_URL:-http://api:5001}
    DIFY_INNER_API_KEY: ${INNER_API_KEY_FOR_PLUGIN:-QaHbTe77CtuXmsfyhR7+vRjI/+XbV1AaFy691iy+kGDv2Jvy0/eAh8Y1}
    PLUGIN_REMOTE_INSTALLING_HOST: ${EXPOSE_PLUGIN_DEBUGGING_HOST:-localhost}
    PLUGIN_REMOTE_INSTALLING_PORT: ${EXPOSE_PLUGIN_DEBUGGING_PORT:-5003}
    PLUGIN_WORKING_PATH: ${PLUGIN_WORKING_PATH:-/app/storage/cwd}
    PLUGIN_MAX_EXECUTION_TIMEOUT: 2400 <--------------------------------------------------------------------------------------------------------------------------------
    FORCE_VERIFYING_SIGNATURE: ${FORCE_VERIFYING_SIGNATURE:-true}
  ports:
    - "${EXPOSE_PLUGIN_DEBUGGING_PORT:-5003}:${PLUGIN_DEBUGGING_PORT:-5003}"
  volumes:
    - ./volumes/plugin_daemon:/app/storage
...
...
...

Dmitry-Diordychuk avatar Mar 05 '25 20:03 Dmitry-Diordychuk

兄弟们,找到可行的办法了。

这里应该是可以设置这个超时时间的默认值: /langgenius/dify-plugin-daemon/tree/main /internal/types/app/default.go setDefaultInt(&config.PluginMaxExecutionTimeout, 240)

这里应该是可以通过环境变量改变这个默认值: /internal/types/app/config.go PluginMaxExecutionTimeout int envconfig:"PLUGIN_MAX_EXECUTION_TIMEOUT" validate:"required"

我直接扩大10倍,就没这个timeout的问题了。 一开始只在.env里加了还没用,后来在docker-compose里也加上才生效,家在plugin哪一段。

i am waiting for new version.............

rosenjiang avatar Mar 06 '25 03:03 rosenjiang

docker-compose.yaml

docker-compose.yaml ... ... ...

plugin daemon

plugin_daemon: image: langgenius/dify-plugin-daemon:0.0.3-local restart: always environment: # Use the shared environment variables. <<: *shared-api-worker-env DB_DATABASE: ${DB_PLUGIN_DATABASE:-dify_plugin} SERVER_PORT: ${PLUGIN_DAEMON_PORT:-5002} SERVER_KEY: ${PLUGIN_DAEMON_KEY:-lYkiYYT6owG+71oLerGzA7GXCgOT++6ovaezWAjpCjf+Sjc3ZtU+qUEi} MAX_PLUGIN_PACKAGE_SIZE: ${PLUGIN_MAX_PACKAGE_SIZE:-52428800} PPROF_ENABLED: ${PLUGIN_PPROF_ENABLED:-false} DIFY_INNER_API_URL: ${PLUGIN_DIFY_INNER_API_URL:-http://api:5001} DIFY_INNER_API_KEY: ${INNER_API_KEY_FOR_PLUGIN:-QaHbTe77CtuXmsfyhR7+vRjI/+XbV1AaFy691iy+kGDv2Jvy0/eAh8Y1} PLUGIN_REMOTE_INSTALLING_HOST: ${EXPOSE_PLUGIN_DEBUGGING_HOST:-localhost} PLUGIN_REMOTE_INSTALLING_PORT: ${EXPOSE_PLUGIN_DEBUGGING_PORT:-5003} PLUGIN_WORKING_PATH: ${PLUGIN_WORKING_PATH:-/app/storage/cwd} PLUGIN_MAX_EXECUTION_TIMEOUT: 2400 <-------------------------------------------------------------------------------------------------------------------------------- FORCE_VERIFYING_SIGNATURE: ${FORCE_VERIFYING_SIGNATURE:-true} ports: - "${EXPOSE_PLUGIN_DEBUGGING_PORT:-5003}:${PLUGIN_DEBUGGING_PORT:-5003}" volumes: - ./volumes/plugin_daemon:/app/storage ... ... ...

When I add PLUGIN_MAX_EXECUTION_TIMEOUT: 2400 configuration, it can setting API-KEY of moonshot and openAi successfully, but volcengine still not work successfully

probie6 avatar Mar 06 '25 04:03 probie6

兄弟们,找到可行的办法了。

这里应该是可以设置这个超时时间的默认值: /langgenius/dify-plugin-daemon/tree/main /internal/types/app/default.go setDefaultInt(&config.PluginMaxExecutionTimeout, 240)这里应该是可以设置这个超时时间的默认值: /langgenius/dify-plugin-daemon/tree/main /internal/types/app/default.go setDefaultInt(&config.PluginMaxExecutionTimeout, 240)

这里应该是可以通过环境变量改变这个默认值: /internal/types/app/config.go PluginMaxExecutionTimeout int envconfig:"PLUGIN_MAX_EXECUTION_TIMEOUT" validate:"required"这里应该是可以通过环境变量改变这个默认值: /internal/types/app/config.go PluginMaxExecutionTimeout int envconfig:"PLUGIN_MAX_EXECUTION_TIMEOUT" validate:"required"

我直接扩大10倍,就没这个timeout的问题了。 一开始只在.env里加了还没用,后来在docker-compose里也加上才生效,家在plugin哪一段。

nice啊兄弟,真的有用,爱你!

lmx492274842 avatar Mar 06 '25 05:03 lmx492274842

same problem

hczs avatar Mar 06 '25 13:03 hczs