Closed jbrepogmailcom closed 3 months ago
I didn't verify that code (I could, but only if you show a DIFF), but IOError
means that it is an error below borg:
So the real fix is to find and fix the root cause. Just deleting the corrupt files might be not enough.
Thanks for the comment. The error happened during backup from client to server over ssh, because closing file by borg and by disconnected network was not in sync. So it was low-level error, but caused by cutting off borg backup. There was no other way how to find defective segments than that modification in repository.py. For that reason, it may be useful.
You may not want to add it to official code, this is just debug help, but it may be useful to others if they encounter similar error.
Hello. Some of my files got corrupted, they had reported different length than it actually was. Borg was not able to pick up on that error and was ending in crash:
File "/usr/lib/python3/dist-packages/borg/repository.py", line 1512, in _read data = fd.read(length) OSError: [Errno 5] Input/output error
I was not able to identify what file was causing this, but ChatGPT recommended a fix in routine _read, that prints what file causes the error just before it crashes. This helped me to identify bad segments and delete them. The modified "def _read" is here: