Raise with more info on 416 invalid range #2449
Merged
+5
−0
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.
Should help investigate #2248 and this convo (private slack).
From time to time we get reported that a 416 Range Not Satisfiable is raised. This PR adds more information to the raised error (requested range + response content range, if any). Should help investigate the issue.
Example:
huggingface_hub.utils._errors.HfHubHTTPError: 416 Client Error: Range Not Satisfiable for url: https://huggingface.co/datasets/open-llm-leaderboard/results/resolve/6a8ff66a20da618386689e7e7c9c76932f0c33bf/.gitattributes. Requested range: bytes=5000-10000. Content-Range: bytes */2307. (Request ID: Root=1-66bca67b-6ad70d2e5d2917ce5d09d6b4;ffa33b3a-74de-4d8b-9d96-b240d7f8ebe6)