Skip to content

[Bug]: Add filenames to result is true with an invalid regular expression; Delete folders is true when the last folder brings the errors to the limit #9264

Description

@Adalennis

Apache Hop version?

2.21.0-SNAPSHOT

Java version?

Java 21

Operating system

macOS

What happened?

Found while documenting the result of these actions (#8970, third batch). Reproduced with hop-run on main, with both plugins built from 627b99a. The current behaviour is documented in a NOTE on each action page, so the docs need an update when these are fixed.

1. Add filenames to result: an invalid regular expression adds nothing, and the action is true

GetFileWildcard() compiles the wildcard inside TextFileSelector.includeFile(), which catches the PatternSyntaxException for each file, logs it and skips the file. processFile() still returns true, so no error is counted.

With a folder holding a.txt and b.log and Wildcard (RegExp) ([, the log shows for each file:

Error while finding files ... in [file:///…/ar/a.txt]. Exception :Unclosed character class near index 1

No file is added and the action is true with 0 errors: the same result as a valid wildcard that matches nothing. Delete files does the same (#9175, point 3).

2. Delete folders: "When number of errors less than" is true when the last folder brings the errors to the limit

updateErrors() marks the success condition as broken when nrErrors >= nrLimitFolders, but that is only checked before the next folder. At the end, getSuccessStatus() returns true when nrErrors <= nrLimitFolders. So the result depends on where the failing entry is in the list:

Limit Folders (a file is an error) Result
1 folder, file true, 1 error
1 file, folder false, 1 error, stops, the folder is not deleted
2 folder, file, file true, 2 errors
2 file, file, folder false, 2 errors, stops, the folder is not deleted

With the same number of errors, the action is true or false depending on the order. Move files has the same >= / <= mismatch (#9175, point 1); Get a file with FTP and FTP delete had it too (#9170, fixed in #9187).

Issue Priority

Priority: 3

Issue Component

Component: Actions

Activity

  1. added theissue type on Nov 4, 2026
  2. leehaut commented on Nov 7, 2026

    @leehaut
    Contributor

    .take-issue

  3. added this to the 2.21 milestone on Nov 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions