Adalennis opened a new issue, #9170:
URL: https://github.com/apache/hop/issues/9170
### Apache Hop version?
SNAPSHOT-20261021
### Java version?
Java 21
### Operating system
macOS
### What happened?
Found while documenting the result of these actions (#8970, PR #9149).
**1. A failure before the transfer counts as 1 error, so "Nr errors less
than" makes it a success**
With *Success on* set to *Nr errors less than* and *Limit files* 10, a
server that refuses the connection gives:
ERROR: Error getting files from FTP :
Unable to connect to FTP connection "TESTED" at 127.0.0.1:2199
Connection refused
Finished action [TESTED] (result=[true])
and the success hop is followed. With the default *All works fine*, the same
action is false.
ActionFtp.execute() and ActionFtpDelete.execute() catch every exception
around the connection and the listing, count it as one error
(`download.updateErrors()` / `deletion.updateErrors()`), and then set the
result from `isSuccess()`, which for this condition is `nrErrors <= limitFiles`
(ActionFtp.java line 679, ActionFtpDelete.java line 567).
Tested with hop-run (Limit files 10):
| Case | Get a file with FTP | FTP delete |
|---|---|---|
| Server unreachable (connection refused) | true, 1 error | true, 1 error |
| Login refused | true, 1 error | true, 1 error |
| Wildcard is not a valid regular expression | true, 1 error | true, 1 error
|
| Remote directory doesn't exist | false (returns early) | true, 1 error |
| Wildcard empty | - | true, 1 error |
With *Limit files* 0 all of them are false. In Get a file with FTP, a
missing remote directory and the move-to folder checks return before
`isSuccess()`, so they are false whatever the condition.
Expected: a failure that prevents any transfer (no connection, no login, no
listing) makes the action false, whatever the success condition. The condition
should only apply to the files that were tried.
**2. "Nr errors less than" accepts a number of errors equal to the limit**
The same `<=` makes the action true when the number of errors equals *Limit
files*, while the download or delete stops as soon as that number is reached
(`nrErrors >= limitFiles`, lines 670 and 558). With *Limit files* 1 and one
file failing, Get a file with FTP stops and is true with 1 error. Either the
condition should be `<`, as its name says, or the label should say "at most".
The current behaviour is documented on both action pages (PR #9149), so the
docs need an update when this is fixed.
### Issue Priority
Priority: 3
### Issue Component
Component: Hop Gui
--
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]