--usn-policy: Fatal error => Value cannot be null. Parameter name: source

Hi all,

Had this problem a while ago in, I think, v2.0.4.12 and just disabled it but I recently revised some backups and figured I’d give it another shot. Same problem.

So, all my backups are run via command-line script using task scheduler and ‘Run with highest privileges’ checked. I also get the same problem when run from an elevated command prompt. The backup task is run daily and all source drives are local and run NTFS. Here’s the relevant log output:

Checking remote backup …
Backend event: List - Started: ()
Listing remote folder …
Backend event: List - Completed: (2.35 KB)
Scanning local files …
282 files need to be examined (282.39 GB)
Fatal error => Value cannot be null.
Parameter name: source

System.ArgumentNullException: Value cannot be null.
Parameter name: source
at System.Linq.Enumerable.Select[TSource,TResult](IEnumerable1 source, Func2 selector)
at Duplicati.Library.Utility.FilterExpression.GetFilterHash()
at Duplicati.Library.Snapshots.UsnJournalService.Initialize(IFilter emitFilter, IEnumerable1 prevJournalData) at Duplicati.Library.Main.Operation.BackupHandler.GetJournalService(IEnumerable1 sources, ISnapshotService snapshot, IFilter filter, Int64 lastfilesetid)
at Duplicati.Library.Main.Operation.BackupHandler.d__19.MoveNext()
— End of stack trace from previous location where exception was thrown —
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at CoCoL.ChannelExtensions.WaitForTaskOrThrow(Task task)
at Duplicati.Library.Main.Controller.<>c__DisplayClass13_0.b__0(BackupResults result)
at Duplicati.Library.Main.Controller.RunAction[T](T result, String& paths, IFilter& filter, Action1 method) at Duplicati.Library.Main.Controller.Backup(String[] inputsources, IFilter filter) at Duplicati.CommandLine.Commands.Backup(TextWriter outwriter, Action1 setup, List1 args, Dictionary2 options, IFilter filter)
at Duplicati.CommandLine.Program.ParseCommandLine(TextWriter outwriter, Action1 setup, Boolean& verboseErrors, String[] args) at Duplicati.CommandLine.Program.RunCommandLine(TextWriter outwriter, TextWriter errwriter, Action1 setup, String args)

The error occurs regardless of whether --usn-policy is Auto or On (which further indicates something is wrong here since Auto is supposed to fail quietly).

I searched the forum for similar issues and didn’t find a match so I’m guessing this is something I’m doing? The backup runs just fine if I turn usn-policy off but I’d prefer it set to Auto.

Thoughts or suggestions welcome.


Edited to add that I’m currently running v2.0.4.17 canary on Win10 64.

Update: just thought I’d check out a possible cause with a source path with just the root drive and no directory (e.g. “E:”) which was a feature of a recent, though unrelated, bug. Ran the backup with --dry-run=On both with and without the root drive source but there was no difference; same error showed up both times.

This is due to an empty filter expression (no include / exclude filter). I submitted a fix to handle this case in Fix for –usn-policy: Fatal error => Value cannot be null. Parameter name: source by dgehri · Pull Request #3762 · duplicati/duplicati · GitHub.

Great! Thanks Daniel.

Glad it was worth reporting.