Connection to server was rejected due to invalid authentication

Hi guys, I have been running duplicati for a couple of years and really appreciate the software. I have an issue and would love some help…

I run duplicati on docker and manage my containers using Portainer.

I updated Duplicati using docker compose yesterday and noticed some warnings on my backups overnight.

I tried to log in via the web UI and got the error “Connection to server was rejected due to invalid authentication.” with the option to log in. I have never had a password for Duplicati as everything is local.

Any ideas?

LimitedErrors: []
Log data:
2024-12-11 01:02:16 +00 - [Warning-Duplicati.Library.Main.Operation.Backup.FileBlockProcessor.FileEntry-PathProcessingFailed]: Failed to process path: /source/home/peter/DockerVolumes/influxdb/data/influxd.bolt
System.IO.IOException: The process cannot access the file '/source/home/peter/DockerVolumes/influxdb/data/influxd.bolt' because it is being used by another process.
  at Microsoft.Win32.SafeHandles.SafeFileHandle.Init(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Int64& fileLength, UnixFileMode& filePermissions)
  at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, UnixFileMode openPermissions, Int64& fileLength, UnixFileMode& filePermissions, Boolean failForSymlink, Boolean& wasSymlink, Func`4 createOpenException)
  at System.IO.Strategies.OSFileStreamStrategy..ctor(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Nullable`1 unixCreateMode)
  at Duplicati.Library.Snapshots.NoSnapshotLinux.OpenRead(String localPath)
  at Duplicati.Library.Main.Operation.Backup.FileBlockProcessor.<>c__DisplayClass1_0.<<Run>b__0>d.MoveNext()
2024-12-11 01:02:28 +00 - [Warning-Duplicati.Library.Main.Operation.Backup.FileBlockProcessor.FileEntry-PathProcessingFailed]: Failed to process path: /source/home/peter/DockerVolumes/portainer/portainer.db
System.IO.IOException: The process cannot access the file '/source/home/peter/DockerVolumes/portainer/portainer.db' because it is being used by another process.
  at Microsoft.Win32.SafeHandles.SafeFileHandle.Init(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Int64& fileLength, UnixFileMode& filePermissions)
  at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, UnixFileMode openPermissions, Int64& fileLength, UnixFileMode& filePermissions, Boolean failForSymlink, Boolean& wasSymlink, Func`4 createOpenException)
  at System.IO.Strategies.OSFileStreamStrategy..ctor(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Nullable`1 unixCreateMode)
  at Duplicati.Library.Snapshots.NoSnapshotLinux.OpenRead(String localPath)
  at Duplicati.Library.Main.Operation.Backup.FileBlockProcessor.<>c__DisplayClass1_0.<<Run>b__0>d.MoveNext()
2024-12-11 01:02:28 +00 - [Warning-Duplicati.Library.Main.Operation.Backup.FileBlockProcessor.FileEntry-PathProcessingFailed]: Failed to process path: /source/home/peter/DockerVolumes/portainer/useractivity.db
System.IO.IOException: The process cannot access the file '/source/home/peter/DockerVolumes/portainer/useractivity.db' because it is being used by another process.
  at Microsoft.Win32.SafeHandles.SafeFileHandle.Init(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Int64& fileLength, UnixFileMode& filePermissions)
  at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, UnixFileMode openPermissions, Int64& fileLength, UnixFileMode& filePermissions, Boolean failForSymlink, Boolean& wasSymlink, Func`4 createOpenException)
  at System.IO.Strategies.OSFileStreamStrategy..ctor(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Nullable`1 unixCreateMode)
  at Duplicati.Library.Snapshots.NoSnapshotLinux.OpenRead(String localPath)
  at Duplicati.Library.Main.Operation.Backup.FileBlockProcessor.<>c__DisplayClass1_0.<<Run>b__0>d.MoveNext()


I have found the problem, I had to look in the logs and log in using the key provided by the logs. I guess I should read the release notes rather than just update to latest in Portainer!

1 Like

That is a new requirement for Duplicati: mandatory API password.

With Docker, you can set the environment variable:

DUPLICATI__WEBSERVICE_PASSWORD=<your password>

This is caused by the update to .NET8 where Linux advisory file locking is now honored. The real fix is to use LVM and set up snapshots so you get a consistent view, but you can also choose to get a “write-consistent” view as Duplicati did in 2.0.8.1 and older.

To get a “write-consistent” view, you can set the option --ignore-advisory-locking=true (it can be set globally to work for all backups).

with Docker, you can also consider setting the environment variable:

DOTNET_SYSTEM_IO_DISABLEFILELOCKING=true

Which will ignore any advisory locks from within Duplicati.

I have created a documentation page that describes some common setups for Duplicati in Docker.

1 Like

Thank you, much appreciated

1 Like

Do you know how to set the environment variable if I run Duplicati in unRAID? I have the same problem as the original poster, and I would appreciate any help!

i think you can check the unRAID forum for a description:

1 Like

Thank you so much - this worked. Much appreciated.

1 Like