Open ifariasg opened 1 year ago
Hey @ifariasg, thanks for reporting. You said
Is there a way to activate some kind of verbose to see what paramiko is doing under the hood?
Yes, you need to start Spyder in a terminal with
spyder --debug-output terminal
to activate logging of Spyder and all its dependent libraries. If paramiko generates some kind of logging, it should be shown in the terminal.
The cluster needs to be accessed through a proxy jump set up in a config file in the .ssh folder and it is impossible for me to check what paramiko/spyder are doing to connect.
What we do through paramiko is open a SSH tunnel to the remote machine using your credentials. I really don't know how this could work in your case since the connection requires an additional step. Perhaps paramiko allows for a script to be executed after the connection.
Let us know what you find.
Yep, there is a problem with the SSH tunnel.
All I get is and endless stream of
Secsh channel X open FAILED: Connection refused: Connect failed
You could try to create the tunnel manually, as described here:
https://github.com/ipython/ipython/wiki/Cookbook:-Connecting-to-a-remote-kernel-via-ssh
Once you have that working, I think you should be able to connect to that kernel from Spyder as you would for a local one.
Made it work! It required a couple of extra steps and its quite cumbersome but at least it is now possible.
So to give more context, the cluster I'm trying to connect requires a proxy jump of this style via the .ssh/config file:
Host server
Port 22
HostName <ip>
Host node*
HostName %h
ProxyJump server
Main issue here was that the spyder context menu for remote kernel connection points to a server adress via the format user@hostname:port
. With this structure the config file is never read and thus the proxyjump never happens, particularly because Spyder (or paramiko?) adds the port to the SSH command always.
What I didn't know is that you can get the needed behavior by leaving the port and username blank and use as hostname user@nodeXX
This is not all though, this solves the proxy jump issue but still the SSH tunnel is not succesful via paramiko. To solve this I had to reformat the config file to use LocalForward
ending with a structure like the following:
Host server
Port 22
HostName <ip>
Host node*
HostName %h
ProxyJump server
LocalForward port1 127.0.0.1:port1
LocalForward port2 127.0.0.1:port2
LocalForward port3 127.0.0.1:port3
LocalForward port4 127.0.0.1:port4
LocalForward port5 127.0.0.1:port5
I then have to manually SSH to nodeXX and afterwards I can connect to the remote kernel with user@nodeXX
as hostname.
So everytime I start a kernel I will have to update the config file. But hey, at least it works now!
Found another issue that stems from this, because the tunneling is no longer being handled by paramiko/Spyder, the variable explorer tunneling is also not being done.
If I manually add the port I get with get_ipython().kernel.frontend_comm.comm_port
to the config file the variable explorer works again. Related to #11538?
It would be nice to know what other ports Spyder is using in a remote kernel connection for any other features, as this behavior might apply to those.
Related to https://github.com/spyder-ide/spyder/issues/11538?
Actuallo of issue #14894, which is already fixed as you can see. The fix will be available in Spyder 6, to be released next year.
It would be nice to know what other ports Spyder is using in a remote kernel connection for any other features, as this behavior might apply to those.
There are no more ports.
Problem Description
I'm trying to connect to a remote kernel set up on a HPC cluster using spyder. I followed the guide provided by Spyder and also some recommendations provided by the cluster administrators. The issue that I have is that I get an endless "Connecting to kernel". I'm sure I can connect to the remote node via SSH directly via shell or any SSH client.
Once of hundreds of times I've tried the connection was successful but since I have not been unable to reproduce this.
Is there a way to activate some kind of verbose to see what paramiko is doing under the hood? The cluster needs to be accessed through a proxy jump set up in a config file in the .ssh folder and it is impossible for me to check what paramiko/spyder are doing to connect.
Both the local machine and the server are running the same version of spyder-kernels.
What steps reproduce the problem?
python -m spyder_kernels.console
Versions
Dependencies