Skip to content

sftp - outbound transfer test doesn't work for embedded server #355

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

Closed
pillesoft opened this issue Sep 15, 2023 · 6 comments
Closed

sftp - outbound transfer test doesn't work for embedded server #355

pillesoft opened this issue Sep 15, 2023 · 6 comments

Comments

@pillesoft
Copy link

Hi,

I'm in windows 10. the JDK is 17.

The remote outbound file transfer works, but I receive "No more authentication methods available" error, when I try running the SftpOutboundTransferSample.testOutbound unit test.

in user.properties

sftp.host=localhost
# 0 means the embedded Apache MINA SshServer. Change it to any real port, if you are going to test sample against real SFTP Server
sftp.port=0

Additionally I replaced the sftp_known_hosts file with my local machine public key.

Anything else has to change?

@artembilan
Copy link
Member

It is not clear why do you need to change that test for something what is not supposed to be for that test?
I also work on Windows and test passes for me without any changes.

@pillesoft
Copy link
Author

Hi,

ok, maybe I was not very clear. i didn't change anything in the unit test itself. just updated user.properties file.

I want to run the outbound transfer test for an environment, when I don't have any SSH service/deamon.
According to readme when the port is 0 or -1 (this is not clear, but both values gave the same error), then the test initiate an embedded apache ssh server, and the transfer is done towards it.

the update of sftp_known_host file, is just a 2nd trial, but no success...

what do you mean that you didn't change anything?
what are the values in your user.properties file?

@artembilan
Copy link
Member

There is no logic in that test to run against real SFTP server: it always starts an embedded one.
That's probably what have confused you.
And we might modify the test to reflect that README or fix README that the test runs only against embedded SFTP server.

I think for the real server (for now), you have to do this changes into SftpSampleCommon.xml:

  1. Comment out <bean class="org.springframework.integration.samples.sftp.EmbeddedSftpServer"> to not start embedded server at all.
  2. Provide your own user.properties for real SFTP server.

@pillesoft
Copy link
Author

well, according to README the port defines, if the transfer is for real server or for the embedded one.
anyway, the transfer to a real ssh server (centos) works for me.
but it doesn't work when the port is 0.
I receive that No more authentication methods available error

Any idea what's wrong then?

@artembilan
Copy link
Member

If you are intended to test it against embedded server, then you must not change any thing in the project.
Leave that user.properties as is.
That embedded server is not aware of you external configuration.

@pillesoft
Copy link
Author

It turned out that I changed other files, as well. when I rolled back my changes, the test against the embedded server was working.

@pillesoft pillesoft closed this as not planned Won't fix, can't repro, duplicate, stale Sep 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants