Repository navigation
Explain certificate errors when a model download fails - #321
Draft
gerardo-navarro wants to merge 3 commits into
Draft
gerardo-navarro wants to merge 3 commits into
gerardo-navarro wants to merge 3 commits into
Conversation
Behind a proxy that re-signs HTTPS traffic, the download failed with a long requests/urllib3 traceback. Detect the certificate failure in the exception chain and raise ModelDownloadError, which names the model and points to the offline install docs. Refs #318
The unit CI job installs neither requests nor urllib3, so importing them in the test failed with ModuleNotFoundError.
gerardo-navarro
force-pushed
the
feature_offline_model_docs
branch
from
October 27, 2026 09:08
194fc8f to
171249c
Compare
gerardo-navarro
force-pushed
the
bugfixes_ssl_error_message
branch
from
October 27, 2026 09:08
2affa0a to
4e55246
Compare
… bugfixes_ssl_error_message # Conflicts: # tests/unit/test_load_resources.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Behind a proxy that re-signs HTTPS traffic (#318), a model download fails with a long
requests/urllib3traceback that ends inCERTIFICATE_VERIFY_FAILED. Users cannot tell what to do from it.download_modelnow detects a certificate failure anywhere in the exception chain and raisesModelDownloadError:raise ... from error), so the traceback in the dialog still shows the details.__cause__,__context__,reasonandargs. urllib3 keeps thessl.SSLCertVerificationErrorinargsrather than chaining it. Walking the chain also covershttpxoncehuggingface_hub1.x lands (Upgrade to Transformers 5.17 and Hugging Face Hub 1.33 #286).Stacked on #320: the message links to
docs/offline-model-install.md, which #320 adds. Base isfeature_offline_model_docs; retarget todeveloponce #320 is merged.References
Refs #318, depends on #320, related to #319
Screenshots / Examples
Real chain from
requestsbehind a TLS-inspecting proxy:_is_certificate_errorreturnsTruefor it,Falsefor e.g.OSError("connection lost").Verification Steps
uv run --no-sync pytest tests/unit/test_load_resources.py: 2 new tests fail without the change, all 5 pass with it.requestscall through a TLS-inspecting proxy (not just the constructed chain in the test).ruff check,ruff format --check, bandit clean.tinyshows the new message.