Strange behavior with SFTP

Hey everyone,

I am using Duplicati to backup from two RaspberryPi to a Hetzner StorageBox via SFTP. Both are running the latest linuxserver docker image.
On one of them, the Backups are already running for several months, on the other I recently switched the backend to this StorageBox.

When I did this, I started getting this error on the new instance:

Error Log
Failed: One or more errors occurred. (Cannot access a disposed object.
Object name: 'System.Net.Sockets.Socket'. (Cannot access a disposed object.
Object name: 'System.Net.Sockets.Socket'.) (One or more errors occurred. (Cannot access a disposed object.
Object name: 'System.Net.Sockets.Socket'.)))
Details: System.AggregateException: One or more errors occurred. (Cannot access a disposed object.
Object name: 'System.Net.Sockets.Socket'. (Cannot access a disposed object.
Object name: 'System.Net.Sockets.Socket'.) (One or more errors occurred. (Cannot access a disposed object.
Object name: 'System.Net.Sockets.Socket'.))) ---> System.AggregateException: Cannot access a disposed object.
Object name: 'System.Net.Sockets.Socket'. (Cannot access a disposed object.
Object name: 'System.Net.Sockets.Socket'.) (One or more errors occurred. (Cannot access a disposed object.
Object name: 'System.Net.Sockets.Socket'.)) ---> System.ObjectDisposedException: Cannot access a disposed object.
Object name: 'System.Net.Sockets.Socket'.
  at System.Net.Sockets.Socket.ThrowIfDisposedAndClosed () [0x0001b] in <a8a996a78a804d888710c9e2575d78c8>:0 
  at System.Net.Sockets.Socket.GetSocketOption (System.Net.Sockets.SocketOptionLevel optionLevel, System.Net.Sockets.SocketOptionName optionName) [0x00000] in <a8a996a78a804d888710c9e2575d78c8>:0 
  at System.Net.Sockets.Socket.Poll (System.Int32 microSeconds, System.Net.Sockets.SelectMode mode) [0x00046] in <a8a996a78a804d888710c9e2575d78c8>:0 
  at Renci.SshNet.Abstractions.SocketAbstraction.CanWrite (System.Net.Sockets.Socket socket) [0x0000b] in <a5033589e6f4462cad1b72eda36eb0eb>:0 
  at Renci.SshNet.Common.Extensions.CanWrite (System.Net.Sockets.Socket socket) [0x00000] in <a5033589e6f4462cad1b72eda36eb0eb>:0 
  at Renci.SshNet.Session.SendMessage (Renci.SshNet.Messages.Message message) [0x00000] in <a5033589e6f4462cad1b72eda36eb0eb>:0 
  at Renci.SshNet.Session.Renci.SshNet.ISession.SendMessage (Renci.SshNet.Messages.Message message) [0x00000] in <a5033589e6f4462cad1b72eda36eb0eb>:0 
  at Renci.SshNet.Channels.Channel.SendData (System.Byte[] data, System.Int32 offset, System.Int32 size) [0x00024] in <a5033589e6f4462cad1b72eda36eb0eb>:0 
  at Renci.SshNet.Channels.Channel.SendData (System.Byte[] data) [0x00000] in <a5033589e6f4462cad1b72eda36eb0eb>:0 
  at Renci.SshNet.SubsystemSession.SendData (System.Byte[] data) [0x0000c] in <a5033589e6f4462cad1b72eda36eb0eb>:0 
  at Renci.SshNet.Sftp.SftpSession.SendMessage (Renci.SshNet.Sftp.SftpMessage sftpMessage) [0x00007] in <a5033589e6f4462cad1b72eda36eb0eb>:0 
  at Renci.SshNet.Sftp.SftpSession.SendRequest (Renci.SshNet.Sftp.Requests.SftpRequest request) [0x0002f] in <a5033589e6f4462cad1b72eda36eb0eb>:0 
  at Renci.SshNet.Sftp.SftpSession.RequestWrite (System.Byte[] handle, System.UInt64 serverOffset, System.Byte[] data, System.Int32 offset, System.Int32 length, System.Threading.AutoResetEvent wait, System.Action`1[T] writeCompleted) [0x00042] in <a5033589e6f4462cad1b72eda36eb0eb>:0 
  at Renci.SshNet.SftpClient.InternalUploadFile (System.IO.Stream input, System.String path, Renci.SshNet.Sftp.Flags flags, Renci.SshNet.Sftp.SftpUploadAsyncResult asyncResult, System.Action`1[T] uploadCallback) [0x000dc] in <a5033589e6f4462cad1b72eda36eb0eb>:0 
  at Renci.SshNet.SftpClient.UploadFile (System.IO.Stream input, System.String path, System.Boolean canOverride, System.Action`1[T] uploadCallback) [0x00017] in <a5033589e6f4462cad1b72eda36eb0eb>:0 
  at Renci.SshNet.SftpClient.UploadFile (System.IO.Stream input, System.String path, System.Action`1[T] uploadCallback) [0x00000] in <a5033589e6f4462cad1b72eda36eb0eb>:0 
  at Duplicati.Library.Backend.SSHv2.PutAsync (System.String remotename, System.IO.Stream stream, System.Threading.CancellationToken cancelToken) [0x00012] in <8fe419baa0b4450e802077c005f8f2b8>:0 
  at Duplicati.Library.Main.Operation.Backup.BackendUploader.DoPut (Duplicati.Library.Main.Operation.Common.BackendHandler+FileEntryItem item, Duplicati.Library.Interface.IBackend backend, System.Threading.CancellationToken cancelToken) [0x003a4] in <9b99db820df3422db0aa96d4648dc7b1>:0 
  at Duplicati.Library.Main.Operation.Backup.BackendUploader+<>c__DisplayClass20_0.<UploadFileAsync>b__0 () [0x0010a] in <9b99db820df3422db0aa96d4648dc7b1>:0 
  at Duplicati.Library.Main.Operation.Backup.BackendUploader.DoWithRetry (System.Func`1[TResult] method, Duplicati.Library.Main.Operation.Common.BackendHandler+FileEntryItem item, Duplicati.Library.Main.Operation.Backup.BackendUploader+Worker worker, System.Threading.CancellationToken cancelToken) [0x00198] in <9b99db820df3422db0aa96d4648dc7b1>:0 
  at Duplicati.Library.Main.Operation.Backup.BackendUploader.DoWithRetry (System.Func`1[TResult] method, Duplicati.Library.Main.Operation.Common.BackendHandler+FileEntryItem item, Duplicati.Library.Main.Operation.Backup.BackendUploader+Worker worker, System.Threading.CancellationToken cancelToken) [0x003c1] in <9b99db820df3422db0aa96d4648dc7b1>:0 
  at Duplicati.Library.Main.Operation.Backup.BackendUploader.UploadFileAsync (Duplicati.Library.Main.Operation.Common.BackendHandler+FileEntryItem item, Duplicati.Library.Main.Operation.Backup.BackendUploader+Worker worker, System.Threading.CancellationToken cancelToken) [0x000da] in <9b99db820df3422db0aa96d4648dc7b1>:0 
  at Duplicati.Library.Main.Operation.Backup.BackendUploader.UploadBlockAndIndexAsync (Duplicati.Library.Main.Operation.Backup.VolumeUploadRequest upload, Duplicati.Library.Main.Operation.Backup.BackendUploader+Worker worker, System.Threading.CancellationToken cancelToken) [0x00098] in <9b99db820df3422db0aa96d4648dc7b1>:0 
  at CoCoL.AutomationExtensions.RunTask[T] (T channels, System.Func`2[T,TResult] method, System.Boolean catchRetiredExceptions) [0x000d4] in <9a758ff4db6c48d6b3d4d0e5c2adf6d1>:0 
  at Duplicati.Library.Main.Operation.BackupHandler.FlushBackend (Duplicati.Library.Main.BackupResults result, CoCoL.IWriteChannel`1[T] uploadtarget, System.Threading.Tasks.Task uploader) [0x00185] in <9b99db820df3422db0aa96d4648dc7b1>:0 
  at Duplicati.Library.Main.Operation.BackupHandler.RunAsync (System.String[] sources, Duplicati.Library.Utility.IFilter filter, System.Threading.CancellationToken token) [0x00cb2] in <9b99db820df3422db0aa96d4648dc7b1>:0 
   --- End of inner exception stack trace ---
  at Duplicati.Library.Main.Operation.BackupHandler.RunAsync (System.String[] sources, Duplicati.Library.Utility.IFilter filter, System.Threading.CancellationToken token) [0x01048] in <9b99db820df3422db0aa96d4648dc7b1>:0 
   --- End of inner exception stack trace ---
  at CoCoL.ChannelExtensions.WaitForTaskOrThrow (System.Threading.Tasks.Task task) [0x0005d] in <9a758ff4db6c48d6b3d4d0e5c2adf6d1>:0 
  at Duplicati.Library.Main.Operation.BackupHandler.Run (System.String[] sources, Duplicati.Library.Utility.IFilter filter, System.Threading.CancellationToken token) [0x00009] in <9b99db820df3422db0aa96d4648dc7b1>:0 
  at Duplicati.Library.Main.Controller+<>c__DisplayClass14_0.<Backup>b__0 (Duplicati.Library.Main.BackupResults result) [0x0004b] in <9b99db820df3422db0aa96d4648dc7b1>:0 
  at Duplicati.Library.Main.Controller.RunAction[T] (T result, System.String[]& paths, Duplicati.Library.Utility.IFilter& filter, System.Action`1[T] method) [0x0011d] in <9b99db820df3422db0aa96d4648dc7b1>:0 
---> (Inner Exception #0) System.AggregateException: Cannot access a disposed object.
Object name: 'System.Net.Sockets.Socket'. (Cannot access a disposed object.
Object name: 'System.Net.Sockets.Socket'.) (One or more errors occurred. (Cannot access a disposed object.
Object name: 'System.Net.Sockets.Socket'.)) ---> System.ObjectDisposedException: Cannot access a disposed object.
Object name: 'System.Net.Sockets.Socket'.
  at System.Net.Sockets.Socket.ThrowIfDisposedAndClosed () [0x0001b] in <a8a996a78a804d888710c9e2575d78c8>:0 
  at System.Net.Sockets.Socket.GetSocketOption (System.Net.Sockets.SocketOptionLevel optionLevel, System.Net.Sockets.SocketOptionName optionName) [0x00000] in <a8a996a78a804d888710c9e2575d78c8>:0 
  at System.Net.Sockets.Socket.Poll (System.Int32 microSeconds, System.Net.Sockets.SelectMode mode) [0x00046] in <a8a996a78a804d888710c9e2575d78c8>:0 
  at Renci.SshNet.Abstractions.SocketAbstraction.CanWrite (System.Net.Sockets.Socket socket) [0x0000b] in <a5033589e6f4462cad1b72eda36eb0eb>:0 
  at Renci.SshNet.Common.Extensions.CanWrite (System.Net.Sockets.Socket socket) [0x00000] in <a5033589e6f4462cad1b72eda36eb0eb>:0 
  at Renci.SshNet.Session.SendMessage (Renci.SshNet.Messages.Message message) [0x00000] in <a5033589e6f4462cad1b72eda36eb0eb>:0 
  at Renci.SshNet.Session.Renci.SshNet.ISession.SendMessage (Renci.SshNet.Messages.Message message) [0x00000] in <a5033589e6f4462cad1b72eda36eb0eb>:0 
  at Renci.SshNet.Channels.Channel.SendData (System.Byte[] data, System.Int32 offset, System.Int32 size) [0x00024] in <a5033589e6f4462cad1b72eda36eb0eb>:0 
  at Renci.SshNet.Channels.Channel.SendData (System.Byte[] data) [0x00000] in <a5033589e6f4462cad1b72eda36eb0eb>:0 
  at Renci.SshNet.SubsystemSession.SendData (System.Byte[] data) [0x0000c] in <a5033589e6f4462cad1b72eda36eb0eb>:0 
  at Renci.SshNet.Sftp.SftpSession.SendMessage (Renci.SshNet.Sftp.SftpMessage sftpMessage) [0x00007] in <a5033589e6f4462cad1b72eda36eb0eb>:0 
  at Renci.SshNet.Sftp.SftpSession.SendRequest (Renci.SshNet.Sftp.Requests.SftpRequest request) [0x0002f] in <a5033589e6f4462cad1b72eda36eb0eb>:0 
  at Renci.SshNet.Sftp.SftpSession.RequestWrite (System.Byte[] handle, System.UInt64 serverOffset, System.Byte[] data, System.Int32 offset, System.Int32 length, System.Threading.AutoResetEvent wait, System.Action`1[T] writeCompleted) [0x00042] in <a5033589e6f4462cad1b72eda36eb0eb>:0 
  at Renci.SshNet.SftpClient.InternalUploadFile (System.IO.Stream input, System.String path, Renci.SshNet.Sftp.Flags flags, Renci.SshNet.Sftp.SftpUploadAsyncResult asyncResult, System.Action`1[T] uploadCallback) [0x000dc] in <a5033589e6f4462cad1b72eda36eb0eb>:0 
  at Renci.SshNet.SftpClient.UploadFile (System.IO.Stream input, System.String path, System.Boolean canOverride, System.Action`1[T] uploadCallback) [0x00017] in <a5033589e6f4462cad1b72eda36eb0eb>:0 
  at Renci.SshNet.SftpClient.UploadFile (System.IO.Stream input, System.String path, System.Action`1[T] uploadCallback) [0x00000] in <a5033589e6f4462cad1b72eda36eb0eb>:0 
  at Duplicati.Library.Backend.SSHv2.PutAsync (System.String remotename, System.IO.Stream stream, System.Threading.CancellationToken cancelToken) [0x00012] in <8fe419baa0b4450e802077c005f8f2b8>:0 
  at Duplicati.Library.Main.Operation.Backup.BackendUploader.DoPut (Duplicati.Library.Main.Operation.Common.BackendHandler+FileEntryItem item, Duplicati.Library.Interface.IBackend backend, System.Threading.CancellationToken cancelToken) [0x003a4] in <9b99db820df3422db0aa96d4648dc7b1>:0 
  at Duplicati.Library.Main.Operation.Backup.BackendUploader+<>c__DisplayClass20_0.<UploadFileAsync>b__0 () [0x0010a] in <9b99db820df3422db0aa96d4648dc7b1>:0 
  at Duplicati.Library.Main.Operation.Backup.BackendUploader.DoWithRetry (System.Func`1[TResult] method, Duplicati.Library.Main.Operation.Common.BackendHandler+FileEntryItem item, Duplicati.Library.Main.Operation.Backup.BackendUploader+Worker worker, System.Threading.CancellationToken cancelToken) [0x00198] in <9b99db820df3422db0aa96d4648dc7b1>:0 
  at Duplicati.Library.Main.Operation.Backup.BackendUploader.DoWithRetry (System.Func`1[TResult] method, Duplicati.Library.Main.Operation.Common.BackendHandler+FileEntryItem item, Duplicati.Library.Main.Operation.Backup.BackendUploader+Worker worker, System.Threading.CancellationToken cancelToken) [0x003c1] in <9b99db820df3422db0aa96d4648dc7b1>:0 
  at Duplicati.Library.Main.Operation.Backup.BackendUploader.UploadFileAsync (Duplicati.Library.Main.Operation.Common.BackendHandler+FileEntryItem item, Duplicati.Library.Main.Operation.Backup.BackendUploader+Worker worker, System.Threading.CancellationToken cancelToken) [0x000da] in <9b99db820df3422db0aa96d4648dc7b1>:0 
  at Duplicati.Library.Main.Operation.Backup.BackendUploader.UploadBlockAndIndexAsync (Duplicati.Library.Main.Operation.Backup.VolumeUploadRequest upload, Duplicati.Library.Main.Operation.Backup.BackendUploader+Worker worker, System.Threading.CancellationToken cancelToken) [0x00098] in <9b99db820df3422db0aa96d4648dc7b1>:0 
  at CoCoL.AutomationExtensions.RunTask[T] (T channels, System.Func`2[T,TResult] method, System.Boolean catchRetiredExceptions) [0x000d4] in <9a758ff4db6c48d6b3d4d0e5c2adf6d1>:0 
  at Duplicati.Library.Main.Operation.BackupHandler.FlushBackend (Duplicati.Library.Main.BackupResults result, CoCoL.IWriteChannel`1[T] uploadtarget, System.Threading.Tasks.Task uploader) [0x00185] in <9b99db820df3422db0aa96d4648dc7b1>:0 
  at Duplicati.Library.Main.Operation.BackupHandler.RunAsync (System.String[] sources, Duplicati.Library.Utility.IFilter filter, System.Threading.CancellationToken token) [0x00cb2] in <9b99db820df3422db0aa96d4648dc7b1>:0 
   --- End of inner exception stack trace ---
  at Duplicati.Library.Main.Operation.BackupHandler.RunAsync (System.String[] sources, Duplicati.Library.Utility.IFilter filter, System.Threading.CancellationToken token) [0x01048] in <9b99db820df3422db0aa96d4648dc7b1>:0 
---> (Inner Exception #0) System.ObjectDisposedException: Cannot access a disposed object.
Object name: 'System.Net.Sockets.Socket'.
  at System.Net.Sockets.Socket.ThrowIfDisposedAndClosed () [0x0001b] in <a8a996a78a804d888710c9e2575d78c8>:0 
  at System.Net.Sockets.Socket.GetSocketOption (System.Net.Sockets.SocketOptionLevel optionLevel, System.Net.Sockets.SocketOptionName optionName) [0x00000] in <a8a996a78a804d888710c9e2575d78c8>:0 
  at System.Net.Sockets.Socket.Poll (System.Int32 microSeconds, System.Net.Sockets.SelectMode mode) [0x00046] in <a8a996a78a804d888710c9e2575d78c8>:0 
  at Renci.SshNet.Abstractions.SocketAbstraction.CanWrite (System.Net.Sockets.Socket socket) [0x0000b] in <a5033589e6f4462cad1b72eda36eb0eb>:0 
  at Renci.SshNet.Common.Extensions.CanWrite (System.Net.Sockets.Socket socket) [0x00000] in <a5033589e6f4462cad1b72eda36eb0eb>:0 
  at Renci.SshNet.Session.SendMessage (Renci.SshNet.Messages.Message message) [0x00000] in <a5033589e6f4462cad1b72eda36eb0eb>:0 
  at Renci.SshNet.Session.Renci.SshNet.ISession.SendMessage (Renci.SshNet.Messages.Message message) [0x00000] in <a5033589e6f4462cad1b72eda36eb0eb>:0 
  at Renci.SshNet.Channels.Channel.SendData (System.Byte[] data, System.Int32 offset, System.Int32 size) [0x00024] in <a5033589e6f4462cad1b72eda36eb0eb>:0 
  at Renci.SshNet.Channels.Channel.SendData (System.Byte[] data) [0x00000] in <a5033589e6f4462cad1b72eda36eb0eb>:0 
  at Renci.SshNet.SubsystemSession.SendData (System.Byte[] data) [0x0000c] in <a5033589e6f4462cad1b72eda36eb0eb>:0 
  at Renci.SshNet.Sftp.SftpSession.SendMessage (Renci.SshNet.Sftp.SftpMessage sftpMessage) [0x00007] in <a5033589e6f4462cad1b72eda36eb0eb>:0 
  at Renci.SshNet.Sftp.SftpSession.SendRequest (Renci.SshNet.Sftp.Requests.SftpRequest request) [0x0002f] in <a5033589e6f4462cad1b72eda36eb0eb>:0 
  at Renci.SshNet.Sftp.SftpSession.RequestWrite (System.Byte[] handle, System.UInt64 serverOffset, System.Byte[] data, System.Int32 offset, System.Int32 length, System.Threading.AutoResetEvent wait, System.Action`1[T] writeCompleted) [0x00042] in <a5033589e6f4462cad1b72eda36eb0eb>:0 
  at Renci.SshNet.SftpClient.InternalUploadFile (System.IO.Stream input, System.String path, Renci.SshNet.Sftp.Flags flags, Renci.SshNet.Sftp.SftpUploadAsyncResult asyncResult, System.Action`1[T] uploadCallback) [0x000dc] in <a5033589e6f4462cad1b72eda36eb0eb>:0 
  at Renci.SshNet.SftpClient.UploadFile (System.IO.Stream input, System.String path, System.Boolean canOverride, System.Action`1[T] uploadCallback) [0x00017] in <a5033589e6f4462cad1b72eda36eb0eb>:0 
  at Renci.SshNet.SftpClient.UploadFile (System.IO.Stream input, System.String path, System.Action`1[T] uploadCallback) [0x00000] in <a5033589e6f4462cad1b72eda36eb0eb>:0 
  at Duplicati.Library.Backend.SSHv2.PutAsync (System.String remotename, System.IO.Stream stream, System.Threading.CancellationToken cancelToken) [0x00012] in <8fe419baa0b4450e802077c005f8f2b8>:0 
  at Duplicati.Library.Main.Operation.Backup.BackendUploader.DoPut (Duplicati.Library.Main.Operation.Common.BackendHandler+FileEntryItem item, Duplicati.Library.Interface.IBackend backend, System.Threading.CancellationToken cancelToken) [0x003a4] in <9b99db820df3422db0aa96d4648dc7b1>:0 
  at Duplicati.Library.Main.Operation.Backup.BackendUploader+<>c__DisplayClass20_0.<UploadFileAsync>b__0 () [0x0010a] in <9b99db820df3422db0aa96d4648dc7b1>:0 
  at Duplicati.Library.Main.Operation.Backup.BackendUploader.DoWithRetry (System.Func`1[TResult] method, Duplicati.Library.Main.Operation.Common.BackendHandler+FileEntryItem item, Duplicati.Library.Main.Operation.Backup.BackendUploader+Worker worker, System.Threading.CancellationToken cancelToken) [0x00198] in <9b99db820df3422db0aa96d4648dc7b1>:0 
  at Duplicati.Library.Main.Operation.Backup.BackendUploader.DoWithRetry (System.Func`1[TResult] method, Duplicati.Library.Main.Operation.Common.BackendHandler+FileEntryItem item, Duplicati.Library.Main.Operation.Backup.BackendUploader+Worker worker, System.Threading.CancellationToken cancelToken) [0x003c1] in <9b99db820df3422db0aa96d4648dc7b1>:0 
  at Duplicati.Library.Main.Operation.Backup.BackendUploader.UploadFileAsync (Duplicati.Library.Main.Operation.Common.BackendHandler+FileEntryItem item, Duplicati.Library.Main.Operation.Backup.BackendUploader+Worker worker, System.Threading.CancellationToken cancelToken) [0x000da] in <9b99db820df3422db0aa96d4648dc7b1>:0 
  at Duplicati.Library.Main.Operation.Backup.BackendUploader.UploadBlockAndIndexAsync (Duplicati.Library.Main.Operation.Backup.VolumeUploadRequest upload, Duplicati.Library.Main.Operation.Backup.BackendUploader+Worker worker, System.Threading.CancellationToken cancelToken) [0x00098] in <9b99db820df3422db0aa96d4648dc7b1>:0 
  at CoCoL.AutomationExtensions.RunTask[T] (T channels, System.Func`2[T,TResult] method, System.Boolean catchRetiredExceptions) [0x000d4] in <9a758ff4db6c48d6b3d4d0e5c2adf6d1>:0 
  at Duplicati.Library.Main.Operation.BackupHandler.FlushBackend (Duplicati.Library.Main.BackupResults result, CoCoL.IWriteChannel`1[T] uploadtarget, System.Threading.Tasks.Task uploader) [0x00185] in <9b99db820df3422db0aa96d4648dc7b1>:0 
  at Duplicati.Library.Main.Operation.BackupHandler.RunAsync (System.String[] sources, Duplicati.Library.Utility.IFilter filter, System.Threading.CancellationToken token) [0x00cb2] in <9b99db820df3422db0aa96d4648dc7b1>:0 <---

---> (Inner Exception #1) System.AggregateException: One or more errors occurred. (Cannot access a disposed object.
Object name: 'System.Net.Sockets.Socket'.) ---> System.ObjectDisposedException: Cannot access a disposed object.
Object name: 'System.Net.Sockets.Socket'.
  at System.Net.Sockets.Socket.ThrowIfDisposedAndClosed () [0x0001b] in <a8a996a78a804d888710c9e2575d78c8>:0 
  at System.Net.Sockets.Socket.GetSocketOption (System.Net.Sockets.SocketOptionLevel optionLevel, System.Net.Sockets.SocketOptionName optionName) [0x00000] in <a8a996a78a804d888710c9e2575d78c8>:0 
  at System.Net.Sockets.Socket.Poll (System.Int32 microSeconds, System.Net.Sockets.SelectMode mode) [0x00046] in <a8a996a78a804d888710c9e2575d78c8>:0 
  at Renci.SshNet.Abstractions.SocketAbstraction.CanWrite (System.Net.Sockets.Socket socket) [0x0000b] in <a5033589e6f4462cad1b72eda36eb0eb>:0 
  at Renci.SshNet.Common.Extensions.CanWrite (System.Net.Sockets.Socket socket) [0x00000] in <a5033589e6f4462cad1b72eda36eb0eb>:0 
  at Renci.SshNet.Session.SendMessage (Renci.SshNet.Messages.Message message) [0x00000] in <a5033589e6f4462cad1b72eda36eb0eb>:0 
  at Renci.SshNet.Session.Renci.SshNet.ISession.SendMessage (Renci.SshNet.Messages.Message message) [0x00000] in <a5033589e6f4462cad1b72eda36eb0eb>:0 
  at Renci.SshNet.Channels.Channel.SendData (System.Byte[] data, System.Int32 offset, System.Int32 size) [0x00024] in <a5033589e6f4462cad1b72eda36eb0eb>:0 
  at Renci.SshNet.Channels.Channel.SendData (System.Byte[] data) [0x00000] in <a5033589e6f4462cad1b72eda36eb0eb>:0 
  at Renci.SshNet.SubsystemSession.SendData (System.Byte[] data) [0x0000c] in <a5033589e6f4462cad1b72eda36eb0eb>:0 
  at Renci.SshNet.Sftp.SftpSession.SendMessage (Renci.SshNet.Sftp.SftpMessage sftpMessage) [0x00007] in <a5033589e6f4462cad1b72eda36eb0eb>:0 
  at Renci.SshNet.Sftp.SftpSession.SendRequest (Renci.SshNet.Sftp.Requests.SftpRequest request) [0x0002f] in <a5033589e6f4462cad1b72eda36eb0eb>:0 
  at Renci.SshNet.Sftp.SftpSession.RequestWrite (System.Byte[] handle, System.UInt64 serverOffset, System.Byte[] data, System.Int32 offset, System.Int32 length, System.Threading.AutoResetEvent wait, System.Action`1[T] writeCompleted) [0x00042] in <a5033589e6f4462cad1b72eda36eb0eb>:0 
  at Renci.SshNet.SftpClient.InternalUploadFile (System.IO.Stream input, System.String path, Renci.SshNet.Sftp.Flags flags, Renci.SshNet.Sftp.SftpUploadAsyncResult asyncResult, System.Action`1[T] uploadCallback) [0x000dc] in <a5033589e6f4462cad1b72eda36eb0eb>:0 
  at Renci.SshNet.SftpClient.UploadFile (System.IO.Stream input, System.String path, System.Boolean canOverride, System.Action`1[T] uploadCallback) [0x00017] in <a5033589e6f4462cad1b72eda36eb0eb>:0 
  at Renci.SshNet.SftpClient.UploadFile (System.IO.Stream input, System.String path, System.Action`1[T] uploadCallback) [0x00000] in <a5033589e6f4462cad1b72eda36eb0eb>:0 
  at Duplicati.Library.Backend.SSHv2.PutAsync (System.String remotename, System.IO.Stream stream, System.Threading.CancellationToken cancelToken) [0x00012] in <8fe419baa0b4450e802077c005f8f2b8>:0 
  at Duplicati.Library.Main.Operation.Backup.BackendUploader.DoPut (Duplicati.Library.Main.Operation.Common.BackendHandler+FileEntryItem item, Duplicati.Library.Interface.IBackend backend, System.Threading.CancellationToken cancelToken) [0x003a4] in <9b99db820df3422db0aa96d4648dc7b1>:0 
  at Duplicati.Library.Main.Operation.Backup.BackendUploader+<>c__DisplayClass20_0.<UploadFileAsync>b__0 () [0x0010a] in <9b99db820df3422db0aa96d4648dc7b1>:0 
  at Duplicati.Library.Main.Operation.Backup.BackendUploader.DoWithRetry (System.Func`1[TResult] method, Duplicati.Library.Main.Operation.Common.BackendHandler+FileEntryItem item, Duplicati.Library.Main.Operation.Backup.BackendUploader+Worker worker, System.Threading.CancellationToken cancelToken) [0x00198] in <9b99db820df3422db0aa96d4648dc7b1>:0 
  at Duplicati.Library.Main.Operation.Backup.BackendUploader.DoWithRetry (System.Func`1[TResult] method, Duplicati.Library.Main.Operation.Common.BackendHandler+FileEntryItem item, Duplicati.Library.Main.Operation.Backup.BackendUploader+Worker worker, System.Threading.CancellationToken cancelToken) [0x003c1] in <9b99db820df3422db0aa96d4648dc7b1>:0 
  at Duplicati.Library.Main.Operation.Backup.BackendUploader.UploadFileAsync (Duplicati.Library.Main.Operation.Common.BackendHandler+FileEntryItem item, Duplicati.Library.Main.Operation.Backup.BackendUploader+Worker worker, System.Threading.CancellationToken cancelToken) [0x000da] in <9b99db820df3422db0aa96d4648dc7b1>:0 
  at Duplicati.Library.Main.Operation.Backup.BackendUploader.UploadBlockAndIndexAsync (Duplicati.Library.Main.Operation.Backup.VolumeUploadRequest upload, Duplicati.Library.Main.Operation.Backup.BackendUploader+Worker worker, System.Threading.CancellationToken cancelToken) [0x00098] in <9b99db820df3422db0aa96d4648dc7b1>:0 
  at CoCoL.AutomationExtensions.RunTask[T] (T channels, System.Func`2[T,TResult] method, System.Boolean catchRetiredExceptions) [0x000d4] in <9a758ff4db6c48d6b3d4d0e5c2adf6d1>:0 
  at Duplicati.Library.Main.Operation.BackupHandler.FlushBackend (Duplicati.Library.Main.BackupResults result, CoCoL.IWriteChannel`1[T] uploadtarget, System.Threading.Tasks.Task uploader) [0x00185] in <9b99db820df3422db0aa96d4648dc7b1>:0 
  at Duplicati.Library.Main.Operation.BackupHandler.RunAsync (System.String[] sources, Duplicati.Library.Utility.IFilter filter, System.Threading.CancellationToken token) [0x00cb2] in <9b99db820df3422db0aa96d4648dc7b1>:0 
   --- End of inner exception stack trace ---
---> (Inner Exception #0) System.ObjectDisposedException: Cannot access a disposed object.
Object name: 'System.Net.Sockets.Socket'.
  at System.Net.Sockets.Socket.ThrowIfDisposedAndClosed () [0x0001b] in <a8a996a78a804d888710c9e2575d78c8>:0 
  at System.Net.Sockets.Socket.GetSocketOption (System.Net.Sockets.SocketOptionLevel optionLevel, System.Net.Sockets.SocketOptionName optionName) [0x00000] in <a8a996a78a804d888710c9e2575d78c8>:0 
  at System.Net.Sockets.Socket.Poll (System.Int32 microSeconds, System.Net.Sockets.SelectMode mode) [0x00046] in <a8a996a78a804d888710c9e2575d78c8>:0 
  at Renci.SshNet.Abstractions.SocketAbstraction.CanWrite (System.Net.Sockets.Socket socket) [0x0000b] in <a5033589e6f4462cad1b72eda36eb0eb>:0 
  at Renci.SshNet.Common.Extensions.CanWrite (System.Net.Sockets.Socket socket) [0x00000] in <a5033589e6f4462cad1b72eda36eb0eb>:0 
  at Renci.SshNet.Session.SendMessage (Renci.SshNet.Messages.Message message) [0x00000] in <a5033589e6f4462cad1b72eda36eb0eb>:0 
  at Renci.SshNet.Session.Renci.SshNet.ISession.SendMessage (Renci.SshNet.Messages.Message message) [0x00000] in <a5033589e6f4462cad1b72eda36eb0eb>:0 
  at Renci.SshNet.Channels.Channel.SendData (System.Byte[] data, System.Int32 offset, System.Int32 size) [0x00024] in <a5033589e6f4462cad1b72eda36eb0eb>:0 
  at Renci.SshNet.Channels.Channel.SendData (System.Byte[] data) [0x00000] in <a5033589e6f4462cad1b72eda36eb0eb>:0 
  at Renci.SshNet.SubsystemSession.SendData (System.Byte[] data) [0x0000c] in <a5033589e6f4462cad1b72eda36eb0eb>:0 
  at Renci.SshNet.Sftp.SftpSession.SendMessage (Renci.SshNet.Sftp.SftpMessage sftpMessage) [0x00007] in <a5033589e6f4462cad1b72eda36eb0eb>:0 
  at Renci.SshNet.Sftp.SftpSession.SendRequest (Renci.SshNet.Sftp.Requests.SftpRequest request) [0x0002f] in <a5033589e6f4462cad1b72eda36eb0eb>:0 
  at Renci.SshNet.Sftp.SftpSession.RequestWrite (System.Byte[] handle, System.UInt64 serverOffset, System.Byte[] data, System.Int32 offset, System.Int32 length, System.Threading.AutoResetEvent wait, System.Action`1[T] writeCompleted) [0x00042] in <a5033589e6f4462cad1b72eda36eb0eb>:0 
  at Renci.SshNet.SftpClient.InternalUploadFile (System.IO.Stream input, System.String path, Renci.SshNet.Sftp.Flags flags, Renci.SshNet.Sftp.SftpUploadAsyncResult asyncResult, System.Action`1[T] uploadCallback) [0x000dc] in <a5033589e6f4462cad1b72eda36eb0eb>:0 
  at Renci.SshNet.SftpClient.UploadFile (System.IO.Stream input, System.String path, System.Boolean canOverride, System.Action`1[T] uploadCallback) [0x00017] in <a5033589e6f4462cad1b72eda36eb0eb>:0 
  at Renci.SshNet.SftpClient.UploadFile (System.IO.Stream input, System.String path, System.Action`1[T] uploadCallback) [0x00000] in <a5033589e6f4462cad1b72eda36eb0eb>:0 
  at Duplicati.Library.Backend.SSHv2.PutAsync (System.String remotename, System.IO.Stream stream, System.Threading.CancellationToken cancelToken) [0x00012] in <8fe419baa0b4450e802077c005f8f2b8>:0 
  at Duplicati.Library.Main.Operation.Backup.BackendUploader.DoPut (Duplicati.Library.Main.Operation.Common.BackendHandler+FileEntryItem item, Duplicati.Library.Interface.IBackend backend, System.Threading.CancellationToken cancelToken) [0x003a4] in <9b99db820df3422db0aa96d4648dc7b1>:0 
  at Duplicati.Library.Main.Operation.Backup.BackendUploader+<>c__DisplayClass20_0.<UploadFileAsync>b__0 () [0x0010a] in <9b99db820df3422db0aa96d4648dc7b1>:0 
  at Duplicati.Library.Main.Operation.Backup.BackendUploader.DoWithRetry (System.Func`1[TResult] method, Duplicati.Library.Main.Operation.Common.BackendHandler+FileEntryItem item, Duplicati.Library.Main.Operation.Backup.BackendUploader+Worker worker, System.Threading.CancellationToken cancelToken) [0x00198] in <9b99db820df3422db0aa96d4648dc7b1>:0 
  at Duplicati.Library.Main.Operation.Backup.BackendUploader.DoWithRetry (System.Func`1[TResult] method, Duplicati.Library.Main.Operation.Common.BackendHandler+FileEntryItem item, Duplicati.Library.Main.Operation.Backup.BackendUploader+Worker worker, System.Threading.CancellationToken cancelToken) [0x003c1] in <9b99db820df3422db0aa96d4648dc7b1>:0 
  at Duplicati.Library.Main.Operation.Backup.BackendUploader.UploadFileAsync (Duplicati.Library.Main.Operation.Common.BackendHandler+FileEntryItem item, Duplicati.Library.Main.Operation.Backup.BackendUploader+Worker worker, System.Threading.CancellationToken cancelToken) [0x000da] in <9b99db820df3422db0aa96d4648dc7b1>:0 
  at Duplicati.Library.Main.Operation.Backup.BackendUploader.UploadBlockAndIndexAsync (Duplicati.Library.Main.Operation.Backup.VolumeUploadRequest upload, Duplicati.Library.Main.Operation.Backup.BackendUploader+Worker worker, System.Threading.CancellationToken cancelToken) [0x00098] in <9b99db820df3422db0aa96d4648dc7b1>:0 
  at CoCoL.AutomationExtensions.RunTask[T] (T channels, System.Func`2[T,TResult] method, System.Boolean catchRetiredExceptions) [0x000d4] in <9a758ff4db6c48d6b3d4d0e5c2adf6d1>:0 
  at Duplicati.Library.Main.Operation.BackupHandler.FlushBackend (Duplicati.Library.Main.BackupResults result, CoCoL.IWriteChannel`1[T] uploadtarget, System.Threading.Tasks.Task uploader) [0x00185] in <9b99db820df3422db0aa96d4648dc7b1>:0 
  at Duplicati.Library.Main.Operation.BackupHandler.RunAsync (System.String[] sources, Duplicati.Library.Utility.IFilter filter, System.Threading.CancellationToken token) [0x00cb2] in <9b99db820df3422db0aa96d4648dc7b1>:0 <---
<---
<---


On the SFTP server I can see that some files were created but they all have a size of 0 bytes.

First, I wasn’t sure what I could do about this, then I tried connecting via SFTP inside the container’s shell which worked. Suprisingly afterwards a backup via Duplicati also worked. On the next scheduled run, I got the same error again. Now I added a script to run before my backup starts which just connects once to the SFTP server, does ls and exits which again allows the backup to go through.

I also figured out that if I need to upload a larger amount of data (e.g. for the initial backup) it would fail even after doing this initially. When looking at the live log, I noted that at some point the counter of uploaded bytes got stuck. If it didn’t change for half a minute or so, I again executed the sftp command on the shell and it started uploading again for some time.

On the other RaspberryPi I have no issue at all with identical backup configurations.

Anyone has an idea what could cause these issues?

A shot in the dark is that the SFTP server has a “message of the day” that is shown on the first login, and that this message somehow trips up the SSH library, but not the standard sftp binary.

After logging in with the standard sftp binary, the message is not shown for a while, letting the backups complete.

I am not sure how much you can fiddle with the Storage Box server, but maybe you can create a ~/.hushlogin file on the destination?