-
Notifications
You must be signed in to change notification settings - Fork 610
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
List files from remote directory fails with Serv-U #268
Comments
Which version of SSHJ are you using? So let me get this straight, there are 2 different problems here:
Do you have some additional (DEBUG/TRACE) logging for the exceptions? |
Yes, there are 2 different issues, but I guess the TimeoutException looks like a CoreFTP issue.
and with StatefulSFTPClient:
|
This is the timeout exception for CoreFTP mini-server 30sec. after closing to sftpclient (should I open a new ticket?):
|
After testing a couple of relative paths like "./export", "~/export" there is only one working solution for Serv-U (on windows env.). I've to canonicalize(".") and send the absolute path like in StatefulSFTPClient. I guess this is the reason for the separate StatefulSFTPClient? I couldn't find any samples or description (javadoc) when to use stateful or default. try (SSHClient ssh = new SSHClient()) {
ssh.addHostKeyVerifier(new PromiscuousVerifier());
ssh.connect(host, port);
ssh.authPassword(user, pwd);
SFTPClient sftp = ssh.newSFTPClient();
// Serv-U req. a absolute path ("/C:/temp" + "/" + "export")
String cwd = sftp.canonicalize(".") + "/" + incomingRemotePath;
logger.info("found {} remote files at {}", sftp.ls(cwd).size(), cwd);
} catch (Exception e) {
logger.error(e.getMessage(), e);
} |
Hi @hierynomus I had same issue here. An application, that was working correctly since some months, stopped working after the customer switched FTP server to start using Serv-U. I'm using SSHJ version 0.27.0. The exception (same as previous one) was thrown when executing ls().
Changing our application to create a Stateful FTP client instead of an Standard one solved the issue. I made a method similar to the one implemented here https://stackoverflow.com/questions/50229081/sshj-how-to-use-statefulsftpclient to mimic the isConnected isAuthenticated calls from the Standard FTP client. I didn't have any issue with the paths, they were used in the same way in both servers, so I think there is no problem there. I think the Stateful for Serv-U is also not a bug if it is documented somewhere. I made a pull request in case you want to include that method. |
Co-authored-by: Daniel Rodriguez <[email protected]>
Closing this as the added method in #603 should fix this. |
Hi, if I try to list files from a remote directory (sample: export/files) I get a exception:
But only with Serv-U (tested with: Serv-U_15.1.4.6,Serv-U_15.1.3.43) and
SSHClient.newSFTPClient
and with
StatefulSFTPClient sftp = new StatefulSFTPClient(engine.init());
it works very well.I tested it also with other SFTP servers like CoreFTP, Windows embedded SFTP and both ways are ok.
Only with CoreFTP (mini-server 2.04) the SFTPEngine.close(); cause a TimeoutException all the time.
The text was updated successfully, but these errors were encountered: