Here is the core code snippet I used to download the model files. Since my machine cannot connect to the public internet directly, I have set up an HTTP proxy in the code.
$ python file_download.py
tokenizer.json: 0%| | 0.00/11.4M [00:00<?, ?B/s]{"timestamp":"2025-06-09T12:32:41.363157Z","level":"WARN","fields":{"message":"Reqwest(reqwest::Error { kind: Request, url: \"https://cas-server.xethub.hf.co/reconstruction/6aec39639a0a2d1ca966356b8c2b8426a484f80ff80731f44fa8482040713bdf\", source: hyper_util::client::legacy::Error(Connect, ConnectError(\"dns error\", Custom { kind: Uncategorized, error: \"failed to lookup address information: Temporary failure in name resolution\" })) }). Retrying..."},"filename":"/home/runner/work/xet-core/xet-core/cas_client/src/http_client.rs","line_number":200}
{"timestamp":"2025-06-09T12:32:41.363213Z","level":"WARN","fields":{"message":"Retry attempt #0. Sleeping 1.053998972s before the next attempt"},"filename":"/root/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/reqwest-retry-0.7.0/src/middleware.rs","line_number":171}
{"timestamp":"2025-06-09T12:32:42.435602Z","level":"WARN","fields":{"message":"Reqwest(reqwest::Error { kind: Request, url: \"https://cas-server.xethub.hf.co/reconstruction/6aec39639a0a2d1ca966356b8c2b8426a484f80ff80731f44fa8482040713bdf\", source: hyper_util::client::legacy::Error(Connect, ConnectError(\"dns error\", Custom { kind: Uncategorized, error: \"failed to lookup address information: Temporary failure in name resolution\" })) }). Retrying..."},"filename":"/home/runner/work/xet-core/xet-core/cas_client/src/http_client.rs","line_number":200}
{"timestamp":"2025-06-09T12:32:42.435636Z","level":"WARN","fields":{"message":"Retry attempt #1. Sleeping 1.606925917s before the next attempt"},"filename":"/root/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/reqwest-retry-0.7.0/src/middleware.rs","line_number":171}
{"timestamp":"2025-06-09T12:32:44.061634Z","level":"WARN","fields":{"message":"Reqwest(reqwest::Error { kind: Request, url: \"https://cas-server.xethub.hf.co/reconstruction/6aec39639a0a2d1ca966356b8c2b8426a484f80ff80731f44fa8482040713bdf\", source: hyper_util::client::legacy::Error(Connect, ConnectError(\"dns error\", Custom { kind: Uncategorized, error: \"failed to lookup address information: Temporary failure in name resolution\" })) }). Retrying..."},"filename":"/home/runner/work/xet-core/xet-core/cas_client/src/http_client.rs","line_number":200}
{"timestamp":"2025-06-09T12:32:44.061664Z","level":"WARN","fields":{"message":"Retry attempt #2. Sleeping 10.395844705s before the next attempt"},"filename":"/root/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/reqwest-retry-0.7.0/src/middleware.rs","line_number":171}
{"timestamp":"2025-06-09T12:32:54.482074Z","level":"WARN","fields":{"message":"Reqwest(reqwest::Error { kind: Request, url: \"https://cas-server.xethub.hf.co/reconstruction/6aec39639a0a2d1ca966356b8c2b8426a484f80ff80731f44fa8482040713bdf\", source: hyper_util::client::legacy::Error(Connect, ConnectError(\"dns error\", Custom { kind: Uncategorized, error: \"failed to lookup address information: Temporary failure in name resolution\" })) }). Retrying..."},"filename":"/home/runner/work/xet-core/xet-core/cas_client/src/http_client.rs","line_number":200}
{"timestamp":"2025-06-09T12:32:54.482106Z","level":"WARN","fields":{"message":"Retry attempt #3. Sleeping 23.1864274s before the next attempt"},"filename":"/root/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/reqwest-retry-0.7.0/src/middleware.rs","line_number":171}
{"timestamp":"2025-06-09T12:33:17.684544Z","level":"WARN","fields":{"message":"Reqwest(reqwest::Error { kind: Request, url: \"https://cas-server.xethub.hf.co/reconstruction/6aec39639a0a2d1ca966356b8c2b8426a484f80ff80731f44fa8482040713bdf\", source: hyper_util::client::legacy::Error(Connect, ConnectError(\"dns error\", Custom { kind: Uncategorized, error: \"failed to lookup address information: Temporary failure in name resolution\" })) }). Retrying..."},"filename":"/home/runner/work/xet-core/xet-core/cas_client/src/http_client.rs","line_number":200}
{"timestamp":"2025-06-09T12:33:17.684571Z","level":"WARN","fields":{"message":"Retry attempt #4. Sleeping 38.695224788s before the next attempt"},"filename":"/root/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/reqwest-retry-0.7.0/src/middleware.rs","line_number":171}
{"timestamp":"2025-06-09T12:33:56.402793Z","level":"WARN","fields":{"message":"Reqwest(reqwest::Error { kind: Request, url: \"https://cas-server.xethub.hf.co/reconstruction/6aec39639a0a2d1ca966356b8c2b8426a484f80ff80731f44fa8482040713bdf\", source: hyper_util::client::legacy::Error(Connect, ConnectError(\"dns error\", Custom { kind: Uncategorized, error: \"failed to lookup address information: Temporary failure in name resolution\" })) }). Retrying..."},"filename":"/home/runner/work/xet-core/xet-core/cas_client/src/http_client.rs","line_number":200}
{"timestamp":"2025-06-09T12:33:56.402865Z","level":"ERROR","fields":{"message":"error invoking get_reconstruction api, error: ReqwestMiddlewareError(Middleware(Request failed after 5 retries\n\nCaused by:\n 0: error sending request for url (https://cas-server.xethub.hf.co/reconstruction/6aec39639a0a2d1ca966356b8c2b8426a484f80ff80731f44fa8482040713bdf)\n 1: client error (Connect)\n 2: dns error: failed to lookup address information: Temporary failure in name resolution\n 3: failed to lookup address information: Temporary failure in name resolution))","caller":"/home/runner/work/xet-core/xet-core/cas_client/src/http_client.rs:286"},"filename":"/home/runner/work/xet-core/xet-core/error_printer/src/lib.rs","line_number":28}
tokenizer.json: 0%|
Traceback (most recent call last):
File "/home/hadoop-aipnlp/projects/nlp-llm-tools/file_download.py", line 29, in <module>
hf_hub_download(
File "/home/hadoop-aipnlp/conda/envs/llm/lib/python3.12/site-packages/huggingface_hub/utils/_validators.py", line 114, in _inner_fn
return fn(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^
File "/home/hadoop-aipnlp/conda/envs/llm/lib/python3.12/site-packages/huggingface_hub/file_download.py", line 988, in hf_hub_download
return _hf_hub_download_to_local_dir(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/hadoop-aipnlp/conda/envs/llm/lib/python3.12/site-packages/huggingface_hub/file_download.py", line 1290, in _hf_hub_download_to_local_dir
_download_to_tmp_and_move(
File "/home/hadoop-aipnlp/conda/envs/llm/lib/python3.12/site-packages/huggingface_hub/file_download.py", line 1710, in _download_to_tmp_and_move
xet_get(
File "/home/hadoop-aipnlp/conda/envs/llm/lib/python3.12/site-packages/huggingface_hub/file_download.py", line 627, in xet_get
download_files(
RuntimeError: Data processing error: CAS service error : ReqwestMiddleware Error: Request failed after 5 retries
Describe the bug
I encountered a DNS error when using the API from
huggingface_hubto download model files from HuggingFace. This issue only occurs with files stored using xet storage—files stored with LFS or regular git can be downloaded without any problems.Here is the core code snippet I used to download the model files. Since my machine cannot connect to the public internet directly, I have set up an HTTP proxy in the code.
Could you please advise me on how to resolve this issue? Thank you!
Reproduction
Logs
System info