FTP Connection - Error

I am connecting to a regular FTP server (port:21).

Here is the relevant log output:

2019-02-06 09:02:56,180 : WARN : SwingWorker-pool-6-thread-3 : TestConnectionDialog$TestWorker : FTP Connection : 2:1 : Couldn’t connect
2019-02-06 09:02:56,181 : DEBUG : SwingWorker-pool-6-thread-3 : TestConnectionDialog$TestWorker : FTP Connection : 2:1 : Couldn’t connect
it.sauronsoftware.ftp4j.FTPException [code=400, message= You are already at the root]
at it.sauronsoftware.ftp4j.FTPClient.changeDirectoryUp(FTPClient.java:1672)
at org.knime.base.filehandling.remote.files.FTPConnection.open(FTPConnection.java:116)
at org.knime.base.filehandling.remote.files.RemoteFile.open(RemoteFile.java:126)
at org.knime.base.filehandling.remote.files.RemoteFileFactory.createRemoteFile(RemoteFileFactory.java:137)
at org.knime.base.filehandling.remote.connectioninformation.node.TestConnectionDialog$TestWorker.doInBackgroundWithContext(TestConnectionDialog.java:234)
at org.knime.base.filehandling.remote.connectioninformation.node.TestConnectionDialog$TestWorker.doInBackgroundWithContext(TestConnectionDialog.java:1)
at org.knime.core.util.SwingWorkerWithContext.doInBackground(SwingWorkerWithContext.java:106)
at javax.swing.SwingWorker$1.call(SwingWorker.java:295)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at javax.swing.SwingWorker.run(SwingWorker.java:334)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)

Hi!

Are non-secure connections enabled on this server? If not could you enable them and try again?

Br,
Ivan

Can you be more specific please?
What type of security do you want me to disable? User credentials?
This server is not SFTP and there are no certs involved.

In either case, I do not have control over any of those security options.

This error message makes it seem like perhaps part of your configuration somewhere says to change the working directory to .. or ../something_more after connection, which it is unable to do because your connection places you at the filesystem root (or a chroot’d jail root) to start…

Could that be the case?

Absolutely agree with your assessment. However…
I am not changing any directories.
The routine which is throwing that error seems to be kicked off internally in KNIME. I simply provided the server address and user credentials, and upon clicking the “Test connection” button - that error was raised.

Yes, oddly - i see in the decompiled code for this that we are invoking changeDirectoryUp() on the client, apparently no matter what, at least once. I’m honestly surprised this doesn’t break stuff for more people.

I’ll file a bug - sorry.

I don’t know what your FTP server is, or if you have any ability to change its configuration, but you might be able to work around this by having the server start you off in non-root directory…

1 Like

Unfortunately, I don’t have access to the FTP server configuration.
I appreciate you looking into this issue - looking forward to a fix!

My current work-around is a regular scripting language (python).

I am the “more people”…
Just to push this thread up for a fix :slight_smile:

1 Like

Hi there @cyrusl0822,

have added +1 to push it a bit.

EDIT: Now I see you already reported it in another thread so it has already been noted :slight_smile:

Br,
Ivan

+1 the exact same error with me. Unfortunately unable to connect to FTP

Hello!

“You are already at the root” error message and other similar connected to same issue should not be happening any more as it was fixed with KNIME version 4.2.0.
https://www.knime.com/changelog-v42
(AP-11328)

Br,
Ivan

2 Likes

I have now the “Premission Denied” error during test connection.
It seems to be having an account with restrictions on starting in specific folder in the FTP but not the root directory.
It is fine to be login with browser but not with KNIME FTP connector.

I am not sure how I should get this working…

Hello @cyrusl0822,

are you using new FTP Connector available from version 4.3.0?

Br,
Ivan

Oh, sorry, forgot the update.
But now on the 4.3, the error changed to be in the console:
“Failed to initialize FTP client pool”
“Execute failed: Connection timed out: connect”

I am wondering if it is similar to the one as [txjmb] on Jan 9 in below:

As I do not have the control over the FTP, i am sure that they do have different users with different access to the folders, as well as different starting directory once login in there.

1 Like

Hello @cyrusl0822,

seems so. Let’s see if there will be any news in topic you linked which might help.

Br,
Ivan

Hello @cyrusl0822,

just dropping info that 4.3.2. is released where issue from linked topic is addressed. Can you give it a try?

Br,
Ivan

2 Likes

The FTP connector seems to be fine and connected now.
But then i wanted to list file to get the path for file reader / Excel reader.
I was stuck in the “List Files/Folder” node, as i could not provide the same path as i had when accessing via explorer.
(Possibly there is restriction on the account and it is not starting in the home directory.)

And even i use Browse in Config, nothing is showing.

Not sure how i can have the file list to read files i needed over there…

Revise:

The working directory “Browse” seems to be fine in the “FTP Connector”

But when it pass to “List Files/Folders”, it seems to be not working.

Hello @cyrusl0822,

glad you managed to connect. What have you specified as Working directory in FTP Connector node? Are you able then to run List Files/Folders node without opening it (and configuring it)? If yes do you get any warning/error message?

Br,
Ivan