Skip to content

[Bug]: Copy files ignores Replace existing files, Remove source files and the result files when copying a file into a folder; Simple evaluation stops the workflow on an invalid regex #9263

In progress

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, PR #9000). Tested with hop-run and checked against the code on main.

1. Copy files: a file copied into a folder ignores Replace existing files, Remove source files and Add files to result files name

When the source is a file and the destination a folder (Destination is a file unchecked), ActionCopyFiles.processFileFolder() calls copyFileWithByteTracking() directly. Unlike copyOneFileToFile(), that path doesn't check whether the target exists and doesn't register the file for removal or for the result. With one file copied into a folder, the action is true and:

  • with Replace existing files unchecked, an existing file with the same name in the folder is overwritten;
  • with Remove source files checked, the source file is kept;
  • with Add files to result files name checked, no result file is added.

A folder copied into a folder handles all three.

2. Copy files: a file that fails inside a folder is only logged

TextFileSelector.copyPendingFiles() catches the exception of each file and only logs it, so processFileFolder() still returns true. A source folder with a readable and an unreadable file gives true with 0 errors: the readable file is copied, and the log shows "Can not copy file/folder [...locked.txt]". The workflow follows the success hop as if every file had been copied.

3. Simple evaluation: an invalid regular expression stops the workflow

With Success condition If value valid regex and a value to compare that isn't a valid regular expression (for example ([), ActionSimpleEval.execute() calls Pattern.compile() outside a try. The PatternSyntaxException leaves the action, the workflow stops, and neither the success nor the failure hop is followed:

ERROR: java.util.regex.PatternSyntaxException: Unclosed character class near index 1

Expected: the action is false with 1 error, as it is for a value that can't be parsed as a number.

Issue Priority

Priority: 3

Issue Component

Component: Hop Gui, Component: Actions

Activity

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

    @hansva
    Contributor

    .take-issue

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

Metadata

Metadata

Assignees

Labels

ActionsHop GuiP3

Type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions