diff --git a/Duplicati/Library/Main/Operation/RecreateDatabaseHandler.cs b/Duplicati/Library/Main/Operation/RecreateDatabaseHandler.cs index b9d85e191..3d11406a8 100644 --- a/Duplicati/Library/Main/Operation/RecreateDatabaseHandler.cs +++ b/Duplicati/Library/Main/Operation/RecreateDatabaseHandler.cs @@ -129,9 +129,15 @@ namespace Duplicati.Library.Main.Operation orderby n.Time descending select n; + if (filelists.Count() <= 0) + throw new Exception(string.Format("No filelists found on the remote destinatio")); + if (filelistfilter != null) filelists = filelistfilter(filelists).Select(x => x.Value).ToArray(); + if (filelists.Count() <= 0) + throw new Exception(string.Format("No filelists")); + // If we are updating, all files should be accounted for foreach(var fl in remotefiles) volumeIds[fl.File.Name] = updating ? restoredb.GetRemoteVolumeID(fl.File.Name) : restoredb.RegisterRemoteVolume(fl.File.Name, fl.FileType, fl.File.Size, RemoteVolumeState.Uploaded); diff --git a/Duplicati/Server/Database/Connection.cs b/Duplicati/Server/Database/Connection.cs index 34a28fd5a..86fdf9e56 100644 --- a/Duplicati/Server/Database/Connection.cs +++ b/Duplicati/Server/Database/Connection.cs @@ -408,7 +408,7 @@ namespace Duplicati.Server.Database return new object[] { n.Name, - string.Join(",", n.Tags), + string.Join(",", n.Tags ?? new string[0]), n.TargetURL, update ? (object)item.ID : (object)n.DBPath }; diff --git a/Duplicati/Server/WebServer/RESTMethods/Backup.cs b/Duplicati/Server/WebServer/RESTMethods/Backup.cs index 36130559d..7bf2e37b9 100644 --- a/Duplicati/Server/WebServer/RESTMethods/Backup.cs +++ b/Duplicati/Server/WebServer/RESTMethods/Backup.cs @@ -403,6 +403,9 @@ namespace Duplicati.Server.WebServer.RESTMethods public void PUT(string key, RequestInfo info) { string str = info.Request.Form["data"].Value; + if (string.IsNullOrWhiteSpace(str)) + str = new StreamReader(info.Request.Body, System.Text.Encoding.UTF8).ReadToEnd(); + if (string.IsNullOrWhiteSpace(str)) { info.ReportClientError("Missing backup object"); diff --git a/Duplicati/Server/WebServer/RESTMethods/Backups.cs b/Duplicati/Server/WebServer/RESTMethods/Backups.cs index 33251a881..061cab7cb 100644 --- a/Duplicati/Server/WebServer/RESTMethods/Backups.cs +++ b/Duplicati/Server/WebServer/RESTMethods/Backups.cs @@ -138,7 +138,11 @@ namespace Duplicati.Server.WebServer.RESTMethods AddOrUpdateBackupData data = null; try { - data = Serializer.Deserialize(new StringReader(info.Request.Form["data"].Value)); + var str = info.Request.Form["data"].Value; + if (string.IsNullOrWhiteSpace(str)) + str = new StreamReader(info.Request.Body, System.Text.Encoding.UTF8).ReadToEnd(); + + data = Serializer.Deserialize(new StringReader(str)); if (data.Backup == null) { info.ReportClientError("Data object had no backup entry");