Berimor66 / duplicati

Automatically exported from code.google.com/p/duplicati
0 stars 0 forks source link

Invalid future time causes manifest errors #656

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.  Set clock to sometime in the future (in my example it was 2 months forward).
2.  Run a backup (should be full)
3.  Set time back to normal
4.  Run another backup (incremental)
5.  Try to view contents of recent incremental backup
6.  "An error occurred: System.Exception: Error: 
System.IO.InvalidDataException:  The manifest file (recent incremental) 
indicates that the previous manifest file should be (full backup made with 
wrong future time) but it was (previous incremental or full backup on normal 
time)."

What is the expected output? What do you see instead?
Contents of incremental should show.

What version of Duplicati are you using? On what operating system?
All versions 1.2.1 and 1.3.2

What backend (destination) are you using?
Rackspace CloudFiles

Please provide any additional information below.
Sometimes the time will be set to a wrong time, such as the user tampering with 
the clock that just happens to be at the same time as the backup, or the clock 
drifts for some odd reason.
It would be nice if it didn't just break the backups.  An error is fine, but it 
makes the backups unusable.  If you don't check and catch it, you will lose a 
lot of backups.

Another problem, is that it will no longer make full backups once you have a 
backup with an invalid future time.  All backups become incremental.

Original issue reported on code.google.com by jhiswin on 28 Jun 2012 at 12:48

GoogleCodeExporter commented 9 years ago
Yes, that is actually not easy to fix.
Duplicati relies on the time to figure out where what goes in the sequence.
If you have a mix of full and incremental bacups, Duplicati will sort them by 
time, and then figure out which incrementals belong to which full. If you mess 
around with the time on the machine, this sorting breaks.

Inside each of the manifest files is a record that explains how it is supposed 
to look, which is why Duplicati stops there.

It is possible to download all manifests and check what the real order of 
things should be, so the backup can continue, but this will take some time and 
fire a lot of requests.

A more general solution is perhaps to use some kind of unique value, say 
full-xxxxx, and then make inc-xxxxx-1, inc-xxxxx-2 etc, so the chain is not 
depending on time. This makes it slightly harder to glance over the backup 
files and determine if everything is as expected, but I think all 
backends/filehosts timestamp the files anyway, so that value can be used by a 
human inspector.

Original comment by kenneth@hexad.dk on 5 Jul 2012 at 8:00

GoogleCodeExporter commented 9 years ago
My bios recently reset itself and I tried to correct it mixing up DD and MM in 
the bios and a backup started while I was in Windows (future date). My 
Duplicati notices me that a backup has failed everyday in a tooltip because 
this is the "latest" error I guess.

Regarding this issue posted here does that mean my otherwize fine backup is 
possibly faulty and how would I go about removing this future "event". 

I have no problems running a full backup again on my jobs so perhaps I simply 
need to delete all my jobs and re-create them ?

Awesome backup solution btw :)

Original comment by tbres...@gmail.com on 22 Jul 2014 at 4:57

GoogleCodeExporter commented 9 years ago
It'd be useful to receive a warning when dates are inconsistent and a way to 
"fix" them.  A choice to use server time, or a custom naming algorithm.

Original comment by jhiswin on 22 Jul 2014 at 8:14

GoogleCodeExporter commented 9 years ago
The only way to remove invalid log entries (when CMOS resets and you get an 
invalid date) is to edit duplicati.sqlite and manually delete the invalid 
entries from tables Log and LogBlob.
Then you need to edit the scheduled backup and change the backup run time to 
start at the date you want.

Original comment by jhiswin on 4 Aug 2014 at 4:23

GoogleCodeExporter commented 9 years ago
Thanks for the comment. I have no idea how to do that though. I guess I'll just 
delete my backups and start a new :)

Original comment by tbres...@gmail.com on 4 Aug 2014 at 5:44

GoogleCodeExporter commented 9 years ago
You will need a SQLite DB editor that supports encryption.  This one works:
http://www.sqlitedeveloper.com/download

And you will need to delete the rows.  Then edit the scheduled backup again and 
re-set the starting date.

Original comment by jhiswin on 4 Aug 2014 at 8:00

GoogleCodeExporter commented 9 years ago
After I found the encryption key I found the row with the error (the ID was off 
from the others) deleteted them and sat the start date again for all my jobs 
and restarted Duplicati. It works! Thank you!

Original comment by tbres...@gmail.com on 6 Aug 2014 at 5:17