Trouble doing backup from root (linux)

This is also my first backup using Duplicati, so simple errors are not quite excluded.
Duplicati is freshly installed on Ubuntu 24.04.
I start the duplicati service using sudo, assuming this is necessary for a backup of the system files: > sudo systemctl start duplicati.
This is after I did my first attempt at root backup and got the same error I will now describe.
Config: manually typed / as source, excluded /mnt, /home, /proc, /sys, /dev.
Tested destination on a ntfs volume through /mnt.
Other configs are not special. Choose no automatic for frequency and submitted.
Then clicked start.
This causes an immediate return with ‘error’. I setup a log file and checked ~/.config/duplicati-server.sqlite. They have (of course) identical error output (i had hoped for more in the log after specifying verbose level in settings). The error does not help me to determine how I can prevent it.
So, the error exists whether or not I start the service as root. Please help me find out which parameter failed and how the web-interface did not catch that before executing the backup.

2026-02-06 12:35:18 +01 - [Error-Duplicati.Library.Main.Operation.BackupHandler-FatalError]: Fatal error
System.ArgumentOutOfRangeException: length (‘-1’) must be a non-negative value. (Parameter ‘length’)
Actual value was -1.
at System.ArgumentOutOfRangeException.ThrowNegative[T](T value, String paramName)
at System.ArgumentOutOfRangeException.ThrowIfNegative[T](T value, String paramName)
at System.String.ThrowSubstringArgumentOutOfRange(Int32 startIndex, Int32 length)
at System.String.Substring(Int32 startIndex, Int32 length)
at Duplicati.Library.Utility.Utility.GuessScheme(String url)
at Duplicati.Library.Main.Operation.BackupHandler.<>c.b__10_0(String x)
at System.Linq.Lookup2.Create(IEnumerable1 source, Func2 keySelector, IEqualityComparer1 comparer)
at System.Linq.GroupedEnumerable2.GetEnumerator() at Duplicati.Library.Main.Operation.BackupHandler.GetSourceProviders(IEnumerable1 sources, Options options, CancellationToken cancellationToken)
at Duplicati.Library.Main.Operation.BackupHandler.GetSourceProvider(IEnumerable1 sources, Options options, CancellationToken cancellationToken) at Duplicati.Library.Main.Operation.BackupHandler.RunAsync(String[] sources, IBackendManager backendManager, IFilter filter) 2026-02-06 12:35:18 +01 - [Error-Duplicati.Library.Main.Controller-FailedOperation]: The operation Backup has failed System.ArgumentOutOfRangeException: length ('-1') must be a non-negative value. (Parameter 'length') Actual value was -1. at System.ArgumentOutOfRangeException.ThrowNegative[T](T value, String paramName) at System.ArgumentOutOfRangeException.ThrowIfNegative[T](T value, String paramName) at System.String.ThrowSubstringArgumentOutOfRange(Int32 startIndex, Int32 length) at System.String.Substring(Int32 startIndex, Int32 length) at Duplicati.Library.Utility.Utility.GuessScheme(String url) at Duplicati.Library.Main.Operation.BackupHandler.<>c.<GetSourceProviders>b__10_0(String x) at System.Linq.Lookup2.Create(IEnumerable1 source, Func2 keySelector, IEqualityComparer1 comparer) at System.Linq.GroupedEnumerable2.GetEnumerator()
at Duplicati.Library.Main.Operation.BackupHandler.GetSourceProviders(IEnumerable1 sources, Options options, CancellationToken cancellationToken) at Duplicati.Library.Main.Operation.BackupHandler.GetSourceProvider(IEnumerable1 sources, Options options, CancellationToken cancellationToken)
at Duplicati.Library.Main.Operation.BackupHandler.RunAsync(String sources, IBackendManager backendManager, IFilter filter)
at Duplicati.Library.Main.Controller.<>c__DisplayClass22_0.<b__0>d.MoveNext()
— End of stack trace from previous location —
at Duplicati.Library.Utility.Utility.Await(Task task)
at Duplicati.Library.Main.Controller.RunAction[T](T result, String& paths, IFilter& filter, Func`3 method)

In the mean time, I learned, if I may say so, quite a lot.

  1. Different from windows, the linux system is normally supposed to be re-installed. Some paths are relevant like /etc. (Not going into detail here).
  2. Allthough not mentioned, duplicati does not really accept root (/) as a folder. This probably explains the negative length exception.
  3. duplicati install is user-specific. My instinct was that it needed root, or at least sudo privileges.
    That got me in all sorts of at first inexplicable trouble, e.g. an unsurmountable password challenge when running as root, after starting the service as root.
  4. Since I want sudo privilege, I ended up by copying the user database to the root position.
    Then it worked. Now considering what to do next.
    So, although support is welcome, and especially reaction why I am wrong or what else is relevant, the largest difficulty seems over.

Hi @janhec, welcome to the forum :waving_hand:

That issue was fixed for 2.2.0.3, are you running the latest stable version?

The fix is here: Minor fixes · duplicati/duplicati@83779a9 · GitHub

The problem occurs if the source is very short, so if you have something like:

file:///

Then it will trigger the issue.

Hi @kenkendk,
Thank you for the reaction. This is what duplicati has to say:
You’re running Duplicati with - 2.2.0.3 - 2.2.0.3_stable_2026-01-06
So, a short source should be ok, but may trigger, depending on the situation?

@kenkendk
Remember I am really new to duplicati…
Should I have selected Computer, instead of manually entering / (I learned about the file:// prefix only later)?
I am changing my backup source anyway to a set starting with /etc, to restore the system part of my Ubuntu installation through reinstall. So I expect that I will not be immediately troubled by this again.

I just verified, the fix does not cover paths that are less than 3 characters.
A new fix is ready:

No,/ is actually correct.

However, I do not recommend making a backup of / because there are a lot of things that you cannot backup in there (disks, memory, devices, etc).

If you only choose explicit paths, the issue should go away, as the shortest (common) path would be /etc. If you have a shorter one, like /a or really do want /, a workaround would be to create a symlink with a longer name, like:

ln -s / /everything

and then choose /everything as the source.