Score:1

rclone quits FTP server after asking for UTF8

lr flag

I need to programmatically copy data from an FTP server with rclone. The config is as simple as:

[exampleftp]
type = ftp
host = ftp.example.com
user = myuser
pass = mypass

If I try to copy anything, I get:

Failed to create file system for "exampleftp:/": NewFs: failed to make FTP connection to "ftp.example.com:21": UTF8 support on

Dumping the protocol exchange shows:

$ rclone --config=rclone.conf ls exampleftp: -vv --dump bodies

DEBUG : Using config file from "rclone.conf"
DEBUG : rclone: Version "v1.55.1-DEV" starting with parameters ["rclone" "--config=rclone.conf" "ls" "exampleftp:" "-vv" "--dump" "bodies"]
DEBUG : Creating backend with remote "exampleftp:"
DEBUG : ftp://ftp.example.com:21: Connecting to FTP server
DEBUG : FTP Rx: "220 Welcome to the example FTP Server."
DEBUG : FTP Tx: "USER myuser"
DEBUG : FTP Rx: "331 User myuser, password please"
DEBUG : FTP Tx: PASS *****
DEBUG : FTP Rx: "230 Password Ok, User logged in"
DEBUG : FTP Tx: "FEAT"
DEBUG : FTP Rx: "211- Additional features supported include:"
DEBUG : FTP Rx: " MDTM"
DEBUG : FTP Rx: " MFCT"
DEBUG : FTP Rx: " MFMT"
DEBUG : FTP Rx: " SIZE"
DEBUG : FTP Rx: " REST STREAM"
DEBUG : FTP Rx: " AUTH TLS"
DEBUG : FTP Rx: " AUTH SSL"
DEBUG : FTP Rx: " PBSZ"
DEBUG : FTP Rx: " EPRT"
DEBUG : FTP Rx: " EPSV"
DEBUG : FTP Rx: " XCRC"
DEBUG : FTP Rx: " XSHA1"
DEBUG : FTP Rx: " XSHA256"
DEBUG : FTP Rx: " XSHA512"
DEBUG : FTP Rx: " XMD5"
DEBUG : FTP Rx: " HASH SHA-256;SHA-512;SHA-1*;MD5"
DEBUG : FTP Rx: " PROT"
DEBUG : FTP Rx: " LANG EN*"
DEBUG : FTP Rx: " SITE PSWD"
DEBUG : FTP Rx: " SITE ZONE"
DEBUG : FTP Rx: " SITE UTIME"
DEBUG : FTP Rx: " MODE Z ZLIB(LEVEL)"
DEBUG : FTP Rx: " MLST Type*;Size*;Modify*;Create*;"
DEBUG : FTP Rx: " CLNT"
DEBUG : FTP Rx: " CSID"
DEBUG : FTP Rx: " RMDA"
DEBUG : FTP Rx: " UTF8"
DEBUG : FTP Rx: "211 End"
DEBUG : FTP Tx: "TYPE I"
DEBUG : FTP Rx: "200 Type Binary"
DEBUG : FTP Tx: "OPTS UTF8 ON"
DEBUG : FTP Rx: "220 UTF8 support on"
DEBUG : FTP Tx: "QUIT"
Failed to create file system for "exampleftp:": NewFs: failed to make FTP connection to "ftp.example.com:21": UTF8 support on

To me, this seems to say:

  • Server: "I support UTF8"
  • Client: "Great, then please use UTF8"
  • Server: "Sure, here it is"
  • Client: "Err, I need to go. Bye."

Everything works ok with another client, such as lftp. However would much prefer to use rclone, as this would be part of a framework that is pre-configured for rclone.

Does anybody know what is going on and any workaround?

Score:2
jp flag

It seems to be a bug in the FTP library used by rclone. The library expects 200 return code but your server sends 220. You probably want to open an issue here. Or maybe with your FTP server software vendor as UTF-8 Option for FTP specs lists only 200 return code as valid for a successful state.

lr flag
Thanks. I actually filed a bug with rclone. The FTP library does specify that it adheres to the specs. So it cannot really be blamed. Using (and accepting) 220 seems however to be pretty common, so it is up to rclone developers to decide whether they want to be more compatible (by using a different FTP library) or more strict.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.