Sample finish_uploading_large_file uses the wrong sha1 and fails its resume check
メンテナーはふだん 3 日以内に返信
評価
調査の方向性
Start with the setSha1 call at samples/src/main/java/com/backblaze/b2/sample/B2.java lines 576-579, then the resume check at core/src/main/java/com/backblaze/b2/client/B2LargeFileUploader.java line 127, which compares against getLargeFileSha1OrNull(). Open PR #262 already targets this, so review that before writing a patch. Done means the sample passes the value the check expects, so resume no longer fails with mismatch.
索引モデルが issue の本文から書いたものです。
説明
What happens
The finish_uploading_large_file sample command sets the content source's sha1 from largeFileVersion.getContentSha1(). For a large file the server reports none there, while the resume check compares the source sha1 with the stored large_file_sha1 info value. The check then rejects the resume with a mismatch error.
Where
samples/src/main/java/com/backblaze/b2/sample/B2.java:576-579 (.setSha1(largeFileVersion.getContentSha1())); the check is at core/src/main/java/com/backblaze/b2/client/B2LargeFileUploader.java:127; the SDK itself notes that sha1 is none for large files at core/src/main/java/com/backblaze/b2/client/contentHandlers/B2ContentWriter.java:152.
Why it matters
Impact: Docs and messages (a sample command that does not work), loud. Severity: Low, because it only affects a sample command and fails with a clear error, and nothing is harmed.
How to check
Found by reading the code, not reproduced. Read the sample and the check: the check compares against getLargeFileSha1OrNull(), but the sample passes getContentSha1(). Using getLargeFileSha1OrNull() or computing the sha1 from the local file would match.
Version
Seen at v6.5.0. Present on the default branch: present.
- 主要言語
- Java
- スター
- 103
- フォーク
- 23
- 平均マージ
- 5日 8時間
- マージ済み PR(30日)
- 3
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
Backblaze/b2-sdk-java のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
Backblaze/b2-sdk-java#248 ·
メンテナーはふだん 3 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
Backblaze/b2-sdk-java#247 ·
メンテナーはふだん 3 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
Backblaze/b2-sdk-java#246 ·
メンテナーはふだん 3 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
Backblaze/b2-sdk-java#245 ·
メンテナーはふだん 3 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
Backblaze/b2-sdk-java#242 ·
メンテナーはふだん 3 日以内に返信
Backblaze/b2-sdk-java の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
IETF-Hackathon/pqc-certificates#351 ·
メンテナーはふだん 2 日以内に返信
-
bug(core): skip_nodes.json is missing SELECT and PRE, causing Python and Java to insert separators into dropdown options and preformatted text対応中かも @Bhumit267 が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
メンテナーはふだん 1 日以内に返信
-
ExceptionThrowShouldUseContext: NullPointerException on a catch block inside an annotation type対応中かも @Carbon14-48 が今日担当しました。 オープンapproved
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
checkstyle/checkstyle#22784 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
メンテナーはふだん 1 日以内に返信