SFTP connection issue to Pi4 (Solved)

Hi,

I’m pretty new to Linux backups servers and what not but am enjoying this journey on learning new things and keeping my data safe! So I’ll layout what I have set up and trying to do and see if anyone can help me figure out the problem as I’m to the point where I don’t know what to google to find the solution.

Building a truenas scale server, but it is not done so I’m testing my connections and backup method from windows now so its not a problem later.

  • Running Win11 PC at home with Duplicati installed
  • Pi4 running dietpi with usb ssd attached for the storage target at parent house
  • connection is being secured through tailscale
  • attempting to back up a small folder of documents so its quick

So I can connect to the Pi4 with PuTTY or Powershell with ssh with no issues and even when setting up my Duplicati backup I get a good connection and can get it to run the back up but it fails every time and when looking at the log it spits out I’m just at a loss with my current knowledge lol. I’ll post below what it is spitting out cause it looks like some permission issue but I’m just not sure what and where too look at. Thanks.

  • Mar 29, 2024 8:51 AM: Failed while executing “Backup” with id: 1
    System.AggregateException: One or more errors occurred. —> System.AggregateException: Permission denied —> Renci.SshNet.Common.SftpPermissionDeniedException: Permission denied
    at CoCoL.AutomationExtensions.d__101.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Duplicati.Library.Main.Operation.BackupHandler.<FlushBackend>d__19.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Duplicati.Library.Main.Operation.BackupHandler.<RunAsync>d__20.MoveNext() --- End of inner exception stack trace --- at Duplicati.Library.Main.Operation.BackupHandler.<RunAsync>d__20.MoveNext() --- End of inner exception stack trace --- at CoCoL.ChannelExtensions.WaitForTaskOrThrow(Task task) at Duplicati.Library.Main.Controller.<>c__DisplayClass14_0.<Backup>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.Server.Runner.Run(IRunnerData data, Boolean fromQueue)
    —> (Inner Exception #0) System.AggregateException: Permission denied —> Renci.SshNet.Common.SftpPermissionDeniedException: Permission denied
    at CoCoL.AutomationExtensions.d__101.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Duplicati.Library.Main.Operation.BackupHandler.<FlushBackend>d__19.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Duplicati.Library.Main.Operation.BackupHandler.<RunAsync>d__20.MoveNext() --- End of inner exception stack trace --- at Duplicati.Library.Main.Operation.BackupHandler.<RunAsync>d__20.MoveNext() ---> (Inner Exception #0) Renci.SshNet.Common.SftpPermissionDeniedException: Permission denied at CoCoL.AutomationExtensions.<RunTask>d__101.MoveNext()
    — End of stack trace from previous location where exception was thrown —
    at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
    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 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
    at Duplicati.Library.Main.Operation.BackupHandler.d__20.MoveNext()<—

—> (Inner Exception #1) System.AggregateException: One or more errors occurred. —> Renci.SshNet.Common.SftpPermissionDeniedException: Permission denied
at CoCoL.AutomationExtensions.d__101.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Duplicati.Library.Main.Operation.BackupHandler.<FlushBackend>d__19.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Duplicati.Library.Main.Operation.BackupHandler.<RunAsync>d__20.MoveNext() --- End of inner exception stack trace --- ---> (Inner Exception #0) Renci.SshNet.Common.SftpPermissionDeniedException: Permission denied at CoCoL.AutomationExtensions.<RunTask>d__101.MoveNext()
— End of stack trace from previous location where exception was thrown —
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
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 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Duplicati.Library.Main.Operation.BackupHandler.d__20.MoveNext()<—
<—
<—

Welcome to the forum @devlp1213

How did you see that Duplicati got a good connection? Click Test connection?

Does run the backup mean start, then fail before finish? Did remote get any files?

You can watch attempted remote actions with About → Show log → Live → Retry.

Yes when setting up the back up for the ssh settings the test connection button confirms the connection and when running the back up it starts and says waiting for upload to finish at the top and errors our with the above posted error after like a minute. When checking the remote drive no files send to be there. I’ll have to wait till I’m back to try again to watch a live log.

If you’re in the remote, maybe check the permissions of its folder to see if they allow write.

The Test connection button probably only does a list, and a later file upload might fail.

What SFTP server? Does it have a log? Can you sftp upload a file with another sftp client?

Ok so I was able to find the issue!

I did as requested and tried another client. It made connection with no issue but failed to transfer a file do to permission issues. So after a little more digging the owner of the location was only for root user.

So I figured out how to give ownership to the user account instead of root and that did the trick.

Thanks for the tips and getting me pointed in the right direction!

1 Like

(generalized to all storage types) might have made troubleshooting easier.
I think FTP (Alternative) has this, but most or all of the others just do list.