Dift添加模型报错 #12266

Closed
opened 2026-02-21 19:06:39 -05:00 by yindo · 9 comments
Owner

Originally created by @yuan-0708 on GitHub (Mar 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

1.0.1

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

WARNING [Dummy-1] [provider_configuration.py:989] - get custom model schema failed, PluginDaemonInternalServerError: killed by timeout
2025-03-28 03:11:38.163 WARNING [Dummy-2] [provider_configuration.py:989] - get custom model schema failed, PluginDaemonInternalServerError: killed by timeout
2025-03-28 03:14:37.176 ERROR [Dummy-3] [app.py:875] - Exception on /console/api/workspaces/current/model-providers/langgenius/ollama/ollama/models [POST]
Traceback (most recent call last):
File "/app/api/.venv/lib/python3.12/site-packages/flask/app.py", line 917, in full_dispatch_request
rv = self.dispatch_request()
^^^^^^^^^^^^^^^^^^^^^^^
File "/app/api/.venv/lib/python3.12/site-packages/flask/app.py", line 902, in dispatch_request
return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args) # type: ignore[no-any-return]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/api/.venv/lib/python3.12/site-packages/flask_restful/__init__.py", line 489, in wrapper
resp = resource(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/api/.venv/lib/python3.12/site-packages/flask/views.py", line 110, in view
return current_app.ensure_sync(self.dispatch_request)(**kwargs) # type: ignore[no-any-return]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/api/.venv/lib/python3.12/site-packages/flask_restful/__init__.py", line 604, in dispatch_request
resp = meth(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/app/api/controllers/console/wraps.py", line 187, in decorated
return view(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/app/api/libs/login.py", line 94, in decorated_view
return current_app.ensure_sync(func)(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/api/controllers/console/wraps.py", line 30, in decorated
return view(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/app/api/controllers/console/workspace/models.py", line 154, in post
model_provider_service.save_model_credentials(
File "/app/api/services/model_provider_service.py", line 237, in save_model_credentials
provider_configuration.add_or_update_custom_model_credentials(
File "/app/api/core/entities/provider_configuration.py", line 422, in add_or_update_custom_model_credentials
provider_model_record, credentials = self.custom_model_credentials_validate(model_type, model, credentials)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/api/core/entities/provider_configuration.py", line 402, in custom_model_credentials_validate
credentials = model_provider_factory.model_credentials_validate(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/api/core/model_runtime/model_providers/model_provider_factory.py", line 191, in model_credentials_validate
self.plugin_model_manager.validate_model_credentials(
File "/app/api/core/plugin/manager/model.py", line 137, in validate_model_credentials
for resp in response:
^^^^^^^^
File "/app/api/core/plugin/manager/base.py", line 189, in _request_with_plugin_daemon_response_stream
self._handle_plugin_daemon_error(error.error_type, error.message)
File "/app/api/core/plugin/manager/base.py", line 223, in _handle_plugin_daemon_error
raise PluginDaemonInternalServerError(description=message)
core.plugin.manager.exc.PluginDaemonInternalServerError: PluginDaemonInternalServerError: killed by timeout

Image

✔️ Expected Behavior

No response

Actual Behavior

No response

Originally created by @yuan-0708 on GitHub (Mar 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 1.0.1 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce WARNING [Dummy-1] [provider_configuration.py:989] - get custom model schema failed, PluginDaemonInternalServerError: killed by timeout 2025-03-28 03:11:38.163 WARNING [Dummy-2] [provider_configuration.py:989] - get custom model schema failed, PluginDaemonInternalServerError: killed by timeout 2025-03-28 03:14:37.176 ERROR [Dummy-3] [app.py:875] - Exception on /console/api/workspaces/current/model-providers/langgenius/ollama/ollama/models [POST] Traceback (most recent call last): File "/app/api/.venv/lib/python3.12/site-packages/flask/app.py", line 917, in full_dispatch_request rv = self.dispatch_request() ^^^^^^^^^^^^^^^^^^^^^^^ File "/app/api/.venv/lib/python3.12/site-packages/flask/app.py", line 902, in dispatch_request return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args) # type: ignore[no-any-return] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/api/.venv/lib/python3.12/site-packages/flask_restful/__init__.py", line 489, in wrapper resp = resource(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/api/.venv/lib/python3.12/site-packages/flask/views.py", line 110, in view return current_app.ensure_sync(self.dispatch_request)(**kwargs) # type: ignore[no-any-return] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/api/.venv/lib/python3.12/site-packages/flask_restful/__init__.py", line 604, in dispatch_request resp = meth(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^ File "/app/api/controllers/console/wraps.py", line 187, in decorated return view(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^ File "/app/api/libs/login.py", line 94, in decorated_view return current_app.ensure_sync(func)(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/api/controllers/console/wraps.py", line 30, in decorated return view(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^ File "/app/api/controllers/console/workspace/models.py", line 154, in post model_provider_service.save_model_credentials( File "/app/api/services/model_provider_service.py", line 237, in save_model_credentials provider_configuration.add_or_update_custom_model_credentials( File "/app/api/core/entities/provider_configuration.py", line 422, in add_or_update_custom_model_credentials provider_model_record, credentials = self.custom_model_credentials_validate(model_type, model, credentials) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/api/core/entities/provider_configuration.py", line 402, in custom_model_credentials_validate credentials = model_provider_factory.model_credentials_validate( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/api/core/model_runtime/model_providers/model_provider_factory.py", line 191, in model_credentials_validate self.plugin_model_manager.validate_model_credentials( File "/app/api/core/plugin/manager/model.py", line 137, in validate_model_credentials for resp in response: ^^^^^^^^ File "/app/api/core/plugin/manager/base.py", line 189, in _request_with_plugin_daemon_response_stream self._handle_plugin_daemon_error(error.error_type, error.message) File "/app/api/core/plugin/manager/base.py", line 223, in _handle_plugin_daemon_error raise PluginDaemonInternalServerError(description=message) core.plugin.manager.exc.PluginDaemonInternalServerError: PluginDaemonInternalServerError: killed by timeout ![Image](https://github.com/user-attachments/assets/a4789362-9975-42e7-a114-efc1dbd94925) ### ✔️ Expected Behavior _No response_ ### ❌ Actual Behavior _No response_
yindo added the 🐞 bug label 2026-02-21 19:06:39 -05:00
yindo closed this issue 2026-02-21 19:06:39 -05:00
Author
Owner

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

@yuan-0708 Hello! I'm here to help you with any bugs, questions, or contributions you have for Dify. I'll assist you while we wait for a human maintainer.

To resolve the "PluginDaemonInternalServerError: killed by timeout" error when adding a model in the Ollama software application using Dify version 1.0.1 on a self-hosted Docker setup, you can follow these steps:

  1. Ensure LLM Configuration: Make sure that a Language Learning Model (LLM) is properly configured in your Dify installation. This is necessary for operations that require model schema information.

  2. Update Environment Variables: Configure the following environment variables in your .env file:

    PROVIDER_OLLAMA_API_BASE_URL=http://host.docker.internal:11434/
    PLUGIN_WORKING_PATH=/app/cwd
    
  3. Modify Docker Compose: Update your docker-compose.yaml file for the plugin_daemon service to increase the execution timeout. Add or update the following environment variables:

    plugin_daemon:
      environment:
        PLUGIN_MAX_EXECUTION_TIMEOUT: 2400
        PYTHON_ENV_INIT_TIMEOUT: 640
    
  4. Restart Docker Containers: After making these changes, restart your Docker containers to apply the new settings:

    docker compose down
    docker compose up -d
    

These steps should help accommodate longer model validation and credential saving processes, reducing the likelihood of timeout errors [1][2][3][4][5].

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 (Mar 27, 2025): <!-- Greeting --> @yuan-0708 Hello! I'm here to help you with any bugs, questions, or contributions you have for Dify. I'll assist you while we wait for a human maintainer. <!-- Answer --> To resolve the "PluginDaemonInternalServerError: killed by timeout" error when adding a model in the Ollama software application using Dify version 1.0.1 on a self-hosted Docker setup, you can follow these steps: 1. **Ensure LLM Configuration**: Make sure that a Language Learning Model (LLM) is properly configured in your Dify installation. This is necessary for operations that require model schema information. 2. **Update Environment Variables**: Configure the following environment variables in your `.env` file: ```plaintext PROVIDER_OLLAMA_API_BASE_URL=http://host.docker.internal:11434/ PLUGIN_WORKING_PATH=/app/cwd ``` 3. **Modify Docker Compose**: Update your `docker-compose.yaml` file for the `plugin_daemon` service to increase the execution timeout. Add or update the following environment variables: ```yaml plugin_daemon: environment: PLUGIN_MAX_EXECUTION_TIMEOUT: 2400 PYTHON_ENV_INIT_TIMEOUT: 640 ``` 4. **Restart Docker Containers**: After making these changes, restart your Docker containers to apply the new settings: ```bash docker compose down docker compose up -d ``` These steps should help accommodate longer model validation and credential saving processes, reducing the likelihood of timeout errors <sup>[[1]](https://github.com/langgenius/dify/issues/15538)</sup><sup>[[2]](https://github.com/langgenius/dify/issues/15140)</sup><sup>[[3]](https://github.com/langgenius/dify/issues/15082)</sup><sup>[[4]](https://github.com/langgenius/dify/issues/14859)</sup><sup>[[5]](https://github.com/langgenius/dify/issues/14566)</sup>. <!-- 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/1a90bd7c-6528-455e-a92a-43cc9c801532?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/1a90bd7c-6528-455e-a92a-43cc9c801532?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/1a90bd7c-6528-455e-a92a-43cc9c801532?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/1a90bd7c-6528-455e-a92a-43cc9c801532?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/1a90bd7c-6528-455e-a92a-43cc9c801532?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/1a90bd7c-6528-455e-a92a-43cc9c801532?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/1a90bd7c-6528-455e-a92a-43cc9c801532?feedback_type=other)</sup>
Author
Owner

@yuan-0708 commented on GitHub (Mar 28, 2025):

Hello! According to your response, a new error occurred after the configuration was successful. Could you please help me take a look;

------------------ 原始邮件 ------------------
发件人: "langgenius/dify" @.>;
发送时间: 2025年3月28日(星期五) 中午11:21
@.
>;
@.@.>;
主题: Re: [langgenius/dify] Dift添加模型报错 (Issue #16999)

@yuan-0708 Hello! I'm here to help you with any bugs, questions, or contributions you have for Dify. I'll assist you while we wait for a human maintainer.

To resolve the "PluginDaemonInternalServerError: killed by timeout" error when adding a model in the Ollama software application using Dify version 1.0.1 on a self-hosted Docker setup, you can follow these steps:

Ensure LLM Configuration: Make sure that a Language Learning Model (LLM) is properly configured in your Dify installation. This is necessary for operations that require model schema information.

Update Environment Variables: Configure the following environment variables in your .env file:
PROVIDER_OLLAMA_API_BASE_URL=http://host.docker.internal:11434/ PLUGIN_WORKING_PATH=/app/cwd

Modify Docker Compose: Update your docker-compose.yaml file for the plugin_daemon service to increase the execution timeout. Add or update the following environment variables:
plugin_daemon: environment: PLUGIN_MAX_EXECUTION_TIMEOUT: 2400 PYTHON_ENV_INIT_TIMEOUT: 640

Restart Docker Containers: After making these changes, restart your Docker containers to apply the new settings:
docker compose down docker compose up -d

These steps should help accommodate longer model validation and credential saving processes, reducing the likelihood of timeout errors [1][2][3][4][5].

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


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you were mentioned.Message ID: @.***>
dosubot[bot] left a comment (langgenius/dify#16999)

@yuan-0708 Hello! I'm here to help you with any bugs, questions, or contributions you have for Dify. I'll assist you while we wait for a human maintainer.

To resolve the "PluginDaemonInternalServerError: killed by timeout" error when adding a model in the Ollama software application using Dify version 1.0.1 on a self-hosted Docker setup, you can follow these steps:

Ensure LLM Configuration: Make sure that a Language Learning Model (LLM) is properly configured in your Dify installation. This is necessary for operations that require model schema information.

Update Environment Variables: Configure the following environment variables in your .env file:
PROVIDER_OLLAMA_API_BASE_URL=http://host.docker.internal:11434/ PLUGIN_WORKING_PATH=/app/cwd

Modify Docker Compose: Update your docker-compose.yaml file for the plugin_daemon service to increase the execution timeout. Add or update the following environment variables:
plugin_daemon: environment: PLUGIN_MAX_EXECUTION_TIMEOUT: 2400 PYTHON_ENV_INIT_TIMEOUT: 640

Restart Docker Containers: After making these changes, restart your Docker containers to apply the new settings:
docker compose down docker compose up -d

These steps should help accommodate longer model validation and credential saving processes, reducing the likelihood of timeout errors [1][2][3][4][5].

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


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you were mentioned.Message ID: @.***>

@yuan-0708 commented on GitHub (Mar 28, 2025): Hello!&nbsp;According to your response, a new error occurred after the configuration was successful. Could you please help me take a look; ------------------&nbsp;原始邮件&nbsp;------------------ 发件人: "langgenius/dify" ***@***.***&gt;; 发送时间:&nbsp;2025年3月28日(星期五) 中午11:21 ***@***.***&gt;; ***@***.******@***.***&gt;; 主题:&nbsp;Re: [langgenius/dify] Dift添加模型报错 (Issue #16999) @yuan-0708 Hello! I'm here to help you with any bugs, questions, or contributions you have for Dify. I'll assist you while we wait for a human maintainer. To resolve the "PluginDaemonInternalServerError: killed by timeout" error when adding a model in the Ollama software application using Dify version 1.0.1 on a self-hosted Docker setup, you can follow these steps: Ensure LLM Configuration: Make sure that a Language Learning Model (LLM) is properly configured in your Dify installation. This is necessary for operations that require model schema information. Update Environment Variables: Configure the following environment variables in your .env file: PROVIDER_OLLAMA_API_BASE_URL=http://host.docker.internal:11434/ PLUGIN_WORKING_PATH=/app/cwd Modify Docker Compose: Update your docker-compose.yaml file for the plugin_daemon service to increase the execution timeout. Add or update the following environment variables: plugin_daemon: environment: PLUGIN_MAX_EXECUTION_TIMEOUT: 2400 PYTHON_ENV_INIT_TIMEOUT: 640 Restart Docker Containers: After making these changes, restart your Docker containers to apply the new settings: docker compose down docker compose up -d These steps should help accommodate longer model validation and credential saving processes, reducing the likelihood of timeout errors [1][2][3][4][5]. 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 — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: ***@***.***&gt; dosubot[bot] left a comment (langgenius/dify#16999) @yuan-0708 Hello! I'm here to help you with any bugs, questions, or contributions you have for Dify. I'll assist you while we wait for a human maintainer. To resolve the "PluginDaemonInternalServerError: killed by timeout" error when adding a model in the Ollama software application using Dify version 1.0.1 on a self-hosted Docker setup, you can follow these steps: Ensure LLM Configuration: Make sure that a Language Learning Model (LLM) is properly configured in your Dify installation. This is necessary for operations that require model schema information. Update Environment Variables: Configure the following environment variables in your .env file: PROVIDER_OLLAMA_API_BASE_URL=http://host.docker.internal:11434/ PLUGIN_WORKING_PATH=/app/cwd Modify Docker Compose: Update your docker-compose.yaml file for the plugin_daemon service to increase the execution timeout. Add or update the following environment variables: plugin_daemon: environment: PLUGIN_MAX_EXECUTION_TIMEOUT: 2400 PYTHON_ENV_INIT_TIMEOUT: 640 Restart Docker Containers: After making these changes, restart your Docker containers to apply the new settings: docker compose down docker compose up -d These steps should help accommodate longer model validation and credential saving processes, reducing the likelihood of timeout errors [1][2][3][4][5]. 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 — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: ***@***.***&gt;
Author
Owner

@yuan-0708 commented on GitHub (Mar 28, 2025):

Hello! According to your response, a new error occurred after the configuration was successful. Could you please help me take a look;

docker logs -f docker-api-1
Running migrations
2025-03-28 04:25:49.413 INFO [MainThread] [utils.py:149] - Note: NumExpr detected 40 cores but "NUMEXPR_MAX_THREADS" not set, so enforcing safe limit of 16.
2025-03-28 04:25:49.413 INFO [MainThread] [utils.py:162] - NumExpr defaulting to 16 threads.
/app/api/.venv/lib/python3.12/site-packages/opik/evaluation/metrics/heuristics/regex_match.py:8: SyntaxWarning: invalid escape sequence '\d'
  """
Preparing database migration...
Starting database migration.
INFO  [alembic.runtime.migration] Context impl PostgresqlImpl.
INFO  [alembic.runtime.migration] Will assume transactional DDL.
Database migration successful!
[2025-03-28 04:26:09 +0000] [1] [INFO] Starting gunicorn 23.0.0
[2025-03-28 04:26:09 +0000] [1] [INFO] Listening at: http://0.0.0.0:5001 (1)
[2025-03-28 04:26:09 +0000] [1] [INFO] Using worker: gevent
[2025-03-28 04:26:09 +0000] [69] [INFO] Booting worker with pid: 69
2025-03-28 04:26:13.640 INFO [MainThread] [utils.py:149] - Note: NumExpr detected 40 cores but "NUMEXPR_MAX_THREADS" not set, so enforcing safe limit of 16.
2025-03-28 04:26:13.641 INFO [MainThread] [utils.py:162] - NumExpr defaulting to 16 threads.
2025-03-28 04:26:47.943 ERROR [Dummy-1] [app.py:875] - Exception on /console/api/workspaces/current/model-providers/langgenius/ollama/ollama/models [POST]
Traceback (most recent call last):
  File "/app/api/.venv/lib/python3.12/site-packages/flask/app.py", line 917, in full_dispatch_request
    rv = self.dispatch_request()
         ^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/api/.venv/lib/python3.12/site-packages/flask/app.py", line 902, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)  # type: ignore[no-any-return]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/api/.venv/lib/python3.12/site-packages/flask_restful/__init__.py", line 489, in wrapper
    resp = resource(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/api/.venv/lib/python3.12/site-packages/flask/views.py", line 110, in view
    return current_app.ensure_sync(self.dispatch_request)(**kwargs)  # type: ignore[no-any-return]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/api/.venv/lib/python3.12/site-packages/flask_restful/__init__.py", line 604, in dispatch_request
    resp = meth(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/app/api/controllers/console/wraps.py", line 187, in decorated
    return view(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/app/api/libs/login.py", line 94, in decorated_view
    return current_app.ensure_sync(func)(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/api/controllers/console/wraps.py", line 30, in decorated
    return view(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/app/api/controllers/console/workspace/models.py", line 154, in post
    model_provider_service.save_model_credentials(
  File "/app/api/services/model_provider_service.py", line 237, in save_model_credentials
    provider_configuration.add_or_update_custom_model_credentials(
  File "/app/api/core/entities/provider_configuration.py", line 422, in add_or_update_custom_model_credentials
    provider_model_record, credentials = self.custom_model_credentials_validate(model_type, model, credentials)
                                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/api/core/entities/provider_configuration.py", line 402, in custom_model_credentials_validate
    credentials = model_provider_factory.model_credentials_validate(
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/api/core/model_runtime/model_providers/model_provider_factory.py", line 191, in model_credentials_validate
    self.plugin_model_manager.validate_model_credentials(
  File "/app/api/core/plugin/manager/model.py", line 137, in validate_model_credentials
    for resp in response:
                ^^^^^^^^
  File "/app/api/core/plugin/manager/base.py", line 189, in _request_with_plugin_daemon_response_stream
    self._handle_plugin_daemon_error(error.error_type, error.message)
  File "/app/api/core/plugin/manager/base.py", line 223, in _handle_plugin_daemon_error
    raise PluginDaemonInternalServerError(description=message)
core.plugin.manager.exc.PluginDaemonInternalServerError: PluginDaemonInternalServerError: no available node, plugin not found

------------------ 原始邮件 ------------------
发件人: "langgenius/dify" @.>;
发送时间: 2025年3月28日(星期五) 中午11:21
@.
>;
@.@.>;
主题: Re: [langgenius/dify] Dift添加模型报错 (Issue #16999)

@yuan-0708 Hello! I'm here to help you with any bugs, questions, or contributions you have for Dify. I'll assist you while we wait for a human maintainer.

To resolve the "PluginDaemonInternalServerError: killed by timeout" error when adding a model in the Ollama software application using Dify version 1.0.1 on a self-hosted Docker setup, you can follow these steps:

Ensure LLM Configuration: Make sure that a Language Learning Model (LLM) is properly configured in your Dify installation. This is necessary for operations that require model schema information.

Update Environment Variables: Configure the following environment variables in your .env file:
PROVIDER_OLLAMA_API_BASE_URL=http://host.docker.internal:11434/ PLUGIN_WORKING_PATH=/app/cwd

Modify Docker Compose: Update your docker-compose.yaml file for the plugin_daemon service to increase the execution timeout. Add or update the following environment variables:
plugin_daemon: environment: PLUGIN_MAX_EXECUTION_TIMEOUT: 2400 PYTHON_ENV_INIT_TIMEOUT: 640

Restart Docker Containers: After making these changes, restart your Docker containers to apply the new settings:
docker compose down docker compose up -d

These steps should help accommodate longer model validation and credential saving processes, reducing the likelihood of timeout errors [1][2][3][4][5].

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


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you were mentioned.Message ID: @.***>
dosubot[bot] left a comment (langgenius/dify#16999)

@yuan-0708 Hello! I'm here to help you with any bugs, questions, or contributions you have for Dify. I'll assist you while we wait for a human maintainer.

To resolve the "PluginDaemonInternalServerError: killed by timeout" error when adding a model in the Ollama software application using Dify version 1.0.1 on a self-hosted Docker setup, you can follow these steps:

Ensure LLM Configuration: Make sure that a Language Learning Model (LLM) is properly configured in your Dify installation. This is necessary for operations that require model schema information.

Update Environment Variables: Configure the following environment variables in your .env file:
PROVIDER_OLLAMA_API_BASE_URL=http://host.docker.internal:11434/ PLUGIN_WORKING_PATH=/app/cwd

Modify Docker Compose: Update your docker-compose.yaml file for the plugin_daemon service to increase the execution timeout. Add or update the following environment variables:
plugin_daemon: environment: PLUGIN_MAX_EXECUTION_TIMEOUT: 2400 PYTHON_ENV_INIT_TIMEOUT: 640

Restart Docker Containers: After making these changes, restart your Docker containers to apply the new settings:
docker compose down docker compose up -d

These steps should help accommodate longer model validation and credential saving processes, reducing the likelihood of timeout errors [1][2][3][4][5].

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


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you were mentioned.Message ID: @.***>

@yuan-0708 commented on GitHub (Mar 28, 2025): Hello! According to your response, a new error occurred after the configuration was successful. Could you please help me take a look; docker logs -f docker-api-1 Running migrations 2025-03-28 04:25:49.413 INFO [MainThread] [utils.py:149] - Note: NumExpr detected 40 cores but "NUMEXPR_MAX_THREADS" not set, so enforcing safe limit of 16. 2025-03-28 04:25:49.413 INFO [MainThread] [utils.py:162] - NumExpr defaulting to 16 threads. /app/api/.venv/lib/python3.12/site-packages/opik/evaluation/metrics/heuristics/regex_match.py:8: SyntaxWarning: invalid escape sequence '\d' &nbsp; """ Preparing database migration... Starting database migration. INFO&nbsp; [alembic.runtime.migration] Context impl PostgresqlImpl. INFO&nbsp; [alembic.runtime.migration] Will assume transactional DDL. Database migration successful! [2025-03-28 04:26:09 +0000] [1] [INFO] Starting gunicorn 23.0.0 [2025-03-28 04:26:09 +0000] [1] [INFO] Listening at: http://0.0.0.0:5001 (1) [2025-03-28 04:26:09 +0000] [1] [INFO] Using worker: gevent [2025-03-28 04:26:09 +0000] [69] [INFO] Booting worker with pid: 69 2025-03-28 04:26:13.640 INFO [MainThread] [utils.py:149] - Note: NumExpr detected 40 cores but "NUMEXPR_MAX_THREADS" not set, so enforcing safe limit of 16. 2025-03-28 04:26:13.641 INFO [MainThread] [utils.py:162] - NumExpr defaulting to 16 threads. 2025-03-28 04:26:47.943 ERROR [Dummy-1] [app.py:875] - Exception on /console/api/workspaces/current/model-providers/langgenius/ollama/ollama/models [POST] Traceback (most recent call last): &nbsp; File "/app/api/.venv/lib/python3.12/site-packages/flask/app.py", line 917, in full_dispatch_request &nbsp; &nbsp; rv = self.dispatch_request() &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;^^^^^^^^^^^^^^^^^^^^^^^ &nbsp; File "/app/api/.venv/lib/python3.12/site-packages/flask/app.py", line 902, in dispatch_request &nbsp; &nbsp; return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)&nbsp; # type: ignore[no-any-return] &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ &nbsp; File "/app/api/.venv/lib/python3.12/site-packages/flask_restful/__init__.py", line 489, in wrapper &nbsp; &nbsp; resp = resource(*args, **kwargs) &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;^^^^^^^^^^^^^^^^^^^^^^^^^ &nbsp; File "/app/api/.venv/lib/python3.12/site-packages/flask/views.py", line 110, in view &nbsp; &nbsp; return current_app.ensure_sync(self.dispatch_request)(**kwargs)&nbsp; # type: ignore[no-any-return] &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ &nbsp; File "/app/api/.venv/lib/python3.12/site-packages/flask_restful/__init__.py", line 604, in dispatch_request &nbsp; &nbsp; resp = meth(*args, **kwargs) &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;^^^^^^^^^^^^^^^^^^^^^ &nbsp; File "/app/api/controllers/console/wraps.py", line 187, in decorated &nbsp; &nbsp; return view(*args, **kwargs) &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;^^^^^^^^^^^^^^^^^^^^^ &nbsp; File "/app/api/libs/login.py", line 94, in decorated_view &nbsp; &nbsp; return current_app.ensure_sync(func)(*args, **kwargs) &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ &nbsp; File "/app/api/controllers/console/wraps.py", line 30, in decorated &nbsp; &nbsp; return view(*args, **kwargs) &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;^^^^^^^^^^^^^^^^^^^^^ &nbsp; File "/app/api/controllers/console/workspace/models.py", line 154, in post &nbsp; &nbsp; model_provider_service.save_model_credentials( &nbsp; File "/app/api/services/model_provider_service.py", line 237, in save_model_credentials &nbsp; &nbsp; provider_configuration.add_or_update_custom_model_credentials( &nbsp; File "/app/api/core/entities/provider_configuration.py", line 422, in add_or_update_custom_model_credentials &nbsp; &nbsp; provider_model_record, credentials = self.custom_model_credentials_validate(model_type, model, credentials) &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ &nbsp; File "/app/api/core/entities/provider_configuration.py", line 402, in custom_model_credentials_validate &nbsp; &nbsp; credentials = model_provider_factory.model_credentials_validate( &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ &nbsp; File "/app/api/core/model_runtime/model_providers/model_provider_factory.py", line 191, in model_credentials_validate &nbsp; &nbsp; self.plugin_model_manager.validate_model_credentials( &nbsp; File "/app/api/core/plugin/manager/model.py", line 137, in validate_model_credentials &nbsp; &nbsp; for resp in response: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ^^^^^^^^ &nbsp; File "/app/api/core/plugin/manager/base.py", line 189, in _request_with_plugin_daemon_response_stream &nbsp; &nbsp; self._handle_plugin_daemon_error(error.error_type, error.message) &nbsp; File "/app/api/core/plugin/manager/base.py", line 223, in _handle_plugin_daemon_error &nbsp; &nbsp; raise PluginDaemonInternalServerError(description=message) core.plugin.manager.exc.PluginDaemonInternalServerError: PluginDaemonInternalServerError: no available node, plugin not found ------------------ 原始邮件 ------------------ 发件人: "langgenius/dify" ***@***.***&gt;; 发送时间:&nbsp;2025年3月28日(星期五) 中午11:21 ***@***.***&gt;; ***@***.******@***.***&gt;; 主题:&nbsp;Re: [langgenius/dify] Dift添加模型报错 (Issue #16999) @yuan-0708 Hello! I'm here to help you with any bugs, questions, or contributions you have for Dify. I'll assist you while we wait for a human maintainer. To resolve the "PluginDaemonInternalServerError: killed by timeout" error when adding a model in the Ollama software application using Dify version 1.0.1 on a self-hosted Docker setup, you can follow these steps: Ensure LLM Configuration: Make sure that a Language Learning Model (LLM) is properly configured in your Dify installation. This is necessary for operations that require model schema information. Update Environment Variables: Configure the following environment variables in your .env file: PROVIDER_OLLAMA_API_BASE_URL=http://host.docker.internal:11434/ PLUGIN_WORKING_PATH=/app/cwd Modify Docker Compose: Update your docker-compose.yaml file for the plugin_daemon service to increase the execution timeout. Add or update the following environment variables: plugin_daemon: environment: PLUGIN_MAX_EXECUTION_TIMEOUT: 2400 PYTHON_ENV_INIT_TIMEOUT: 640 Restart Docker Containers: After making these changes, restart your Docker containers to apply the new settings: docker compose down docker compose up -d These steps should help accommodate longer model validation and credential saving processes, reducing the likelihood of timeout errors [1][2][3][4][5]. 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 — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: ***@***.***&gt; dosubot[bot] left a comment (langgenius/dify#16999) @yuan-0708 Hello! I'm here to help you with any bugs, questions, or contributions you have for Dify. I'll assist you while we wait for a human maintainer. To resolve the "PluginDaemonInternalServerError: killed by timeout" error when adding a model in the Ollama software application using Dify version 1.0.1 on a self-hosted Docker setup, you can follow these steps: Ensure LLM Configuration: Make sure that a Language Learning Model (LLM) is properly configured in your Dify installation. This is necessary for operations that require model schema information. Update Environment Variables: Configure the following environment variables in your .env file: PROVIDER_OLLAMA_API_BASE_URL=http://host.docker.internal:11434/ PLUGIN_WORKING_PATH=/app/cwd Modify Docker Compose: Update your docker-compose.yaml file for the plugin_daemon service to increase the execution timeout. Add or update the following environment variables: plugin_daemon: environment: PLUGIN_MAX_EXECUTION_TIMEOUT: 2400 PYTHON_ENV_INIT_TIMEOUT: 640 Restart Docker Containers: After making these changes, restart your Docker containers to apply the new settings: docker compose down docker compose up -d These steps should help accommodate longer model validation and credential saving processes, reducing the likelihood of timeout errors [1][2][3][4][5]. 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 — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: ***@***.***&gt;
Author
Owner

@dosubot[bot] commented on GitHub (Mar 28, 2025):

To resolve the "PluginDaemonInternalServerError: no available node, plugin not found" error, try the following steps:

  1. Upgrade to the Latest Version: Ensure you are using Dify version 1.0.1 or later, as newer releases may include fixes for this issue.

  2. Increase Plugin Execution Timeout: Modify your docker-compose.yaml file to increase the plugin execution timeout:

    plugin_daemon:
      environment:
        PLUGIN_MAX_EXECUTION_TIMEOUT: 2400
    
  3. Increase Python Environment Initialization Timeout: Add the following line to your docker-compose.yaml file:

    PYTHON_ENV_INIT_TIMEOUT: 320
    
  4. Remove Proxy Configurations: If you are using proxies, remove any proxy configurations from the plugin-daemon container in docker-compose.yaml.

  5. Use an Earlier Plugin Version: For specific plugins like Tongyi, try using an earlier version (e.g., 0.04) if the latest version causes issues.

  6. Downgrade Dify Services: If the error persists, consider downgrading the dify-api and dify-web services to version 0.15.3 in your docker-compose.yaml file.

  7. Clear Plugin Data and Directories: Execute the following SQL commands in the dify_plugin database to clear plugin data:

    delete from plugin_installations where plugin_unique_identifier is not null;
    delete from plugin_declarations where plugin_unique_identifier is not null;
    delete from ai_model_installations where plugin_unique_identifier is not null;
    delete from plugins where plugin_unique_identifier is not null;
    

    Then, clear the plugin directories in these locations:

    • /app/storage/cwd/plugins/plugin
    • /app/storage/cwd/plugins/plugin-working
    • /app/storage/cwd/plugins/persistence
    • /app/storage/cwd/plugins/plugin-root
  8. Restart and Reinstall Plugins: If increasing the timeout does not resolve the issue, remove the plugin and reinstall it from the marketplace. Restart the plugin daemon service and reinstall the plugins.

After making any of these changes, restart your Docker containers with:

docker compose stop
docker compose up -d

These steps should help resolve the issue by addressing potential timeout and configuration problems [1][2][3][4][5].

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 (Mar 28, 2025): <!-- Answer --> To resolve the "PluginDaemonInternalServerError: no available node, plugin not found" error, try the following steps: 1. **Upgrade to the Latest Version**: Ensure you are using Dify version 1.0.1 or later, as newer releases may include fixes for this issue. 2. **Increase Plugin Execution Timeout**: Modify your `docker-compose.yaml` file to increase the plugin execution timeout: ```yaml plugin_daemon: environment: PLUGIN_MAX_EXECUTION_TIMEOUT: 2400 ``` 3. **Increase Python Environment Initialization Timeout**: Add the following line to your `docker-compose.yaml` file: ```yaml PYTHON_ENV_INIT_TIMEOUT: 320 ``` 4. **Remove Proxy Configurations**: If you are using proxies, remove any proxy configurations from the `plugin-daemon` container in `docker-compose.yaml`. 5. **Use an Earlier Plugin Version**: For specific plugins like Tongyi, try using an earlier version (e.g., 0.04) if the latest version causes issues. 6. **Downgrade Dify Services**: If the error persists, consider downgrading the dify-api and dify-web services to version 0.15.3 in your `docker-compose.yaml` file. 7. **Clear Plugin Data and Directories**: Execute the following SQL commands in the dify_plugin database to clear plugin data: ```sql delete from plugin_installations where plugin_unique_identifier is not null; delete from plugin_declarations where plugin_unique_identifier is not null; delete from ai_model_installations where plugin_unique_identifier is not null; delete from plugins where plugin_unique_identifier is not null; ``` Then, clear the plugin directories in these locations: - /app/storage/cwd/plugins/plugin - /app/storage/cwd/plugins/plugin-working - /app/storage/cwd/plugins/persistence - /app/storage/cwd/plugins/plugin-root 8. **Restart and Reinstall Plugins**: If increasing the timeout does not resolve the issue, remove the plugin and reinstall it from the marketplace. Restart the plugin daemon service and reinstall the plugins. After making any of these changes, restart your Docker containers with: ```bash docker compose stop docker compose up -d ``` These steps should help resolve the issue by addressing potential timeout and configuration problems <sup>[[1]](https://github.com/langgenius/dify/issues/16356)</sup><sup>[[2]](https://github.com/langgenius/dify/issues/14654)</sup><sup>[[3]](https://github.com/langgenius/dify/issues/13777)</sup><sup>[[4]](https://github.com/langgenius/dify/issues/14718)</sup><sup>[[5]](https://github.com/langgenius/dify/issues/14736)</sup>. <!-- 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/96795f82-524f-4e74-b269-42c6fc82fe61?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/96795f82-524f-4e74-b269-42c6fc82fe61?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/96795f82-524f-4e74-b269-42c6fc82fe61?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/96795f82-524f-4e74-b269-42c6fc82fe61?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/96795f82-524f-4e74-b269-42c6fc82fe61?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/96795f82-524f-4e74-b269-42c6fc82fe61?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/96795f82-524f-4e74-b269-42c6fc82fe61?feedback_type=other)</sup>
Author
Owner

@donghanzhi123 commented on GitHub (Mar 28, 2025):

Image

Image

Upgrade the dify version from 0.15.3 to 1.0.0. An error occurs when adding a model. Use the docker environment to deploy

@donghanzhi123 commented on GitHub (Mar 28, 2025): ![Image](https://github.com/user-attachments/assets/48c61f8a-afff-44e7-91f6-a3f5f98d0e68) ![Image](https://github.com/user-attachments/assets/7999f51d-c0fa-4d51-a9a9-dfeb7a697d96) Upgrade the dify version from 0.15.3 to 1.0.0. An error occurs when adding a model. Use the docker environment to deploy
Author
Owner

@lanjinh520 commented on GitHub (Mar 31, 2025):

大佬 V1.1.3 版本 我也碰到这个问题, 这个问题后面你是怎么解决的呢?

Image

@lanjinh520 commented on GitHub (Mar 31, 2025): 大佬 V1.1.3 版本 我也碰到这个问题, 这个问题后面你是怎么解决的呢? ![Image](https://github.com/user-attachments/assets/559fc877-f810-4581-ad89-eff0e6077612)
Author
Owner

@petergithub commented on GitHub (Apr 3, 2025):

Add environment variables below at the end of .env file

PLUGIN_PYTHON_ENV_INIT_TIMEOUT=720
PIP_MIRROR_URL=https://mirrors.aliyun.com/pypi/simple

then

docker compose down && docker compose up -d

@petergithub commented on GitHub (Apr 3, 2025): Add environment variables below at the end of .env file ```sh PLUGIN_PYTHON_ENV_INIT_TIMEOUT=720 PIP_MIRROR_URL=https://mirrors.aliyun.com/pypi/simple ``` then `docker compose down && docker compose up -d`
Author
Owner

@starcatcher commented on GitHub (Apr 14, 2025):

@dosubot This method works for me.Thanks very much.

@starcatcher commented on GitHub (Apr 14, 2025): @dosubot This method works for me.Thanks very much.
Author
Owner

@chuangzhidan commented on GitHub (May 28, 2025):

@dosubot This method works for me.Thanks very much.

can i ask which one? thanks

@chuangzhidan commented on GitHub (May 28, 2025): > @dosubot This method works for me.Thanks very much. can i ask which one? thanks
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#12266