mirror of
https://github.com/langgenius/dify-docs-archived.git
synced 2026-07-01 20:35:52 -04:00
Timeout Error When Adding Ollama Model in Dify 1.1.0 (PluginDaemonInternalServerError: killed by timeout) #116
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @zanghaibin on GitHub (Mar 20, 2025).
When attempting to integrate an Ollama model with Dify v1.1.0, the system throws a timeout error during credential validation. The error occurs specifically when calling the /console/api/workspaces/current/model-providers/langgenius/ollama/ollama/models endpoint.
Environment
Dify Version: 1.1.0
Deployment: Docker
Model Provider: Ollama
OS: centos7.9
Error Log
2025-03-20 12:57:21.622 ERROR [Dummy-8] [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@dosubot[bot] commented on GitHub (Mar 20, 2025):
Hey @zanghaibin! I'm here to help you out with the issue you're experiencing. Let's work together to solve this puzzle!
To resolve the timeout error (PluginDaemonInternalServerError: killed by timeout) when adding an Ollama model in Dify v1.1.0 on a CentOS 7.9 environment using Docker, ensure that the Ollama service is accessible from the Docker container. This error often occurs due to network configuration issues.
Here are the steps to address this:
Expose Ollama Service to the Network:
localhostbut is accessible on the network. Set theOLLAMA_HOSTenvironment variable to0.0.0.0.Edit the systemd Service:
[Service]section:Use
host.docker.internal:localhostwithhost.docker.internalin your service configuration to ensure Docker can access the host network:These steps should help resolve the timeout error by ensuring the Ollama service is correctly exposed and accessible from the Docker environment [1].
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