Any way to recover backup (repair and purge-broken-files don't help)?

I did not change the file length but I had a keyboard failure and I hit ‘8’ instead of ‘9’. Starting from a file of 32769 bytes allowed me to repro it, thanks.

1 Like

An update.

I was dealing with other stuff and hadn’t looked at this for a while.

A couple of days ago I’ve decided to try to finally fix it – and it seems to work now.

Here’s what I did / what happened:

  • I’ve re-built the database for the failing backup; it wasn’t too bad, maybe 3 hours or something like that
  • Rebuild process mentioned that there are some missing/something files and suggested to a purge – which I did (purge-broken-files)
  • I’ve also ran repair, it didn’t look like repair did anything.
  • At this point I thought it’s fixed, however when the backup actually run it said (in the log): ‘Re-creating missing index file for duplicati-b15f91bxxxx.dblock.zip.aes’ and then it promptly failed with ‘System.Exception: Internal consistency check failed, generated index block has wrong hash, xxx vs yyy’ (I’ll include log below in case it’s helpful)
  • So I went into the backup storage location and deleted (well, moved) the file that Duplicati was trying to re-create index for
  • I then ran ‘purge-broken-files’ again (which did a bunch of purging and uploading)
  • Then I tried to run backup again and this time it seemed to work fine.

So thanks everyone who helped/participated here. Re-building the database was indeed the solution to the problem I had. And we found a couple of bugs too, so hopefully it’s been helpful to Duplicati as well.

Log excerpt for reference (with backup failing due to consistency problem; with file name and hashes edited-out):

2023-12-30 00:53:57 -04 - [Information-Duplicati.Library.Main.Controller-StartingOperation]: The operation Backup has started
2023-12-30 01:01:34 -04 - [Information-Duplicati.Library.Main.BasicResults-BackendEvent]: Backend event: List - Started:  ()
2023-12-30 01:01:35 -04 - [Information-Duplicati.Library.Main.BasicResults-BackendEvent]: Backend event: List - Completed:  (931 bytes)
2023-12-30 01:01:35 -04 - [Information-Duplicati.Library.Main.Operation.Backup.RecreateMissingIndexFiles-RecreateMissingIndexFile]: Re-creating missing index file for duplicati-b15f91xxx.dblock.zip.aes
2023-12-30 01:02:03 -04 - [Error-Duplicati.Library.Main.Operation.BackupHandler-FatalError]: Fatal error
System.Exception: Internal consistency check failed, generated index block has wrong hash, xxx vs yyy
   at Duplicati.Library.Main.Operation.Common.IndexVolumeCreator.<CreateIndexVolume>d__0.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Duplicati.Library.Main.Operation.Backup.RecreateMissingIndexFiles.<>c__DisplayClass1_0.<<Run>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at CoCoL.AutomationExtensions.<RunTask>d__10`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Duplicati.Library.Main.Operation.BackupHandler.<RunAsync>d__20.MoveNext()