Sample finish_uploading_large_file uses the wrong sha1 and fails its resume check

Offen
#249 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 3 Tagen

@MatheoPaiva arbeitet bereits daran.

Seit 15.11.2026.

  • #262 von @MatheoPaiva — offen

Bewertung

Schwierigkeit
2/5
Geschätzter Aufwand
Unter einer Stunde
Anfängerfreundlichkeit
25/100
Issue-Typ
Bug
Klarheit
Klar beschrieben
Aktivitätsstatus
Veraltet
Tech-Stack
java
Bereich
api

Rechercherichtung

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.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

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.

Vorherrschende Sprache
Java
Sterne
103
Forks
23
Ø Merge
5 T. 8 Std.
Gemergte PRs (30 T.)
3

Entwicklungsumgebung

Dieses Projekt bietet weder Dev-Container noch Dockerfile noch Beitragsleitfaden – die Einrichtung liegt bei Ihnen. Beginnen Sie mit der README; die allgemeinen Schritte stehen in unserem Leitfaden für den ersten Beitrag.

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus Backblaze/b2-sdk-java

Alle Issues in Backblaze/b2-sdk-java

Ähnliche Issues

Weitere Issues zu Java

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.