Error reported when connecting to the vllm-launched service using the OpenAI-API-compatible plugin. #297

Closed
opened 2026-02-16 10:18:51 -05:00 by yindo · 3 comments
Owner

Originally created by @suntao2015005848 on GitHub (May 19, 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.4.0

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

The vLLM model is deployed on 10.2.201.8. I tested the API locally using Postman, and it worked fine. Additionally, the Dify instance set up on 10.2.201.8 with OpenAI-API-compatible also functioned normally. However, when I tried to register via OpenAI-API-compatible on my other server at 192.168.42.68, it reported an error. I’m certain there are no network issues between 192.168.42.68 and 10.2.201.8, as the Xinference service on 10.2.201.8 is also accessible to 192.168.42.68.

vllm :
python3 -m vllm.entrypoints.openai.api_server
--model /xinference/my_model/QwQ-32B
--served-model-name QwQ-32B
--tensor-parallel-size 4
--trust-remote-code
--max_model_len 40960
--host 0.0.0.0
--port 8501
--dtype bfloat16
--enable-auto-tool-choice
--tool-call-parser hermes
--gpu-memory-utilization 0.9

Image

erroe report :
docker-api-1 | 2025-05-19 08:19:40.177 ERROR [Dummy-2] [models.py:162] - Failed to save model credentials, tenant_id: 9d679366-403d-4498-9939-2f37e1d25f32, model: QwQ-32B, model_type: llm
docker-api-1 | Traceback (most recent call last):
docker-api-1 | File "/app/api/controllers/console/workspace/models.py", line 154, in post
docker-api-1 | model_provider_service.save_model_credentials(
docker-api-1 | File "/app/api/services/model_provider_service.py", line 237, in save_model_credentials
docker-api-1 | provider_configuration.add_or_update_custom_model_credentials(
docker-api-1 | File "/app/api/core/entities/provider_configuration.py", line 422, in add_or_update_custom_model_credentials
docker-api-1 | provider_model_record, credentials = self.custom_model_credentials_validate(model_type, model, credentials)
docker-api-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
docker-api-1 | File "/app/api/core/entities/provider_configuration.py", line 402, in custom_model_credentials_validate
docker-api-1 | credentials = model_provider_factory.model_credentials_validate(
docker-api-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
docker-api-1 | File "/app/api/core/model_runtime/model_providers/model_provider_factory.py", line 191, in model_credentials_validate
docker-api-1 | self.plugin_model_manager.validate_model_credentials(
docker-api-1 | File "/app/api/core/plugin/impl/model.py", line 137, in validate_model_credentials
docker-api-1 | for resp in response:
docker-api-1 | ^^^^^^^^
docker-api-1 | File "/app/api/core/plugin/impl/base.py", line 192, in _request_with_plugin_daemon_response_stream
docker-api-1 | self._handle_plugin_daemon_error(error.error_type, error.message)
docker-api-1 | File "/app/api/core/plugin/impl/base.py", line 222, in _handle_plugin_daemon_error
docker-api-1 | raise CredentialsValidateFailedError(error_object.get("message"))
docker-api-1 | core.model_runtime.errors.validate.CredentialsValidateFailedError: An error occurred during credentials validation: HTTPConnectionPool(host='10.2.201.8', port=8501): Max retries exceeded with url: /v1/chat/completions (Caused by ConnectTimeoutError(<urllib3.connection.HTTPConnection object at 0x7ff1d51198b0>, 'Connection to 10.2.201.8 timed out. (connect timeout=10)'))

✔️ Expected Behavior

No response

Actual Behavior

error

Originally created by @suntao2015005848 on GitHub (May 19, 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.4.0 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce The vLLM model is deployed on 10.2.201.8. I tested the API locally using Postman, and it worked fine. Additionally, the Dify instance set up on 10.2.201.8 with OpenAI-API-compatible also functioned normally. However, when I tried to register via OpenAI-API-compatible on my other server at 192.168.42.68, it reported an error. I’m certain there are no network issues between 192.168.42.68 and 10.2.201.8, as the Xinference service on 10.2.201.8 is also accessible to 192.168.42.68. vllm : python3 -m vllm.entrypoints.openai.api_server \ --model /xinference/my_model/QwQ-32B \ --served-model-name QwQ-32B \ --tensor-parallel-size 4 \ --trust-remote-code \ --max_model_len 40960 \ --host 0.0.0.0 \ --port 8501 \ --dtype bfloat16 \ --enable-auto-tool-choice \ --tool-call-parser hermes \ --gpu-memory-utilization 0.9 ![Image](https://github.com/user-attachments/assets/038df363-bad7-4d55-b885-f14432ab1828) erroe report : docker-api-1 | 2025-05-19 08:19:40.177 ERROR [Dummy-2] [models.py:162] - Failed to save model credentials, tenant_id: 9d679366-403d-4498-9939-2f37e1d25f32, model: QwQ-32B, model_type: llm docker-api-1 | Traceback (most recent call last): docker-api-1 | File "/app/api/controllers/console/workspace/models.py", line 154, in post docker-api-1 | model_provider_service.save_model_credentials( docker-api-1 | File "/app/api/services/model_provider_service.py", line 237, in save_model_credentials docker-api-1 | provider_configuration.add_or_update_custom_model_credentials( docker-api-1 | File "/app/api/core/entities/provider_configuration.py", line 422, in add_or_update_custom_model_credentials docker-api-1 | provider_model_record, credentials = self.custom_model_credentials_validate(model_type, model, credentials) docker-api-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ docker-api-1 | File "/app/api/core/entities/provider_configuration.py", line 402, in custom_model_credentials_validate docker-api-1 | credentials = model_provider_factory.model_credentials_validate( docker-api-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ docker-api-1 | File "/app/api/core/model_runtime/model_providers/model_provider_factory.py", line 191, in model_credentials_validate docker-api-1 | self.plugin_model_manager.validate_model_credentials( docker-api-1 | File "/app/api/core/plugin/impl/model.py", line 137, in validate_model_credentials docker-api-1 | for resp in response: docker-api-1 | ^^^^^^^^ docker-api-1 | File "/app/api/core/plugin/impl/base.py", line 192, in _request_with_plugin_daemon_response_stream docker-api-1 | self._handle_plugin_daemon_error(error.error_type, error.message) docker-api-1 | File "/app/api/core/plugin/impl/base.py", line 222, in _handle_plugin_daemon_error docker-api-1 | raise CredentialsValidateFailedError(error_object.get("message")) docker-api-1 | core.model_runtime.errors.validate.CredentialsValidateFailedError: An error occurred during credentials validation: HTTPConnectionPool(host='10.2.201.8', port=8501): Max retries exceeded with url: /v1/chat/completions (Caused by ConnectTimeoutError(<urllib3.connection.HTTPConnection object at 0x7ff1d51198b0>, 'Connection to 10.2.201.8 timed out. (connect timeout=10)')) ### ✔️ Expected Behavior _No response_ ### ❌ Actual Behavior error
yindo closed this issue 2026-02-16 10:18:51 -05:00
Author
Owner

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

I found a similar resolved issue that might help you. The suggested solution for a similar problem was to ensure that containers spawned by Docker Compose do not inherit HTTP proxy settings from the Docker host, as this can cause connectivity issues. Additionally, before using the OpenAI-API-compatible model, you should turn on LAN services in LM Studio's settings and verify that the API endpoint URL is correctly set [1].

In your case, the error message indicates a ConnectTimeoutError, which suggests that the service at http://10.2.201.8:8501/v1 is not reachable. Here are a few steps you can take to troubleshoot this issue:

  1. Check Network Connectivity: Ensure that the machine running the Docker container can reach the IP address 10.2.201.8 on port 8501. You can use tools like ping or curl to test connectivity.

  2. Verify Service Availability: Make sure that the service you are trying to connect to is running and listening on the specified IP and port. You can check this by accessing the endpoint directly from a browser or using a tool like curl.

  3. Review Docker Network Settings: If you are using Docker, ensure that the network settings allow communication between the containers and the host network.

  4. Check Proxy Settings: If your environment uses a proxy, ensure that the proxy settings are correctly configured and not interfering with the connection.

  5. Increase Timeout: If the service is slow to respond, consider increasing the connection timeout settings in your application to allow more time for the connection to be established.

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 19, 2025): <!-- Answer --> I found a similar resolved issue that might help you. The suggested solution for a similar problem was to ensure that containers spawned by Docker Compose do not inherit HTTP proxy settings from the Docker host, as this can cause connectivity issues. Additionally, before using the OpenAI-API-compatible model, you should turn on LAN services in LM Studio's settings and verify that the API endpoint URL is correctly set <sup>[[1]](https://github.com/langgenius/dify/issues/14231)</sup>. In your case, the error message indicates a `ConnectTimeoutError`, which suggests that the service at `http://10.2.201.8:8501/v1` is not reachable. Here are a few steps you can take to troubleshoot this issue: 1. **Check Network Connectivity**: Ensure that the machine running the Docker container can reach the IP address `10.2.201.8` on port `8501`. You can use tools like `ping` or `curl` to test connectivity. 2. **Verify Service Availability**: Make sure that the service you are trying to connect to is running and listening on the specified IP and port. You can check this by accessing the endpoint directly from a browser or using a tool like `curl`. 3. **Review Docker Network Settings**: If you are using Docker, ensure that the network settings allow communication between the containers and the host network. 4. **Check Proxy Settings**: If your environment uses a proxy, ensure that the proxy settings are correctly configured and not interfering with the connection. 5. **Increase Timeout**: If the service is slow to respond, consider increasing the connection timeout settings in your application to allow more time for the connection to be established. <!-- 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/d8e419b9-a8ec-4ff0-b5a0-ba49cbbfb2d7?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/d8e419b9-a8ec-4ff0-b5a0-ba49cbbfb2d7?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/d8e419b9-a8ec-4ff0-b5a0-ba49cbbfb2d7?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/d8e419b9-a8ec-4ff0-b5a0-ba49cbbfb2d7?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/d8e419b9-a8ec-4ff0-b5a0-ba49cbbfb2d7?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/d8e419b9-a8ec-4ff0-b5a0-ba49cbbfb2d7?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/d8e419b9-a8ec-4ff0-b5a0-ba49cbbfb2d7?feedback_type=other)</sup>
Author
Owner

@suntao2015005848 commented on GitHub (May 19, 2025):

@dosu The vLLM model is deployed on 10.2.201.8. I tested the API locally using Postman, and it worked fine. Additionally, the Dify instance set up on 10.2.201.8 with OpenAI-API-compatible also functioned normally. However, when I tried to register via OpenAI-API-compatible on my other server at 192.168.42.68, it reported an error. I’m certain there are no network issues between 192.168.42.68 and 10.2.201.8, as the Xinference service on 10.2.201.8 is also accessible to 192.168.42.68.

@suntao2015005848 commented on GitHub (May 19, 2025): @dosu The vLLM model is deployed on 10.2.201.8. I tested the API locally using Postman, and it worked fine. Additionally, the Dify instance set up on 10.2.201.8 with OpenAI-API-compatible also functioned normally. However, when I tried to register via OpenAI-API-compatible on my other server at 192.168.42.68, it reported an error. I’m certain there are no network issues between 192.168.42.68 and 10.2.201.8, as the Xinference service on 10.2.201.8 is also accessible to 192.168.42.68.
Author
Owner

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

The error you're encountering might be related to the ConnectTimeoutError, which can occur due to several reasons. Here are some steps to help troubleshoot and resolve the issue:

  1. Verify API Endpoint Configuration: Ensure that the API endpoint URL is correctly configured in Dify for the OpenAI-API-compatible service. Double-check the endpoint URL and make sure it matches the one you tested successfully with Postman.

  2. Network Configuration: Although you mentioned there are no network issues, it's worth verifying that the Docker container on server 192.168.42.68 can indeed reach 10.2.201.8 on port 8501. You can use curl or telnet from within the Docker container to test connectivity.

  3. Docker Network Settings: Ensure that the Docker network settings allow communication between the containers and the host network. You might need to adjust the Docker Compose network configuration to ensure proper routing.

  4. Proxy Settings: Check if there are any proxy settings configured in your environment that might be affecting the connection. Proxy settings can sometimes lead to connection issues.

  5. Timeout Settings: Consider increasing the connection timeout settings in Dify. The default connection timeout is 10 seconds, which might be insufficient if the service is slow to respond. You can adjust these settings in the CodeExecutionSandboxConfig class within the api/configs/feature/__init__.py file [1].

By following these steps, you should be able to identify and resolve the connectivity issue between your servers.

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 19, 2025): <!-- Answer --> The error you're encountering might be related to the `ConnectTimeoutError`, which can occur due to several reasons. Here are some steps to help troubleshoot and resolve the issue: 1. **Verify API Endpoint Configuration**: Ensure that the API endpoint URL is correctly configured in Dify for the OpenAI-API-compatible service. Double-check the endpoint URL and make sure it matches the one you tested successfully with Postman. 2. **Network Configuration**: Although you mentioned there are no network issues, it's worth verifying that the Docker container on server `192.168.42.68` can indeed reach `10.2.201.8` on port `8501`. You can use `curl` or `telnet` from within the Docker container to test connectivity. 3. **Docker Network Settings**: Ensure that the Docker network settings allow communication between the containers and the host network. You might need to adjust the Docker Compose network configuration to ensure proper routing. 4. **Proxy Settings**: Check if there are any proxy settings configured in your environment that might be affecting the connection. Proxy settings can sometimes lead to connection issues. 5. **Timeout Settings**: Consider increasing the connection timeout settings in Dify. The default connection timeout is 10 seconds, which might be insufficient if the service is slow to respond. You can adjust these settings in the `CodeExecutionSandboxConfig` class within the `api/configs/feature/__init__.py` file <sup>[[1]](https://github.com/langgenius/dify/blob/main/api/configs/feature/__init__.py)</sup>. By following these steps, you should be able to identify and resolve the connectivity issue between your servers. <!-- 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/69f52860-b5e5-46f8-8660-f9478e928d42?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/69f52860-b5e5-46f8-8660-f9478e928d42?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/69f52860-b5e5-46f8-8660-f9478e928d42?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/69f52860-b5e5-46f8-8660-f9478e928d42?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/69f52860-b5e5-46f8-8660-f9478e928d42?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/69f52860-b5e5-46f8-8660-f9478e928d42?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/69f52860-b5e5-46f8-8660-f9478e928d42?feedback_type=other)</sup>
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify-official-plugins#297