-
-
Notifications
You must be signed in to change notification settings - Fork 734
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IntegrityError: Invalid segment entry size #2099
Comments
I tagged it "corruption" as BORG_SEG is not expected to be in the middle of a segment file. It is not data loss (AFAICS) as recover_segment() can deal with it. |
This is likely a duplicate of #1977 - see precisely the same bad segment entry size, which is likely taken from the MAGIC bytes.
Keeping this one as it has more details. |
The O_EXCL change in master branch would "trip" on this. So there is definitely a bug in the transaction recovery here. |
Strange: i googled for the size value and did only find #1977 - no post elsewhere on the web, not for borg, not for attic. |
See also jborg/attic#394. |
"ab" seems to make no sense here (if there is already a (crap, but non-empty) segment file, we would write a MAGIC right into the middle of the resulting file) and cause borgbackup#2099.
"ab" seems to make no sense here (if there is already a (crap, but non-empty) segment file, we would write a MAGIC right into the middle of the resulting file) and cause borgbackup#2099. "wb" would overwrite existing content (not sure if that would be ok).
@bket did you have "repo disk full" issues? also, the specific commands run against that repo recently would be interesting. like borg commands in your scripts or from shell history. |
@ThomasWaldmann "repo full disk" issues are unlikely as there is plenty of free space (~230GB). Average backup size of that repo, after compression and deduplication is <100MB. For removing checkpoints I used a loop as mentioned in this issue. The specific borg commands:
Use of this loop is incidentally used as cleanup measure for specific machines (laptops). I have one script that I run a couple of times per day. This script does:
This script is run on wired machines as well on laptops (road warriors). The latter regularly experience poor internet connectivity (i.e. in a train) resulting in dropping of SSH-connections, thus resulting in an interrupted borg action. When this happens while creating a backup borg creates a checkpoint. I'm not sure what happens when a connection is dropped while pruning. Until now I did not experience any issues.
I'm not sharing repositories. Thus, one client one repository. |
"ab" seems to make no sense here (if there is already a (crap, but non-empty) segment file, we would write a MAGIC right into the middle of the resulting file) and cause borgbackup#2099.
The current solution to this, see PR #2099, is to use "xb" as mode instead of "ab". This would fail early if there already is a file, not just append to it, so the corruption causing this issue would never happen. Maybe that would also give us more / other informations about the root cause. |
creating a new segment: use "xb" mode, fixes #2099
Fixed by #2100. @bket: @enkore suggested that maybe using break-lock could have caused this malfunction. If a |
(full quote for context) |
In an attempt to expunge multiple checkpoints I used a script similar to:
The client is running borg 1.0.9 on OSX and the server (OpenBSD) is also running 1.0.9. Connection is via SSH.
After some time the client errored with:
Subsequential delete (or create) attempts resulted in the same error. Error was resolved by running borg check --repair.
Output of the specific segment file 131098 at offset 5300305 is included (dd if=131098 of=output
bs=1 skip=5300305 count=1024). What is interesting is that offset 0 as well as 5300305 start with "BORG_SEG".
output.zip
Issue has been discussed on IRC:
The text was updated successfully, but these errors were encountered: