Duplicacy crash modifying files

Jordan     Nov 30 3:25PM 2017 CLI

I was testing duplicacy as a backup tool and decided to back up a VMWare virtual machine. The first time I did this it worked fine and I could restore revision one of the back-up without any issues. After using the vm and making some changes I backed up the files again. When I tested the recovery of this revision I got back most of the vm without issues except there were two files that had been "corrupted". On further inspection of the issue it appears that duplicacy modified the original files on a earlier crash. After this crash I ran a backup that probably backed up the files already containing the error. The file that was modified contained data from duplicacy on the first lines. This is that data:

{"chunks":["d5e1c278c716489c5c723c496d9665b49aa862ec38cede37dbf5b7da621555c9"],"end_time":1511780759,"file_size":35842824687,"files":["0ff1d5679a6a1d602f2aee7b9a7090682ef93f52b4533fe4692505d704c50ca6"],"id":"VM-Domo","lengths":["da0e10cf6fd41w3eff1e72b8ab433dfe21f16b9bbc9101534ca67b23b2cbe096"],"number_of_files":327,"options":"-hash","revision":1,"start_time":1511934993,"tag":""} "Win7ProSP1-s009.vmdk"

The data in the file that is supposed to be on those lines and above seems to be removed and the data below those lines is correct.

Is it normal for duplicacy to corrupt/modify originals files if it crashes while performing a backup?


gchen    Nov 30 7:55PM 2017

It is almost impossible for Duplicacy to modify original files during backup, as it always opens files to be backed up in the read-only mode.

What may be possible is that maybe there is a bug in the chunk management that caused Duplicacy to reuse an old chunk buffer without clearing its content first. However, if this happens, the corrupted file would start with the corrupted data followed by the original file, rather than the corrupted data replacing the beginning portion of the original file.

The corrupted data here is actually the content of the snapshot file at revision 1. This file is saved to the cache directory as .duplicacy/cache/default/snapshot/repository_id/1. Can you check this file to see if it has the correct content?

Also, can you run duplicacy cat -r 1 and check the file list. Are the two corrupted files at the top of the list?

And what kind of crash was it and was there any error message?