[SOLVED] FTP error >>> CURLE_FTP_COULDNT_RETR_FILE

Get help for specific problems
Posts: 5
Joined: 1 Nov 2020

h2o2

Cannot read directory
"ftp://192.168.1.4/Qbackup/DriveA/black seed oil".

CURLE_FTP_COULDNT_RETR_FILE: RETR response: 501
501 Invalid number of arguments [curl_easy_perform]
Hi!

FreeFileSync (v. 11.2 64-bit 02.10.2020) сan not read FTP folders with space in path.
I did first mirror without any questions.
FreeFileSync made aqurate copy on FTP server.
But later I see that FreeFileSync can not read FTP folders with spaces in path during "Compare" command.

Client:
root@azulle:/# uname -a
Linux azulle 4.19.0-12-amd64 #1 SMP Debian 4.19.152-1 (2020-10-18) x86_64 GNU/Linux
Server:
[~] # uname -a
Linux QNAP 2.6.30.6 #1 Tue Jul 20 05:17:10 CST 2010 armv5tel unknown
All others FTP clients work Ok with this server.
Attachments
client_pkg.txt.tar.gz
(28.13 KiB) Downloaded 152 times
server_pkg.txt
(1.49 KiB) Downloaded 112 times
User avatar
Site Admin
Posts: 7506
Joined: 9 Dec 2007

Zenju

Can you update the FTP server software? Looks like a server bug.
If not, next step would be to find out what command FFS is sending to the server and see if the format is correct, e.g. via Wireshark.
Posts: 5
Joined: 1 Nov 2020

h2o2

Can you update the FTP server software? Looks like a server bug. Zenju, 02 Nov 2020, 10:02
All other FTP clients work Ok with this server.
If not, next step would be to find out what command FFS is sending to the server and see if the format is correct, e.g. via Wireshark. Zenju, 02 Nov 2020, 10:02
Ok, found.

Double Commander --- Ok
----
# Packet 2 from /tmp/wireshark_enp1s0_20201102141442_tHC18a.pcapng
- 3
- 2.425972176
- 192.168.1.2
- 192.168.1.4
- FTP
- 107
- Request: CWD /Qbackup/DriveA/Untitled Folder/
FreeFileSync --- Bug
----
# Packet 107 from /tmp/wireshark_enp1s0_20201102135938_3hPKez.pcapng
- 108
- 4.125215973
- 192.168.1.2
- 192.168.1.4
- FTP
- 107
- Request: MLSD /Qbackup/DriveA/Untitled Folder
As you can see, authors of FreeFileSync
- forgot "/" symbol at the end of request argument
- use MLSD
User avatar
Site Admin
Posts: 7506
Joined: 9 Dec 2007

Zenju

# Packet 107 from /tmp/wireshark_enp1s0_20201102135938_3hPKez.pcapng
- Request: MLSD /Qbackup/DriveA/Untitled Folder h2o2, 02 Nov 2020, 11:23
The MLSD syntax looks correct. What happens if you manually issue "MLSD /Qbackup/DriveA/Untitled Folder/"? E.g. you can send manual FTP commands with FileZilla.
User avatar
Site Admin
Posts: 7506
Joined: 9 Dec 2007

Zenju

I think QNAP uses proftpd for FTP internally.

proftpd had bugs with spaces in file names before (in very old releases):
1.3.2rc4 - Released 23-Jan-2009
--------------------------------
- Bug 3142 - "Invalid number of arguments MFMT" due to spaces in path argument.

Your version of QNAP is also ancient: Tue Jul 20 05:17:10 CST 2010

Updating QNAP will most likely fix the "Invalid number of arguments" bug.
Posts: 5
Joined: 1 Nov 2020

h2o2

FileZilla uses CWD without "/" and OK.

Custom command test:
- MLSD >>> Does not working with ending "/"
- CWD >>> The ending "/" symbol does not matter
Posts: 5
Joined: 1 Nov 2020

h2o2

Updating QNAP will most likely fix the "Invalid number of arguments" bug. Zenju, 02 Nov 2020, 12:42
I will think about it.

p.s. I checked other my progs.
They start from CWD.
For example, requests CWD >>> PASV >>> MLSD.
Posts: 5
Joined: 1 Nov 2020

h2o2

Updating QNAP will most likely fix the "Invalid number of arguments" bug. Zenju, 02 Nov 2020, 12:42
Works. Thanks.
[~] # uname -a
Linux QNAP 3.4.6 #1 Tue Oct 6 11:39:23 CST 2020 armv5tel unknown
[~] # proftpd -v 
ProFTPD Version 1.3.5a