bfcadd() fails when checksum URL returns a non-404 error (e.g., HTTP 500)
まだ誰も着手していません。
評価
調査の方向性
BiocFileCache の R ソースにある .verify_download_checksum() から始めます。これは省略可能な <url>.sha256 と <url>.md5 のリクエストを httr2 経由で処理します。miRBase の URL に対して bfcadd() の例で再現し、その後、非 2xx のチェックサム応答とリクエストエラーを「チェックサムが利用できない」という意味に変更します。ただし、実際の不一致や部分ダウンロードに対する失敗は保持します。完了とは、GFF3 のダウンロードが中止される代わりにメッセージ/警告付きで成功し、パッケージのテストが引き続き通ることです。
索引モデルが issue の本文から書いたものです。
説明
Description
Since 3.3.1 ("Check md5sum or sha if available"), .verify_download_checksum()
requests <url>.sha256 and <url>.md5 after a download. Only HTTP 404/410
are treated as "checksum not available"; any other non-2xx status raises an
error. That makes the whole download fail, and the resource is removed from
the cache.
Some servers return 5xx (or 403, etc.) for files that don't exist. miRBase
is one example:
https://www.mirbase.org/download/hsa.gff3 -> 200
https://www.mirbase.org/download/hsa.gff3.sha256 -> 500
https://www.mirbase.org/download/hsa.gff3.md5 -> 500
Reproducible example
library(BiocFileCache)
bfc <- BiocFileCache(tempfile(), ask = FALSE)
bfcadd(bfc, rname = "https://www.mirbase.org/download/hsa.gff3",
rtype = "web", download = TRUE)
#> Error: bfcadd() failed; see warnings()
warnings()
#> download failed
#> web resource path: 'https://www.mirbase.org/download/hsa.gff3'
#> ...
#> reason: Could not retrieve sha256 checksum: HTTP 500
The file itself downloads fine (curl, download.file(), and BiocFileCache
before 3.3.1 all work).
Expected behavior
The checksum is optional ("if available"), so failing to retrieve one
should not abort a download that succeeded. Only an actual checksum
mismatch (or a partial download) should be an error. Suggested change: in
.verify_download_checksum(), treat any non-2xx status for the checksum URL,
and any request error (e.g., wrap req_perform() in tryCatch()), as "no
checksum available" and move on to the next algorithm, perhaps with a
message()/warning(), rather than calling stop().
This currently breaks downstream vignettes on the devel build (e.g., Bioc.gff,
which caches the miRBase GFF3 with bfcadd()).
Session info
- BiocFileCache 3.3.2
- httr2 1.3.0
- R 4.6 / Bioconductor devel
- 主要言語
- R
- スター
- 14
- フォーク
- 9
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
Bioconductor/BiocFileCache のほかの issue
-
難易度 3/5 1〜2日 初心者へのやさしさ 67/100
Bioconductor/BiocFileCache#75 · コメント 1 件 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
Bioconductor/BiocFileCache#72 · コメント 3 件 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 25/100
Bioconductor/BiocFileCache#66 · コメント 16 件 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
Bioconductor/BiocFileCache#60 · コメント 3 件 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 30/100
Bioconductor/BiocFileCache の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
HelenaLC/spatialdataR#295 ·
-
size-time-budget
難易度 2/5 1〜3時間 初心者へのやさしさ 69/100
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
Openscapes/blogscapes#61 ·
メンテナーはふだん 1 日以内に返信
-
bug posit-ai
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100