Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 367801 - [ssh] Cannot Fetch children on ssh connection using non-standard port.
Summary: [ssh] Cannot Fetch children on ssh connection using non-standard port.
Status: RESOLVED WORKSFORME
Alias: None
Product: Target Management
Classification: Tools
Component: RSE (show other bugs)
Version: 2.0   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: dsdp.tm.rse-inbox CLA
QA Contact: Martin Oberhuber CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-01-03 17:07 EST by Chris King CLA
Modified: 2012-01-24 06:34 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Chris King CLA 2012-01-03 17:07:38 EST
Build Identifier: I20110613-1736

I have two ssh connections setup on my RSE window.
One connection works, this one uses a standard ssh port.
The Second does not connect, upon trying to connect I get this error stack

!ENTRY org.eclipse.rse.ui 4 0 2011-11-09 19:38:01.711
!MESSAGE RSEG1066U: SUB#0:timeout: socket is not established
!STACK 0
com.jcraft.jsch.JSchException: timeout: socket is not established
at com.jcraft.jsch.Util.createSocket(Util.java:386)
at com.jcraft.jsch.Session.connect(Session.java:182)
at org.eclipse.rse.internal.connectorservice.ssh.SshConnectorService.internalConnect(SshConnectorService.java:121)
at org.eclipse.rse.core.subsystems.AbstractConnectorService.connect(AbstractConnectorService.java:412)
at org.eclipse.rse.ui.operations.SystemFetchOperation.execute(SystemFetchOperation.java:243)
at org.eclipse.rse.ui.operations.SystemFetchOperation.run(SystemFetchOperation.java:128)
at org.eclipse.rse.ui.view.AbstractSystemViewAdapter.fetchDeferredChildren(AbstractSystemViewAdapter.java:1970)

In the interface when I try to browse the server it just says "fetching children" for a minute or so and I get the following error in a dialog box "Operation failed with exception 'timeout: socket is not established'"

I should mention that this connection does require a non standard ssh port of 2020 that I have set by right clicking on sftp -> properties -> subsystem -> port.

So its almost (at a guess) the port isnt being configured properly as a standard ssh connection to a server works and another connection setup in exactly the same way using a non standard port doesnt.

I can also confirm that I can connect to this server on the same pc using both filezilla and ssh on a terminal, so I am assuming that rules out firewalls etc.
I have also tried restarting eclipse, deleting and remaking the connection and using a fresh new workspace and creating a new connection there... nothing so far has worked.
I have also tried the same connection to the same server on a different pc with eclipse and the issue occurs on that also.

Reproducible: Always

Steps to Reproduce:
1.Create new SSH connection to server
2.Change the port via sftp -> properties -> subsystem -> port (my example uses port 2020)
3.Attempt to connect and browse the files on then server using the directory tree by clicking on My Home or Root.
4. It says "fetching children" for a minute or so.
5. Error Dialog -> "Operation failed with exception 'timeout: socket is not established'"
Comment 1 Martin Oberhuber CLA 2012-01-04 03:51:10 EST
We have successfully used RSE with a nonstandard SSH port on many occasions (especially QEMU simulators on a local host) but I currently don't have a system with nonstandard SSH port at hand to cross-check.

1. Please check whether you can connect with TM Terminal (that would rule out
   issues with JSch)

2. While using Filezilla to browse that server, please check whether an 
   "sftp-server" process is running (we use sftp and not scp)

3. Try using the OpenSSH "sftp" command against that server with a -verbose
   logging option to see what protocol(s) your server speaks.

If that all doesn't work, using Wireshark to check the network traffic may be an option, or debugging into the RSE SSH code.

Could it be that you set up multiple connections to that server and a wrong port is somehow cached ?
Comment 2 Chris King CLA 2012-01-08 17:12:55 EST
I am not really sure what to say..
I can connect to the server via terminal, and sftp.
When I connected to the terminal via sftp I used -v and can see the following output from the server in regards to a protocol.

debug1: Remote protocol version 2.0, remote software version OpenSSH_4.3
debug1: match: OpenSSH_4.3 pat OpenSSH_4*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_5.8p1 Debian-7ubuntu1

I am not really sure what you mean in response to using wireshark as I have never used that application before.

Is there something else that I could test or try?
Comment 3 Martin Oberhuber CLA 2012-01-13 12:31:58 EST
So I finally got to trying this out, and RSE works fine for me.

Remote Server> /usr/sbin/sshd -p 2020

Changing the subsystem port in RSE just like you did, I can connect just fine.

Could it be that a proxy is configured on your client machine (bug 352072) ?
You may want to try with an empty workspace, single "SSH Only" connection.
Rather than using the Sftp Files subsystem, try to "Connect" then "Launch Shell" or "Launch Terminal" from under the shells or terminals subsystem.

Beyond that you may want to look at bug 319064 for adding more logging.

I'm keeping this bug open for now in case you find anything else ... but to me this issue looks INVALID.
Comment 4 Chris King CLA 2012-01-18 06:17:07 EST
Hello,

I tried all of the things you suggested, again I tried to connect to the server using RSE normally with no luck.. I Then created a new workspace and added a SSH Only connection and tried connecting again, same problem. I then tried to launch the shell at which it just says "launching" in the progress box followed by nothing (not even a error)

So I tried to see exactly what eclipse was sending to the server as a request via wireshark.
I was able to see the following 

Transmission Control Protocol, Src Port: 47640 (47640), Dst Port: ssh (22), Seq: 0, Len: 0 

The Destination Port is listed i the packet as 22 whereas I can confirm in eclipse I have set it to 2020.

What can I do from here?

I have tried to show you the issue as I see it via a screenshot..
You can see my attempt to connect to the server via just browsing and launching a shell while capturing with wireshark.

http://i.imgur.com/Z4tEQ.png <-- hopefully the screenshot will still be available when you get the chance to check it.
Comment 5 Martin Oberhuber CLA 2012-01-18 06:32:07 EST
I checked again, this time deliberately also killing the sshd on port 22 and only launching one on port 2020 - everything works as expected.

What's interesting is that I get a different error message when I try to connect on port 22 while that port isn't listening - it's "Failed to connect sshd on <hostname>" with details "java.net.ConnectException: Connection refused".

Please check again your configuration: Help > About > Installation Details > Configuration , paste all into a file and attach here.

Please also check Window > Preferences > General > Network Connections , and add your host into the "Proxy bypass" list just to be sure.

I'm surprised that I don't see an "SSH Terminals" subsystem in your screenshot. Maybe you got a very old version installed .. the configuration will show since it also contains the plugin versions you have.
Comment 6 Chris King CLA 2012-01-18 06:41:02 EST
Here are the details from my Help -> About -> Installation Details -> Config

http://pastebin.com/EFSp6q73

I have added the Host into the proxy bypass list and that hasnt helped but its there like you said just incase.
Comment 7 Chris King CLA 2012-01-18 06:42:02 EST
If you need it, I downloaded RSE from the install new software section in eclipse and used this address
http://download.eclipse.org/dsdp/tm/updates/2.0/ as my software site.
Comment 8 Martin Oberhuber CLA 2012-01-18 07:25:46 EST
(In reply to comment #7)

> http://download.eclipse.org/dsdp/tm/updates/2.0/ as my software site.

Ok, here's the problem. That version is ANCIENT (4 years old, I think).
For using with Eclipse 3.7 Indigo, please use

   http://download.eclipse.org/dsdp/tm/updates/3.3/

or

   http://download.eclipse.org/releases/indigo/

where did you get that ancient site URL from ?
Comment 9 Martin Oberhuber CLA 2012-01-24 06:34:26 EST
I'm assuming that this has been fixed by installing the newer version ?

Feel free to reopen if not.