gilbertchen / duplicacy

A new generation cloud backup tool
https://duplicacy.com
Other
5.24k stars 339 forks source link

Duplicacy incorrectly claims "Can't access the storage path backups/me: file does not exist" #530

Open jwatt opened 5 years ago

jwatt commented 5 years ago

I'm trying to back up a Win10 user's HOME directory. In cmd.exe I run:

C:\Users\me>duplicacy.exe -d init mine "sftp://me@backup-2/backups/me"
Reading the environment variable DUPLICACY_SSH_KEY_FILE
Attempting public key authentication
Reading the environment variable DUPLICACY_SSH_KEY_FILE
Failed to load the SFTP storage at sftp://me@backup-2/backups/me: Can't access the storage path backups/me: file does not exist

C:\Users\me>ssh me@backup-2 "ls -l backups"
total 0
drwxr-xr-x 1 me users 0 Jan 18 13:16 me

As can be seen from the ssh command, that directory does in fact exist.

gboudreau commented 5 years ago

Did you try "sftp://me@backup-2//path/to/backups/me/", i.e. the absolute path of the me folder ? And with a trailing / ? I use both myself, but I seem to remember at least the trailing / is required; not sure about the absolute path.

jwatt commented 5 years ago

Thanks for the suggestion. Yes, I tried that (including the double forward slash between the domain and the path to denote it as absolute) both with and without a trailing slash. I just ran those tests again to confirm, and indeed, I still get the same error message.

gilbertchen commented 5 years ago

@jwatt can you verify that the path is accessible using sftp instead of ssh, like:

sftp me@backup-2
cd backups/me
jwatt commented 5 years ago

@gilbertchen Ah! No, that does not work. It seems that the NAS box that I'm using presents a very different filesystem layout when connected via SFTP vs when connected via SSH. Ugh!

Maybe it's worth keeping this issue open as a feature request to have the error message provide more info to increase the likelihood of users figuring out the problem for themselves without bothering you? Specifically, the message could have the following appended:

On connecting to <server> the current working directory was: <output from pwd command>
The contents of that directory are:
  * list
  * of
  * files

The reason suggesting listing the contents is because for me the SFTP CWD was "/", but that root directory appears to be synthesized by the NAS box and doesn't contain what I'd expect from SSH'ing in. Also being told what the contents of the directory are would helpful for preventing users making bad assumptions and getting further confused.

jwatt commented 5 years ago

Alternatively just close this. Thanks for promptly pointing me in the right direction.

fuzolan commented 5 years ago

the needed second trailing slash was indeed confusing for me...