jenkinsci / publish-over-ftp-plugin

https://plugins.jenkins.io/publish-over-ftp/
21 stars 33 forks source link

Clean remote option fails #90

Open cubistico opened 2 years ago

cubistico commented 2 years ago

Jenkins and plugins versions report

Environment ```text Paste the output here ```

What Operating System are you using (both controller, and any agents involved in the problem)?

Jenkins runs on Ubuntu 20.04, the FTP server is macOS Server.app, but I've seen that happen with other FTP servers as well.

Reproduction steps

  1. In a Jenkins Freestyle job, select Send build artifacts over FTP as a post build step
  2. Click Advanced
  3. Check Clean remote

Expected Results

I expect that existing files and directories in the target path are deleted, then the matching files are uploaded.

Actual Results

The log shows almost endlessly repeating MLSD attempts (I guess)

PASV
227 Entering Passive Mode (192,168,205,11,210,149)
MLSD
150 Opening BINARY mode data connection for 'MLSD'.
226 MLSD complete.
CWD /configured/path/on/the/server
250 CWD command successful.
PASV
227 Entering Passive Mode (192,168,205,11,210,150)
MLSD
150 Opening BINARY mode data connection for 'MLSD'.
226 MLSD complete.
CWD /configured/path/on/the/server
250 CWD command successful.
PASV
227 Entering Passive Mode (192,168,205,11,210,151)
MLSD
150 Opening BINARY mode data connection for 'MLSD'.
226 MLSD complete.
CWD /configured/path/on/the/server
250 CWD command successful.

Eventually the step fails

FTP: Disconnecting configuration [local.domain.net (Local Download Server)] ...
ERROR: Remote call on agent-1 failed

Anything else?

If I do not select the option Clean remote, the step works as expected.

It looks to me as if MLSD may not be supported and the plugin continues to use it anyway. I found the issue Client uses LIST output rather than using MLSD command, and there is a comment that says that the plugin would use LIST if MLSD is not supported, but that doesn't seem to work. However, that is just an assumption.