Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Get a file with FTP: Return different result with Kettle Pentaho when inputting invalid user name, password or remote directory #4866

Open
RonnyRen opened this issue Feb 5, 2025 · 1 comment

Comments

@RonnyRen
Copy link

RonnyRen commented Feb 5, 2025

Apache Hop version?

2.11

Java version?

17

Operating system

Windows

What happened?

I migrated Pentaho jobs to Hop workflow and found that it behaves differently.
Case 1: Input invalid user name and password
Pentaho: Error getting files from FTP : User cannot log in.
Hop: No error happened and no file was downloaded. Dialog "Connection OK" shows when clicking button "Test Connection".

Case 2: Input correct user name and password, but input a remote directory that doesn't exist
Pentaho: Error getting files from FTP : The system cannot find the file specified.
Hop: No error happened, it seems that it checks root directory if remote directory doesn't exist based on detailed logs and it downloaded matched files in the root directory.

Is it by design or bug?

I checked source code, it uses different library as Kettle Pentaho, first bug should be related to code as below, it doesn't check if login returns true or false.
https://github.com/apache/hop/blob/main/plugins/actions/ftp/src/main/java/org/apache/hop/workflow/actions/util/FtpClientUtil.java#L178

Image

Note: The login method in library EnterpriseDT.Net.Ftp used by Pentaho is void.

The second bug should be also related to different libraries used. Pentaho uses ftpclient.dirDetails( null ) and Hop uses ftpClient.listFiles().

Issue Priority

Priority: 3

Issue Component

Component: Workflows

@hansva
Copy link
Contributor

hansva commented Feb 5, 2025

The originally used library was [EdtFTPj](https://mvnrepository.com/artifact/com.enterprisedt/edtFTPj). This library is LGPL licensed and not compatible with the Apache license (the library also hasn't been maintained since 2006).

This is why we switched to commons-net, the issues sound to not be by design so should be fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants