Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Range resume corrupts files: a 200 response that serves the requested range is treated as a restart

オープン
#50 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
68/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
静か
技術スタック
python

調査の方向性

_download_with_resume エントリーポイントから開始し、レスポンスのステータスとヘッダーによって書き込みモードと既存のオフセットがどのように決定されるかを調べます。issue に記載された ModelScope のレスポンスを再現し、再開されたダウンロードが切り詰められたりずれたりせず、完了したファイルが SHA-256 チェックに合格することを検証します。

索引モデルが issue の本文から書いたものです。

説明

The ModelScope file endpoint answers a Range request with 200 OK instead of 206 Partial Content, even though it does serve only the requested slice:

curl -sL -o /dev/null -D -  
-H 'Range: bytes=1000000000-1000000099' 
'https://www.modelscope.cn/api/v1/models/Qwen/Qwen3-VL-8B-Instruct/repo?Revision=master&FilePath=model-00002-of-00004.safetensors'

Returned:

HTTP/1.1 200 OK
Server: nginx/1.24.0
Content-Length: 100
Accept-Ranges: bytes
Content-Range: bytes 1000000000-1000000099/4915962496

100 bytes requested, 100 bytes returned, correct Content-Range — the range is honoured. Only the status code is wrong. Per RFC 9110 §15.3.7 this should be 206.

And it may break the SDK

_download_with_resume decides whether a response is a resume from the status code alone.

is_resumed = resp.status_code == 206
...
mode = "ab" if is_resumed else "wb"
if not is_resumed:
    existing_size = 0

So on every resume is_resumed is False, and the .incomplete file is truncated (wb) — but the server is still sending from the requested offset, so mid-file bytes get written at offset 0. The result is a file that is both short and shifted. Nothing notices until the SHA-256 check rejects it, which then deletes the file and restarts from byte 0.

In one run over an unreliable link, /proc//io showed 30.9 GB written for a 17.5 GB model, with 6.1 GB retained.

主要言語
Python
スター
15
フォーク
9
平均マージ
17時間 7分
マージ済み PR(30日)
8

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

modelscope/modelscope_hub のほかの issue

modelscope/modelscope_hub の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。