Commit Graph
997 Commits
Author SHA1 Message Date
Kenneth Skovhede d7f9981f49 Fixed a few nullable warnings 2026-02-17 10:37:08 +01:00
Kenneth Skovhede cf02c1addf Fixed large SQLite inputs
When performing queries with large inputs, there is a possibility that we reach the maximum number of possible parameters. If the query exceeds the maximum number of parameters the query fails.

This change uses a temporary table that will be created in the case the inputs exceed the total number available parameters, making sure the calls proceed as before with small inputs, but uses temporary tables on larger inputs.

Some tests were added to ensure the update works as expected, even with large inputs.
2026-02-11 13:34:58 +01:00
Kenneth Skovhede e7aa60fba0 Handle duplicate source paths
This PR adds guards to prevent creating filesets with multiple files that have the same path.

While it should technically be impossible to have multiple entries that have the same path, it could happend either due to glitches or because the source data (manual lists, remote sources, etc) returns duplicates.

This PR adds a simple check for each folder to ensure that on a folder-level, duplicate paths cannot be introduced.

There is also a post-backup check to evict any duplicates, and the recreate process will reject duplicate paths.

Finally, the repair command will remove duplicates if they somehow manage to get into the database anyway.

A database-level prevention is not currently feasible as it needs a cross-table check for uniqueness, which requires more work from the database to check for each added file. Since this is expected to be a very rare event, the added processing was not justified.
2026-02-05 11:06:41 +01:00
Kenneth SkovhedeandGitHub 1b1719e924 Merge pull request #6718 from duplicati/feature/add-office-365-backup
Add office 365 backup and restore
2026-02-01 13:12:44 +01:00
Kenneth SkovhedeandGitHub 3db18c923c Merge pull request #6739 from duplicati/feature/fix-issue-6425
Fixed purge size calculation.
2026-01-30 19:15:24 +01:00
Kenneth SkovhedeandGitHub 89cdb85a11 Merge pull request #6740 from duplicati/feature/fix-issue-6553
Add guard against invalid entries
2026-01-30 19:04:54 +01:00
Kenneth Skovhede ebbc564424 Added fix for manual changelist
This PR updates the logic for using `--changed-files` so the combined fileset no longer has additional (left-over) entries.

This fixes #6529
2026-01-30 17:33:32 +01:00
Kenneth Skovhede fa0c9c72a9 Add guard against invalid entries
This PR guards agains inserting entries into the DeletedVolume if they reference non-existing volumes, which can happen in error scenarios.

This fixes #6553
2026-01-30 16:49:03 +01:00
Kenneth SkovhedeandGitHub 4b2402d381 Merge pull request #6733 from duplicati/feature/fix-issue-6539
Fix issue with failed delete
2026-01-30 16:19:59 +01:00
Kenneth Skovhede 4a598019a8 Fixed purge size calculation.
This fixes the size calculation on purge to only include blocks once, and not include blocks that are still referenced elsewhere.
2026-01-30 16:08:39 +01:00
Kenneth Skovhede cee97bb01a Treat inconsistency state the same for both deleted and deleting, so a failed delete does not cause a database inconsistency 2026-01-30 15:09:17 +01:00
Kenneth SkovhedeandGitHub 4745aa464b Merge branch 'master' into feature/add-office-365-backup 2026-01-29 20:11:29 +01:00
Kenneth SkovhedeandGitHub 26f7dd8586 Merge branch 'master' into feature/add-office-365-backup 2026-01-29 20:04:42 +01:00
Kenneth Skovhede fa6be206ef Handle missing blocks on recreate
This PR handles a case where the `dindex` files may reference non-existing `dblock` files. In this case the recreate may register missing (and unused) blocks in the `DeletedBlock` table, which will later cause issues if the blocks are attempted used.

The fix is to remove missing blocks before the cleanup so there is no entry that references the missing volumes.

This fixes issue #6552
2026-01-28 21:03:03 +01:00
Carl-Johannes JohnsenandGitHub 6b02116bed Merge pull request #6708 from carljohnsen/feature/automatic-321
Feature/Automatic 3-2-1 backup
2026-01-28 17:21:33 +01:00
Kenneth SkovhedeandGitHub 1a19b6aa9b Merge pull request #6728 from duplicati/feature/issue-6538
Fixed issue with missing log
2026-01-28 15:20:04 +01:00
Kenneth Skovhede c765a5658b Improved query for purge broken files
This PR improves the query used to calculate the size of removed files when issuing the purge-broken-files command.

This PR also adds the option `--reduced-purge-statistics` which will fully skip the size calculation, in the event the query is still performing poorly.

This fixes #6366
2026-01-27 21:15:50 +01:00
Kenneth Skovhede bb2be7966e Fixed issue with missing log
When an error occurred, the log would be written to the database, but the transaction would then be rolled back, causing the log to disappear.

This adds explicit commit to the log when handling error cases.

This fixes #6538
2026-01-27 21:08:36 +01:00
Kenneth Skovhede 1523f730e3 Added support for storing metadata in the database 2026-01-14 10:01:20 +01:00
Carl Johnsen 177272ecd9 Merge branch 'master' into feature/automatic-321 2026-01-08 20:55:31 +01:00
Carl Johnsen 50f18dca84 Moved ResultSerialization from builtin modules to a shared library 2026-01-08 14:34:11 +01:00
Kenneth Skovhede 557fbd12d9 Fixed nullable issues 2026-01-06 10:22:53 +01:00
Kenneth Skovhede 625c56b5c1 Updated new column to be not null, for consistency with other columns 2025-12-17 23:04:47 +01:00
Kenneth Skovhede 6e6e993765 Fixed issues with database transaction not being comitted.
Renamed the options to be more descriptive.
Rewrote the dependency query to be more readable and also check for metadata dependency.

Fixed an edge case where there were no modified files, and no new backup is created.

Fixed some issues with local/utc datetime compares.

Fixed logic for deleting filesets to only look at the filesets themselves. This makes the version lock follow the dlist file, and can create "dangling" volumes that have no filesets, but these will be picked up by compaction.

Updated tests to work correctly.

Added lock-info update option for the backup recreate call, so the UI can also re-create lock information on database rebuilds.
2025-12-17 22:27:38 +01:00
Kenneth Skovhede 0f81b42146 Add support for remote locks
This PR adds support for locking files if the backend supports it.

To activate locking, set the option `--file-lock-duration=30D` and the backup will lock the files.

If the database is rebuilt with the intention of continuing the backups, use the option `--repair-refresh-lock-info` which will update lock information in the database after recreating the database.

The locking works by asking the backend to lock files after a backup has completed.

The implementation keeps track of which files are currently assigned a lock and prevents attempting to delete the files that are currently locked.

Note that the bucket should not have a default lock policy as Duplicati needs to finish the backup before the locking is applied.

In this initial version, Azure Blob Storage, B2, S3 and iDrive are supported with locking.

The CLI is updated to allow setting locks on a specific version. The backend tool is updated to allow setting locks on specific files.
2025-12-14 17:17:48 +01:00
Kenneth Skovhede 7322c46861 Pre-execution check for RemoveRemoteVolumes
This PR adds a check before entering the RemoveRemoteVolumes that checks if there are dangling FilesetEntry records when calling the function.

This makes it possible to figure out if the problem is created by the RemoveRemoteVolumes code, or an already existing problem in the database.

Also added a few tests that check that the condition is correctly detected.
2025-12-03 11:34:30 +01:00
Kenneth SkovhedeandGitHub 2632ba8164 Merge pull request #6625 from duplicati/bugfix/restore-deadlock-timer-better-start
Bugfix/Better starting time for restore deadlock detection.
2025-11-15 11:04:25 +01:00
Kenneth Skovhede 43d38efdd3 Fixed remaining warnings 2025-11-14 16:09:05 +01:00
Carl Johnsen d48afd7496 Check the database for volume sizes reported in remotevolume 2025-11-10 14:56:20 +01:00
Kenneth Skovhede b0bd9c121f Fixed reading the size of files in restore
This significantly speeds up the restore file listing speed.
2025-09-26 13:54:06 +02:00
Kenneth Skovhede 39cca5c24f Simplified calling code to not rely on extension methods 2025-09-25 11:33:56 +02:00
Kenneth Skovhede 230d80642a Fixed invariant formatting helpers
This fixes an issue with formatting for invariant values that was caused by incrorrect function overload selection.

To avoid future issues, the two similar functions have been renamed to clarify what they are working for.
2025-09-25 11:14:54 +02:00
Kenneth Skovhede f0d8677ef5 Include duplicated blocks in recreated index files
This fixes #6504
2025-09-23 11:12:36 +02:00
Kenneth Skovhede b2c6ef73c5 Improve logging of SQL statements
This updates the logging code to do invariant formatting of the SQL statements
2025-09-22 14:39:46 +02:00
Carl Johnsen 7670ea9a58 Ensured that all values that are passed to interpolation strings have been passed through FormatInvariant to prevent SQLite errors related to string formatting cultures. 2025-09-05 14:11:05 +02:00
Carl Johnsen 1a5fef36d7 Removed whitespace 2025-09-05 14:07:58 +02:00
Carl Johnsen b3fe276a13 Ensured that all temporary tables uset the same type of generated guid name 2025-09-05 14:06:55 +02:00
Kenneth Skovhede a1fa2f8e1e Fixed to use same helper method 2025-09-02 09:32:25 +02:00
Kenneth Skovhede 1f8f79b9c0 Ensure that a query string is formatted with invariant string formatting 2025-09-02 08:31:02 +02:00
Carl Johnsen 0194d2a486 Merge branch 'master' into feature/restore-volume-cache-size-parameter 2025-08-14 17:22:41 +02:00
Kenneth Skovhede 35347a7161 Handle a case where a missing hash would cause a crash 2025-08-14 09:27:37 +02:00
Carl Johnsen 44c8793eaa Changed the cache evict flag in BlockRequest to be an enum, as there are now more than 2 types of block request 2025-08-08 12:38:08 +02:00
Carl-Johannes JohnsenandGitHub a5c8dce21c Merge pull request #6459 from carljohnsen/bugfix/remotevolume-hash-null
Bugfix/RemoteVolume hash null
2025-08-07 21:08:54 +02:00
Carl Johnsen 4f65127ed7 Removed throwing the exception, since recreating the database will restore the hash 2025-08-06 10:16:11 +02:00
Kenneth Skovhede e17759efe3 Fixed some quotes and a TODO 2025-08-05 13:47:57 +02:00
Kenneth Skovhede 429bcd1f2d Include deleted blocks when recreating dindex files.
This fixes #6339
2025-07-11 15:55:36 +02:00
Kenneth Skovhede 32f0283097 Fix bugreport create
The new SQLite library does not like to do VACUUM within a transaction. This PR updates it to run VACUUM outside the transaction.
2025-07-08 14:37:49 +02:00
Kenneth SkovhedeandGitHub eb2bb571cf Merge pull request #6402 from carljohnsen/performance/list-root
Performance/List roots takes long time
2025-07-07 18:09:22 +02:00
Carl Johnsen 0a04d3e77e Moved filtering of common roots from the SQL query to C# 2025-07-07 17:09:29 +02:00
Kenneth Skovhede cb89572ef8 Setting DBNull.Value for null values 2025-07-07 17:04:07 +02:00