Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#203 closed defect (invalid)

reconnect in winswitch menu needs two tries

Reported by: pmarek Owned by: Antoine Martin
Priority: minor Milestone: 0.12
Component: Client Keywords:
Cc:

Description (last modified by Antoine Martin)

I've got a remote tunnel, via

ssh -L 8022:host1:22

and connect to host2 via winswitch and the localhost:8022 tunnel.

Now, if I stop that outer SSH session (eg. via the "\n\n~." escape sequence) winswitch sees that the connection is severed, and displays "reconnect" in the servers menu.

But this doesn't work; on the first "reconnect" winswitch says that it couldn't connect, and only on the second try it really reconnects.

So it seems like there's some old state that is not being updated when a connection breaks.

Change History (6)

comment:1 Changed 7 years ago by Antoine Martin

Description: modified (diff)
Milestone: 0.12
Owner: changed from Antoine Martin to Antoine Martin
Status: newaccepted

comment:2 Changed 7 years ago by Antoine Martin

Reproduced, here is the log sample I was looking for:

[II] 2012/10/09 12:04:47 ConchConnection.serviceStopped()
[II] 2012/10/09 12:04:47 ConchStdioRemoteClientLinkFactory.clientConnectionLost(<twisted.internet.tcp.Connector instance at 0x7fb6686528c0>,[Failure instance: Traceback (failure with no frames): <class 'twisted.internet.error.ConnectionDone'>: Connection was closed cleanly.\n])
[EE] 2012/10/09 12:04:47 ConchStdioRemoteClientLinkFactory.disconnected()
[II] 2012/10/09 12:04:47 ConchConnection.serviceStopped()
[DD] 2012/10/09 12:04:47 ConchConnection.channelClosed(<SSHChannel session (lw 57881 rw 2071382)>)
[II] 2012/10/09 12:04:47 ExecLineChannel.closed()
[II] 2012/10/09 12:04:47 ExecLineChannel.closed(data=) _closed=False
[II] 2012/10/09 12:04:47 ConchStdioRemoteClientLinkFactory.link_closed()
[DD] 2012/10/09 12:04:47 ServerLink.close_connections()
[DD] 2012/10/09 12:04:47 ServerLink.stop_forwarders() forwarders {'127.0.0.1:15061#False;': (<<class 'twisted.internet.tcp.Port'> of twisted.conch.ssh.forwarding.SSHListenForwardingFactory on 12463>, 12463, '127.0.0.1', 15061)}
[DD] 2012/10/09 12:04:47 ServerLink.stop_forwarders() stopping forwarder: (<<class 'twisted.internet.tcp.Port'> of twisted.conch.ssh.forwarding.SSHListenForwardingFactory on 12463>, 12463, '127.0.0.1', 15061)
[II] 2012/10/09 12:04:47 ExecLineChannel.stop(False,stopping this connection) stopped=False
[II] 2012/10/09 12:04:47 ExecLineChannel.closed()
[II] 2012/10/09 12:04:47 ExecLineChannel.closed(data=) _closed=True
[II] 2012/10/09 12:04:47 ConchStdioRemoteClientLinkFactory.link_closed()
[II] 2012/10/09 12:04:47 ConchStdioRemoteClientLinkFactory.clientConnectionLost(<twisted.internet.tcp.Connector instance at 0x7fb6682e3998>,[Failure instance: Traceback (failure with no frames): <class 'twisted.internet.error.ConnectionDone'>: Connection was closed cleanly.\n])
[EE] 2012/10/09 12:04:47 ConchStdioRemoteClientLinkFactory.disconnected()





[DD] 2012/10/09 12:05:01 PyGTKCaptureDisplay.do_capture() window=<gtk.gdk.Window object at 0x7fb66868adc0 (GdkWindow at 0x197b120)>, w=2560 h=1600 pixbuf=<gtk.gdk.Pixbuf object at 0x7fb668712870 (GdkPixbuf at 0x35538a0)>
[DD] 2012/10/09 12:05:01 WinSwitchServer.send_new_capture_data() session=ServerSession(:0 - X11 - available), util=<winswitch.virt.localX11_server_util.LocalX11ServerUtil instance at 0x7fb6686197e8>, clients=[<winswitch.server.client_channel.WinSwitchClientChannel instance at 0x7fb66863dd88>]
[DD] 2012/10/09 12:05:03 WinSwitchApplet.close_menu()
[DD] 2012/10/09 12:05:04 StatusIconTray.validate_position(<gtk.Menu object at 0x7fb668712730 (GtkMenu at 0x2b70d30)>,(1969, 1217, 0)) new position=1969 x 1217
[DD] 2012/10/09 12:05:07 ConfigureServerWindow.do_populate_form()
[DD] 2012/10/09 12:05:07 ConfigureServerWindow.tunnel_changed()
[DD] 2012/10/09 12:05:07 icons.do_get_raw_icondata_for_platform(linux2,empty)
[DD] 2012/10/09 12:05:07 ConfigureServerWindow.command_port_radio_changed(())
[DD] 2012/10/09 12:05:07 ConfigureServerWindow.tunnel_changed(<gtk.CheckButton object at 0x7fb668d9d780 (GtkCheckButton at 0x36015e0)>)
[DD] 2012/10/09 12:05:07 ConfigureServerWindow.user_changed(<gtk.OptionMenu object at 0x7fb668bfaf00 (GtkOptionMenu at 0x3780e50)>)
[II] 2012/10/09 12:05:07 WinSwitchApplet.get_link_client(ServerConfig(big-laptop:13113210055),None) no link client
[DD] 2012/10/09 12:05:07 ConfigureServerWindow.calculate_tabs_size()=729x437
[DD] 2012/10/09 12:05:09 ConfigureServerWindow.callback_delegate(<gtk.Button object at 0x7fb66868adc0 (GtkButton at 0x32e26e0)>,<function <lambda> at 0x7fb668b8c410>)
[DD] 2012/10/09 12:05:09 ServerLink.kick() server=ServerConfig(big-laptop:13113210055)
[DD] 2012/10/09 12:05:09 ServerLink.connect_to_server()
[II] 2012/10/09 12:05:09 ConchStdioRemoteClientLinkFactory.__init__(antoine,,127.0.0.1,15000,/home/antoine/.ssh/id_rsa.pub,########################,,0a:a3:a7:97:5a:b2:15:20:fa:82:4c:de:fd:99:dd:49)
[DD] 2012/10/09 12:05:09 ServerLink.connect_to_server() connecting using <winswitch.client.conch_server_channel.ConchStdioRemoteClientLinkFactory instance at 0x7fb6684c59e0> via SSH on 127.0.0.1:15000
[II] 2012/10/09 12:05:09 ConchStdioRemoteClientLinkFactory.clientConnectionFailed(<twisted.internet.tcp.Connector instance at 0x7fb6684b1878>,[Failure instance: Traceback (failure with no frames): <class 'twisted.internet.error.ConnectionRefusedError'>: Connection was refused by other side: 111: Connection refused.\n])
[EE] 2012/10/09 12:05:09 ConchStdioRemoteClientLinkFactory.disconnected()
[DD] 2012/10/09 12:05:09 ServerLink.notify(Cannot connect to SSH server on big-laptop,Failed to connect to the SSH server at 127.0.0.1:15000,\nplease ensure that the hostname and port number are correct,\nIs the SSH server running on that host?\nIs a firewall blocking access to it?,None,None,error,None)
[II] 2012/10/09 12:05:09 WinSwitchApplet.do_notify(Cannot connect to SSH server on big-laptop,Failed to connect to the SSH server at 127.0.0.1:15000,\nplease ensure that the hostname and port number are correct,\nIs the SSH server running on that host?\nIs a firewall blocking access to it?,None,None,error,ServerConfig(big-laptop:13113210055),None)
[DD] 2012/10/09 12:05:09 NotificationUtil.safe_notify(<winswitch.ui.statusicon_tray.StatusIconTray instance at 0x2b2b998>,Cannot connect to SSH server on big-laptop,Failed to connect to the SSH server at 127.0.0.1:15000,please ensure that the hostname and port number are correct,Is the SSH server running on that host?Is a firewall blocking access to it?,None,('Edit Server Configuration', <function show_config at 0x7fb6684b5320>),error)
[DD] 2012/10/09 12:05:09 NotificationUtil.notify(<winswitch.ui.statusicon_tray.StatusIconTray instance at 0x2b2b998>,Cannot connect to SSH server on big-laptop,Failed to connect to the SSH server at 127.0.0.1:15000,\nplease ensure that the hostname and port number are correct,\nIs the SSH server running on that host?\nIs a firewall blocking access to it?,10,('Edit Server Configuration', <function show_config at 0x7fb6684b5320>),winswitch_warning) hasdbusnotify=True, haspynotify=False, icon_name=winswitch_warning, prefer_growl=True, hasgrowl=False, PREFER_DBUS=True, platform=linux2
[II] 2012/10/09 12:05:09 WinSwitchApplet.attention(Cannot connect to SSH server on big-laptop,None)
[II] 2012/10/09 12:05:09 StatusIconTray.animate_status_icon(Cannot connect to SSH server on big-laptop,5) now=1347253509.23, tray_widget_animate_until=1347252099.74
[II] 2012/10/09 12:05:09 NotificationUtil.cbReply(4)
[II] 2012/10/09 12:05:09 WinSwitchApplet.get_link_client(ServerConfig(big-laptop:13113210055),None) no link client

comment:3 Changed 7 years ago by Antoine Martin

Resolution: invalid
Status: acceptedclosed

Correction: I only see this problem if I forget to re-start the ssh tunnel, if I do re-start it then it connects just fine.

comment:4 Changed 7 years ago by pmarek

Well, I don't use a manual SSH tunnel for this connection - winswitch/xpra should start it's own for that server.

And there shouldn't be an old connection being seen - having a weekend inbetween should be more than enough to get a timeout on any old connection ...
(BTW, the machine was powered on in the meantime, so any SSH/TCP tunnel should be gone by now).

comment:5 Changed 7 years ago by Antoine Martin

This does not make sense:

Well, I don't use a manual SSH tunnel for this connection - winswitch/xpra should start it's own for that server.

And:

I've got a remote tunnel, via ssh -L 8022:host1:22

Both cannot be true.

comment:6 Changed 7 years ago by pmarek

Ah sorry, the comment was mixed up with #218 (which references this ticket).

I'm using the same session on a server from the office (automatic SSH tunnel via winswitch) and from abroad (manual tunnel, inner automatic tunnel) - perhaps my problems are related to some connection mix-up inside winswitch (same server key, name, or whatever?)

Note: See TracTickets for help on using tickets.