FTP Plugin - Unable to get Passive FTPES working
We're trying to upload artifacts to a Windows VM hosted in Azure.
We've been trying to setup an FTP server for TeamCity to upload to.
We tried using FileZilla FTP Server, however TeamCity errors with the message "425 Unable to build data connection: TLS session of data connection was not resumed." This is somewhat expected as we've not been able to use FileZilla FTP Server except with the FileZilla FTP Client.
So we tried using the Windows FTP Service instead. However, it responds to "PBSZ 16384" with "501" - i.e. 16384 is too large. Having done some research, it seems that FTP(E)S generally sticks with "PBSZ 0" because TLS is a transport-layer encryption protocol. Having looked at the source code, it seems that 16384 is hard coded in the plugin.
To be clear, we were able to connect to both FTPs with the FileZilla FTP Client, but neither worked with the TeamCity FTP Plugin.
Is there something obvious that we're missing that would allow us to use either of the approaches above?
If not, what's the recommended way to securely transfer files to a remote server?
Please sign in to leave a comment.
PBSZcommand is from 0 to 2^32, according to RFC 2228. The 501 response might also mean that the server couldn't parse the argument for another reason.PROTECTION BUFFER SIZE (PBSZ) <...> This number shall be no greater than can be represented in a 32-bit unsigned integer. This command allows the FTP client and server to negotiate a maximum protected buffer size for the connection. There is no default size; <...> <...> If the server cannot parse the argument, or if it will not fit in 32 bits, it should respond with a 501 reply code.According to https://enterprisedt.com/products/edtftpjssl/doc/manual/html/ftpscommands.html :
While this is one implementation, we can imagine the reasoning being used with other implementations.
Relevant TeamCity log lines:
Relevant Windows FTP log lines:
If we use FileZilla FTP Client to connect, the client issues PBSZ 0 to which the server responds with 200. Similarly if we use IntelliJ to connect.
Thank you for the update!