[Box Backup] Box Backup - corrupted store
Ben Summers
boxbackup@fluffy.co.uk
Mon, 13 Jun 2005 10:16:47 +0100
On 8 Jun 2005, at 11:06, Simon Rerucha wrote:
>>> I've bbstoredserver run
>>> on NetBSD (2.0, stable), the bbackupd clients on Linux (Suse,
>>> various
>>>
> versions). Server is run with userland RAID disabled.
>
>>> Because of some misunderstandings, the power supply of the server
>>> was
>>>
> interupted few times. So I've equipped it with UPS, I have done
> filesystem
>
>>> checks and 'bbstoreaccounts check $acc fix' for all accounts,
>>> but: Now,
>>>
> when I want to restore some backup loations, bbackupquery
>
>>> starts to
>>> download files from server, but after a while it writes:
>>> Exception: Compress TransformFailed (6/4)
>>> and terminates, without any trace in either server or client log.
>>> If I
>>>
> try againg, it terminates at same point.
>
>>> If I run
>>> /usr/local/bin/bbackupquery "compare -aq" quit
>>> it doesn't write any errors.
>>> Please, can you help me a bit and tell me how to solve this
>>> problem ?
>>>
>>
>>
>>
>>> What's the problem.
>>>
>>
>> It sounds like a backup store file has been corrupted. The server
>> can't
>>
> tell this because the file is encrypted.
>
>>
>> We need to work out which file it is, then delete it, fix the
>> store, and
>>
> try again. Can you run bbackupquery as before, but log to a file? (-l
> <file> switch). Then send me the last few lines, and I should be
> able to
> tell you the file to delete.
>
>>
>>
>
> Here is it ...
>
> ...skipped ...
> Receiving stream, size 62183
> Send GetFile(0x9be,0x9ce)
> Receive Success(0x9ce)
> Receiving stream, size 79779
> Send GetFile(0x9be,0x9cf)
> Receive Success(0x9cf)
> Receiving stream, size 110851
> Send GetFile(0x9be,0x9d0)
> Receive Success(0x9d0)
> Receiving stream, size 110282
> Send GetFile(0x9be,0x9d1)
> Receive Success(0x9d1)
> Receiving stream, size 108402
> Send GetFile(0x9be,0x9d2)
> Receive Success(0x9d2)
> Receiving stream, size 62855
> Send GetFile(0x9be,0x9d3)
> Receive Success(0x9d3)
> Receiving stream, size 58038
OK, so the last file is 0x9d3, and after than the client terminates
(the first ID in the GetFile request is the directory ID, the second
the file ID). Therefore it must be this file which is corrupted somehow.
To find the corresponding file on the server, write down the ID in
hex and split it into groups of two characters starting from the
right hand side. Add a leading zero if necessary. So for example, if
the ID was ab12345ef, write
0a b1 23 45 ef
Ignore the right-most pair for now, and write down the others in
reverse order separated by /'s. This gives you the directory it's in.
Then for the final leafname, append 'o' and the right-most pair. So
we get
45/23/b1/0a/oef
for our example ID.
See lib/backupstore/StoreStructure.cpp for the algorithm. It's done
this way to avoid creating directories with thousands of entries and
massive directory trees where most directories only have one or two
entries. The "obvious" methods all are rather inefficient.
The file you're interested in is ID 0x9d3, so you want to try
deleting (or moving away)
09/od3
and running bbackupstore check <X> fix to correct the problems this
will cause on the server. And then post again to say what happened.
Ben