Repository navigation
borg check crashing #3509
Copy link
Copy link
Open
Labels
Description
from irc user mlazze:
arch linux running inside virtualbox on a win10 host accessing borg repo via vboxsf (which is known-problematic). borg repo resides on host's ntfs filesystem.
this issue is not about vboxsf being unreliable, but rather about checking whether we can make borg check more robust to not crash here:
~ borg check --debug -p /mnt/z/borg/borg.repo
using builtin fallback logging configuration
35 self tests completed in 0.06 seconds
Starting repository check
Upgrading from v1 hints.31692
Rebuilding sparse info for segment 28722
Failed to read committed index ([Errno 2] No such file or directory: '/mnt/z/borg/borg.repo/data/2/28722')
Segment transaction is 31693
Determined transaction is 31693
Found 26881 segments
Local Exceptionts 93.8%
Traceback (most recent call last):
File "/home/doc/.local/lib/python3.6/site-packages/borg/archiver.py", line 4175, in main
exit_code = archiver.run(args)
File "/home/doc/.local/lib/python3.6/site-packages/borg/archiver.py", line 4107, in run
return set_ec(func(args))
File "/home/doc/.local/lib/python3.6/site-packages/borg/archiver.py", line 150, in wrapper
return method(self, args, repository=repository, **kwargs)
File "/home/doc/.local/lib/python3.6/site-packages/borg/archiver.py", line 304, in do_check
if not repository.check(repair=args.repair, save_space=args.save_space):
File "/home/doc/.local/lib/python3.6/site-packages/borg/repository.py", line 904, in check
objects = list(self.io.iter_objects(segment))
File "/home/doc/.local/lib/python3.6/site-packages/borg/repository.py", line 1317, in iter_objects
read_data=read_data)
File "/home/doc/.local/lib/python3.6/site-packages/borg/repository.py", line 1398, in _read
data = fd.read(length)
OSError: [Errno 71] Protocol error
Platform: Linux staskij 4.14.10-1-ARCH #1 SMP PREEMPT Fri Dec 29 20:17:35 UTC 2017 x86_64
Linux: arch
Borg: 1.1.4 Python: CPython 3.6.4
PID: 785 CWD: /home/doc
sys.argv: ['/home/doc/.local/bin/borg', 'check', '--debug', '-p', '/mnt/z/borg/borg.repo']
SSH_ORIGINAL_COMMAND: None
Reactions are currently unavailable
Activity
ThomasWaldmann commentedon Jan 3, 2018
#2352 see also there about vboxsf.
mlazze commentedon Jan 3, 2018
For future reference, my problem was a faulty HDD, maybe a faulty sector, as the problem is always at the same % (93.8).
This is what I'm getting from borg check running directly on the Windows host (via WSL):
Thanks for the help
JonasKvarnstrom commentedon Aug 7, 2018
I'm encountering the same exception:
I wouldn't be surprised to find that the disk (which is quite old) has read errors, but I see no relevant issues in dmesg.
While I don't expect Borg to actually fix this, I wonder if it would be useful to catch the OSError and raise an IntegrityError with some pertinent error information such as which segment this occurred in?
JonasKvarnstrom commentedon Aug 7, 2018
For the record, I tested this using the following change to the code in question:
Result:
Borg correctly identifies that the segment files are partly unreadable:
I haven't tried running with --repair yet as I want to try to make a copy of the full archive first.
(By the way, when you start an backup archive with a small segment size, but later switch to 200 MB segments, the progress indicator is a bit optimistic as it only counts the number of segments... but that's another issue.)
ThomasWaldmann commentedon Aug 7, 2018
Maybe follow the hardware checking tips from our docs (recommended for IntegrityErrors, but also somehow applies to IOErrors).
ThomasWaldmann commentedon Dec 16, 2018
TODO: check that code change, see above.
ThomasWaldmann commentedon Jan 31, 2019
ideas:
ThomasWaldmann commentedon Feb 1, 2019
removing it from milestone until the goal gets more clear.
check: survive an unreadable archive metadata pack, refs borgbackup#3509
check: narrow the archive read-error handling, and test it, refs borg…
check: survive I/O errors while reading repository objects, fixes bor…
8 remaining items
check: survive an unreadable archive metadata pack, refs borgbackup#3509
check: narrow the archive read-error handling, and test it, refs borg…
check: an unreadable repository config is not a missing one, refs bor…
check: survive I/O errors while reading repository objects, fixes bor…
check: survive an unreadable archive metadata pack, refs borgbackup#3509
check: narrow the archive read-error handling, and test it, refs borg…
check: an unreadable repository config is not a missing one, refs bor…
check: survive I/O errors while reading repository objects, fixes bor…
check: survive an unreadable archive metadata pack, refs borgbackup#3509
check: narrow the archive read-error handling, and test it, refs borg…
check: an unreadable repository config is not a missing one, refs bor…
check: survive I/O errors while reading repository objects, fixes bor…
check: survive an unreadable archive metadata pack, refs borgbackup#3509
check: narrow the archive read-error handling, and test it, refs borg…
check: an unreadable repository config is not a missing one, refs bor…