bfcadd() fails when checksum URL returns a non-404 error (e.g., HTTP 500)
还没有人认领这个 Issue。
评估
调研方向
从 BiocFileCache 的 R 源码中的 .verify_download_checksum() 开始,它通过 httr2 处理可选的 <url>.sha256 和 <url>.md5 请求。使用 bfcadd() 示例针对 miRBase URL 复现,然后将非 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 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
Bioconductor/BiocFileCache 的其他 Issue
-
难度 3/5 1-2 天 新手友好度 67/100
Bioconductor/BiocFileCache#75 · 1 条评论 ·
-
难度 5/5 一周以上 新手友好度 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