Bug discovered: FTP - Hit "check connection" creates non-existant directory

Hi,

I’m using Duplicati BETA 2.0.6.1_beta_2021-05-03 on Win10 Pro 1909 x64. I just liked to do a direct restore from a backup set residing on my FTP server.

Reproducer:

  • Choose restore
  • Choose direct restore from files
  • Select FTP, IP_ADDR, Port 21
  • I (accidentially) misspelled the path to the subfolder containing my backup set’s files. /A/B/Cwrong
  • Duplicati now said “create folder?” - Answer: “no”
  • I misspelled the path to the subfolder containing my backup set’s files again. e.g. /A/B/C/Dwrong
  • Duplicati now said “connection ok” - I hit “Proceed”.
  • After that, it complained “error 550 file not found”. I ssh’ed into the FTP server and found out, it created the second misspelled path as an empty folder without asking me for permission. ( /A/B/C/Dwrong )

What happened:

  • /A/B/C/Dwrong was created by Duplicati on the FTP server after it said “connection ok”

What I expected to happen:

  • Both folders /A/B/Cwrong and /A/B/C/Dwrong NOT being created and both times being asked by Duplicati to create the non-existant folder.

Maybe this can also be taken as a feature request: Duplicati could roughly check if there are *.dindex, *.dblock, … files in the specified remote directory given by the user during the “direct restore from files” assistant. If those files do not exist, it could say “No Duplicati backup set found at that location, please correct!”. If the folder does not exist, it could say “Remote folder does not exist, please correct the path or allow access to that folder.” In my opinion, there’s no point in offering folder creation during a restore process.

Thanks for taking this into consideration.

Kind regards,
Catfriend1

Are you sure it’s a new folder? If “Test connection” button makes a folder, why didn’t it make /A/B/Cwrong?
I’d note that there are some unstated steps in both tests, but I’m assuming you pressed “Test connection”.

Does the first slash (/A) correspond to an actual path in remote filesystem? Some servers keep the user confined to a configured subfolder. For example, I have mine set up to give C:\FTP, and no other tree, but

image

and Test connection button does this on the server (does yours have logging?), with no folder created.

(000024)6/23/2021 13:10:29 PM - (not logged in) (127.0.0.1)> Connected on port 21, sending welcome message...
(000024)6/23/2021 13:10:29 PM - (not logged in) (127.0.0.1)> 220-FileZilla Server 0.9.60 beta
(000024)6/23/2021 13:10:29 PM - (not logged in) (127.0.0.1)> 220-written by Tim Kosse (tim.kosse@filezilla-project.org)
(000024)6/23/2021 13:10:29 PM - (not logged in) (127.0.0.1)> 220 Please visit https://filezilla-project.org/
(000024)6/23/2021 13:10:29 PM - (not logged in) (127.0.0.1)> USER duplicati
(000024)6/23/2021 13:10:29 PM - (not logged in) (127.0.0.1)> 331 Password required for duplicati
(000024)6/23/2021 13:10:29 PM - (not logged in) (127.0.0.1)> PASS ********
(000024)6/23/2021 13:10:29 PM - duplicati (127.0.0.1)> 230 Logged on
(000024)6/23/2021 13:10:29 PM - duplicati (127.0.0.1)> OPTS utf8 on
(000024)6/23/2021 13:10:29 PM - duplicati (127.0.0.1)> 202 UTF8 mode is always enabled. No need to send this command.
(000024)6/23/2021 13:10:29 PM - duplicati (127.0.0.1)> PWD
(000024)6/23/2021 13:10:29 PM - duplicati (127.0.0.1)> 257 "/" is current directory.
(000024)6/23/2021 13:10:29 PM - duplicati (127.0.0.1)> CWD Cwrong
(000024)6/23/2021 13:10:29 PM - duplicati (127.0.0.1)> 550 CWD failed. "/Cwrong": directory not found.
(000024)6/23/2021 13:10:29 PM - duplicati (127.0.0.1)> disconnected.

image

If I Test connection with Dwrong (which I created in advance as an empty folder), the result is like this:

(000025)6/23/2021 13:14:04 PM - (not logged in) (127.0.0.1)> Connected on port 21, sending welcome message...
(000025)6/23/2021 13:14:04 PM - (not logged in) (127.0.0.1)> 220-FileZilla Server 0.9.60 beta
(000025)6/23/2021 13:14:04 PM - (not logged in) (127.0.0.1)> 220-written by Tim Kosse (tim.kosse@filezilla-project.org)
(000025)6/23/2021 13:14:04 PM - (not logged in) (127.0.0.1)> 220 Please visit https://filezilla-project.org/
(000025)6/23/2021 13:14:04 PM - (not logged in) (127.0.0.1)> USER duplicati
(000025)6/23/2021 13:14:04 PM - (not logged in) (127.0.0.1)> 331 Password required for duplicati
(000025)6/23/2021 13:14:04 PM - (not logged in) (127.0.0.1)> PASS ********
(000025)6/23/2021 13:14:04 PM - duplicati (127.0.0.1)> 230 Logged on
(000025)6/23/2021 13:14:04 PM - duplicati (127.0.0.1)> OPTS utf8 on
(000025)6/23/2021 13:14:04 PM - duplicati (127.0.0.1)> 202 UTF8 mode is always enabled. No need to send this command.
(000025)6/23/2021 13:14:04 PM - duplicati (127.0.0.1)> PWD
(000025)6/23/2021 13:14:04 PM - duplicati (127.0.0.1)> 257 "/" is current directory.
(000025)6/23/2021 13:14:04 PM - duplicati (127.0.0.1)> CWD Dwrong
(000025)6/23/2021 13:14:04 PM - duplicati (127.0.0.1)> 250 CWD successful. "/Dwrong" is current directory.
(000025)6/23/2021 13:14:04 PM - duplicati (127.0.0.1)> TYPE A
(000025)6/23/2021 13:14:04 PM - duplicati (127.0.0.1)> 200 Type set to A
(000025)6/23/2021 13:14:04 PM - duplicati (127.0.0.1)> PASV
(000025)6/23/2021 13:14:04 PM - duplicati (127.0.0.1)> 227 Entering Passive Mode (127,0,0,1,213,141)
(000025)6/23/2021 13:14:04 PM - duplicati (127.0.0.1)> LIST
(000025)6/23/2021 13:14:04 PM - duplicati (127.0.0.1)> 150 Opening data channel for directory listing of "/Dwrong"
(000025)6/23/2021 13:14:04 PM - duplicati (127.0.0.1)> 226 Successfully transferred "/Dwrong"
(000025)6/23/2021 13:14:04 PM - duplicati (127.0.0.1)> QUIT
(000025)6/23/2021 13:14:04 PM - duplicati (127.0.0.1)> 221 Goodbye
(000025)6/23/2021 13:14:04 PM - duplicati (127.0.0.1)> disconnected.

image

however using the Next button and the Connect button gets error because I didn’t put any files in Dwrong.

image

If I try the same Next and Connect with Cwrong (which isn’t there because nothing made it), it fails with:

image

Above testing was with Storage Type FTP, although I did try FTP (Alternative) too. It seemed fine too.
What FTP server are you on? If you want one with logging that runs on Windows, Filezilla Server works.

1 Like

I’ll make a lab setup and re-test with a non production setup. I’m using QNAP’s FTP server. Connecting to the FTP with the windows built-in cmdline ftp.exe client, I got this info:

ftp qnap
Connected to qnap.
220 NASFTPD Turbo station 1.3.5a Server (ProFTPD)
Name (qnap:root): admin
331 Password required for admin
Password: [password]
230 User admin logged in
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> status
Connected to qnap.
No proxy connection.
Connecting using address family: any.
Mode: stream; Type: binary; Form: non-print; Structure: file
Verbose: on; Bell: off; Prompting: on; Globbing: on
Store unique: off; Receive unique: off
Case: off; CR stripping: on
Quote control characters: on
Ntrans: off
Nmap: off
Hash mark printing: off; Use of PORT cmds: on
Tick counter printing: off

I’ve thrown my sh***y QNAP device away and set-up an old desktop PC as NAS including vsftpd. Duplicati “verify path and credentials” worked fine out of the box there when setting up the new jobs. Sorry for the noise.

1 Like