Adalennis opened a new issue, #9242: URL: https://github.com/apache/hop/issues/9242
### Apache Hop version? 2.21.0-SNAPSHOT ### Java version? Java 21 ### Operating system macOS ### What happened? Found while documenting the result of the FTP and HTTP actions (#8970, PR #9149). Tested with hop-run against vsftpd in Docker and a local HTTP server, and checked against the code on main. **1. Put a file with FTP: *Don't overwrite files* + *Remove files after transferal* deletes local files that were not uploaded** When a file already exists on the server and *Don't overwrite files* is checked, `ActionFtpPut.uploadFile()` skips it but returns true. The loop in `execute()` then counts it as put and calls `deleteLocalFileIfNeeded()`, so the local file is deleted although it never reached the server. Local folder with p1.txt and p2.txt, server already holding a different p1.txt, wildcard `.*\.txt`, both options checked: p2.txt is uploaded, both local files are deleted, and the log says "We have put [2] file(s) on the FTP server". The local content of p1.txt is lost; the server still has the old p1.txt. **2. HTTP empties an existing target file when the server returns an error status** `ActionHttp.execute()` opens the output stream on the target file before it sends the request. With a 404 or 500 nothing is written, so an existing target file is left empty (unless *Append to specified target file* is checked). An existing file with content was 0 bytes after a 404. **3. HTTP with *Run for every result row* is true with 1 error when a later row fails** The first row that succeeds sets the result to true; a later row that fails only sets the number of errors to 1 and ends the loop. With two result rows (a URL that returns 200, then one that returns 404) the action is true with 1 error, so the workflow follows the success hop. The target file of the failed row is also created empty (see 2). **4. The Timeout of the FTP actions is in milliseconds, the tooltip says seconds** Get a file with FTP, Put a file with FTP and FTP delete pass their Timeout as it is, through `getConnectTimeout()`, to `FTPClient.setConnectTimeout()` and `setDefaultTimeout()` in `FtpClientFactory`, which take milliseconds. The tooltip of all three says "The timeout when transferring in seconds (0 for no timeout)". The FTP connection metadata editor labels the same setting "Connect timeout (ms)". With Timeout 1 the action fails with "Timed out waiting for initial connect reply"; with 0 it works. ### Issue Priority Priority: 3 ### Issue Component Component: Actions -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
