When configuring the Ollama text embedding model in the model provider, a HTTPSConnectionPool(host='openaipublic.blob.core.windows.net', port=443): Max retries exceeded with url: /gpt-2/encodings/main/vocab.bpe occurred. #9086

Closed
opened 2026-02-21 18:30:28 -05:00 by yindo · 0 comments
Owner

Originally created by @dong6255 on GitHub (Mar 4, 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

main

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

Currently, I am deploying the Dify application in a local area network (LAN) environment using Docker. When configuring the Ollama embedding model, I encountered an error message in the screenshot.

Image

Additionally, when interacting with the Ollama model, the same error appears in the dify-api container.

Image

The complete error message is as follows.

2025-03-04 07:56:36.534 ERROR [Dummy-4] [models.py:162] - Failed to save model credentials, tenant_id: 91103fde-def7-4f6d-9723-2e856658c2a9, model: nomic-embed-text:v1.5, model_type: text-embedding
Traceback (most recent call last):
  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 406, 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 386, 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 190, 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 219, in _handle_plugin_daemon_error
    raise CredentialsValidateFailedError(error_object.get("message"))
core.model_runtime.errors.validate.CredentialsValidateFailedError: An error occurred during credentials validation: HTTPSConnectionPool(host='openaipublic.blob.core.windows.net', port=443): Max retries exceeded with url: /gpt-2/encodings/main/vocab.bpe (Caused by NameResolutionError("<urllib3.connection.HTTPSConnection object at 0x7f09404e5910>: Failed to resolve 'openaipublic.blob.core.windows.net' ([Errno -3] Temporary failure in name resolution)"))

I have tried various solutions mentioned in the issues section, such as

  1. I copied the jieba.cache file from the /tmp directory on a machine with internet access and mounted it to the Docker container on the LAN server.

Image

  1. I modified the HTTP path in the openai_public file under the/app/api/.venv/lib/python3.12/site-packages/tiktoken_ext/openai_public.py directory, changed it to an absolute path, and placed the file in the .tiktoken directory.
def gpt2():
    mergeable_ranks = data_gym_to_mergeable_bpe_ranks(
        vocab_bpe_file="/tmp/vocab.bpe",
        encoder_json_file="/tmp/encoder.json",
        vocab_bpe_hash="1ce1664773c50f3e0cc8842619a93edc4624525b728b188a9e0be33b7726adc5",
        encoder_json_hash="196139668be63f3b5d6574427317ae82f612a97c5d1cdaf36ed2256dbf636783",
    )
    return {
        "name": "gpt2",
        "explicit_n_vocab": 50257,
        "pat_str": r50k_pat_str,
        "mergeable_ranks": mergeable_ranks,
        "special_tokens": {ENDOFTEXT: 50256},
    }

Image

It is worth mentioning that when I deploy Dify on a server with internet access (Windows Docker), then disconnect the network and restart the Dify container, the error does not appear. I'm not sure if this information is helpful for troubleshooting.

So what other methods should I try to use Dify on a local area network

✔️ Expected Behavior

No response

Actual Behavior

No response

Originally created by @dong6255 on GitHub (Mar 4, 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 main ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce Currently, I am deploying the Dify application in a local area network (LAN) environment using Docker. When configuring the Ollama embedding model, I encountered an error message in the screenshot. ![Image](https://github.com/user-attachments/assets/3cd6edeb-b9c9-412e-b3f6-23532bf1892e) Additionally, when interacting with the Ollama model, the same error appears in the dify-api container. ![Image](https://github.com/user-attachments/assets/0561fece-aadf-4cca-a696-674f526b0a56) The complete error message is as follows. ``` 2025-03-04 07:56:36.534 ERROR [Dummy-4] [models.py:162] - Failed to save model credentials, tenant_id: 91103fde-def7-4f6d-9723-2e856658c2a9, model: nomic-embed-text:v1.5, model_type: text-embedding Traceback (most recent call last): 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 406, 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 386, 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 190, 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 219, in _handle_plugin_daemon_error raise CredentialsValidateFailedError(error_object.get("message")) core.model_runtime.errors.validate.CredentialsValidateFailedError: An error occurred during credentials validation: HTTPSConnectionPool(host='openaipublic.blob.core.windows.net', port=443): Max retries exceeded with url: /gpt-2/encodings/main/vocab.bpe (Caused by NameResolutionError("<urllib3.connection.HTTPSConnection object at 0x7f09404e5910>: Failed to resolve 'openaipublic.blob.core.windows.net' ([Errno -3] Temporary failure in name resolution)")) ``` I have tried various solutions mentioned in the issues section, such as 1. I copied the jieba.cache file from the /tmp directory on a machine with internet access and mounted it to the Docker container on the LAN server. ![Image](https://github.com/user-attachments/assets/c087dcfd-0405-4631-a2ff-788843b0f38e) 2. I modified the HTTP path in the openai_public file under the/app/api/.venv/lib/python3.12/site-packages/tiktoken_ext/openai_public.py directory, changed it to an absolute path, and placed the file in the .tiktoken directory. ``` def gpt2(): mergeable_ranks = data_gym_to_mergeable_bpe_ranks( vocab_bpe_file="/tmp/vocab.bpe", encoder_json_file="/tmp/encoder.json", vocab_bpe_hash="1ce1664773c50f3e0cc8842619a93edc4624525b728b188a9e0be33b7726adc5", encoder_json_hash="196139668be63f3b5d6574427317ae82f612a97c5d1cdaf36ed2256dbf636783", ) return { "name": "gpt2", "explicit_n_vocab": 50257, "pat_str": r50k_pat_str, "mergeable_ranks": mergeable_ranks, "special_tokens": {ENDOFTEXT: 50256}, } ``` ![Image](https://github.com/user-attachments/assets/8b89e540-e2a6-4690-ba06-b7d24e873632) It is worth mentioning that when I deploy Dify on a server with internet access (Windows Docker), then disconnect the network and restart the Dify container, the error does not appear. I'm not sure if this information is helpful for troubleshooting. So what other methods should I try to use Dify on a local area network ### ✔️ Expected Behavior _No response_ ### ❌ Actual Behavior _No response_
yindo added the 🐞 bug label 2026-02-21 18:30:28 -05:00
yindo closed this issue 2026-02-21 18:30:28 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#9086