Skip to content

extract: --skip-errors ignores corrupted chunks (w/ log message), see #840 - #7481

Closed
ThomasWaldmann wants to merge 1 commit into
borgbackup:masterfrom
ThomasWaldmann:skip-integrity-errors
Closed

extract: --skip-errors ignores corrupted chunks (w/ log message), see #840#7481
ThomasWaldmann wants to merge 1 commit into
borgbackup:masterfrom
ThomasWaldmann:skip-integrity-errors

Conversation

@ThomasWaldmann

Copy link
Copy Markdown
Member

Forward port of a change implemented by @enkore back in 2016:

enkore@09b21b1

@ThomasWaldmann
ThomasWaldmann marked this pull request as draft March 27, 2023 18:03
@ThomasWaldmann
ThomasWaldmann force-pushed the skip-integrity-errors branch 3 times, most recently from f18c5ae to 33f823d Compare March 28, 2023 15:15
@ThomasWaldmann
ThomasWaldmann force-pushed the skip-integrity-errors branch from 33f823d to c2761a9 Compare April 3, 2023 21:16
@codecov-commenter

codecov-commenter commented Nov 5, 2023

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 89.47368% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 83.27%. Comparing base (1f48e50) to head (ec1937d).
⚠️ Report is 1636 commits behind head on master.

Files with missing lines Patch % Lines
src/borg/archive.py 88.23% 3 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #7481      +/-   ##
==========================================
- Coverage   83.69%   83.27%   -0.43%     
==========================================
  Files          66       66              
  Lines       11853    11877      +24     
  Branches     2149     2144       -5     
==========================================
- Hits         9920     9890      -30     
- Misses       1359     1400      +41     
- Partials      574      587      +13     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ThomasWaldmann

Copy link
Copy Markdown
Member Author

commenting to trigger re-indexing of this PR, so it gets visible again on the github web UI open PR list.

@ThomasWaldmann

Copy link
Copy Markdown
Member Author

Superseded by #10357.

ThomasWaldmann added a commit to ThomasWaldmann/borg that referenced this pull request Sep 11, 2026
…ata with a warning, fixes borgbackup#840

Missing chunks were already replaced by all-zero data of the correct size during
extraction (with an error log line, but no warning exit code and no file name),
while a corrupted chunk (one that does not authenticate, decrypt or decompress)
aborted the whole extraction with an IntegrityError, leaving the file at 0 bytes
and all following files unextracted.

Now DownloadPipeline.fetch_many treats a corrupted chunk like a missing one if
the new replace_corrupted flag is set: it logs an error naming the chunk and
yields an all-zero replacement of the correct size. extract (incl. --dry-run
and --stdout) and mount -o allow_damaged_files set that flag, so a damaged file
is still extracted completely (correct size and metadata, all-zero content
where the damaged chunks were), the extraction continues with the next file,
and each damaged file is reported with a warning (new BackupDamagedChunksError,
rc 113). This also fixes the missing-chunk case, which now gets the same
per-file warning and exit code instead of silently exiting with rc 0.

recreate and transfer keep raising IntegrityError for corrupted chunks, as they
would otherwise store all-zero data as if it were the content (see the
*_wrong_chunk_content tests). The FUSE read handlers map a corrupted chunk to
EIO (with an error log line) instead of an unhandled exception.

Supersedes the borg 1.x-era PR borgbackup#7481 (extract --skip-errors).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants