A simple backup that specifies --deleted-files causes a Fatal error.
Shortened repro steps:
(See Github comment for full repro steps)
>duplicati.commandline.exe backup file://C:\data\local\testchangedfiles\destination "C:\data\local\testchangedfiles\source\\" --encryption-module="none" --no-encryption="true" --dbpath="testchangedfiles.sqlite" --compression-module="zip" --keep-versions=-1 --no-auto-compact="true"
>del source\file6.txt
>duplicati.commandline.exe backup file://C:\data\local\testchangedfiles\destination "C:\data\local\testchangedfiles\source\\" --changed-files="C:\data\local\testchangedfiles\source\file1.txt;C:\data\local\testchangedfiles\source\file2.txt" --deleted-files="C:\data\local\testchangedfiles\source\file6.txt" --encryption-module="none" --no-encryption="true" --dbpath="testchangedfiles.sqlite" --compression-module="zip" --keep-versions=-1 --no-auto-compact="true"
Results in:
Fatal error => Input string was not in a correct format.
System.FormatException: Input string was not in a correct format.
at System.Number.StringToNumber
at System.Number.ParseInt64
at System.String.System.IConvertible.ToInt64
at System.Convert.ToInt64
at System.Data.SQLite.SQLiteStatement.BindParameter
at System.Data.SQLite.SQLiteStatement.BindParameters
at System.Data.SQLite.SQLiteCommand.BuildNextCommand
at System.Data.SQLite.SQLiteCommand.GetStatement
at System.Data.SQLite.SQLiteDataReader.NextResult
at System.Data.SQLite.SQLiteDataReader..ctor
at System.Data.SQLite.SQLiteCommand.ExecuteReader
at System.Data.SQLite.SQLiteCommand.ExecuteNonQuery
at System.Data.SQLite.SQLiteCommand.ExecuteNonQuery
at Duplicati.Library.Main.Database.LocalBackupDatabase.AppendFilesFromPreviousSet
at Duplicati.Library.Main.Database.LocalBackupDatabase.AppendFilesFromPreviousSet
at Duplicati.Library.Main.Operation.BackupHandler.RunMainOperation
at Duplicati.Library.Main.Operation.BackupHandler.Run
at Duplicati.Library.Main.Controller.RunAction[T]
at Duplicati.Library.Main.Controller.Backup
at Duplicati.CommandLine.Commands.Backup
at Duplicati.CommandLine.Program.RunCommandLine
>Exit code: 100
With this patch, backup completes successfully.
Without this guard, it would be possible to extend the stream during processing and send wrong blocks forward.
This is likely a fix for issue #1400 and #2402
- Don't use Vacuum() just before PurgeLogData (which performs vacuum() already)
- Removed unncessary poorly performning query (after optimizing it I found out it's unused)
- Correctly log calls for ExecuteScalarInt64
This should remove the errors in issue #1877 and #1869.
The real fix for not making the broken archives once the size is over 4GiB is pending an update to SharpCompress.
Previously, the output of the first replace was never used and therefore the absolute Windows paths were not restored
correctly.
The two patterns (i.e. ?: and \\) are disjoint so rewriting the previous result in case a match is found
for the second one is OK.