Bug #50205 WB doesn't handle ssh tunnel timeouts
Submitted: 9 Jan 2010 23:07 Modified: 21 Jan 2010 19:24
Reporter: [ name withheld ] Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Workbench Severity:S3 (Non-critical)
Version:5.2.11 OS:Any
Assigned to: CPU Architecture:Any

[9 Jan 2010 23:07] [ name withheld ]
Description:
When an ssh tunnel times out, on trying to run a query the tunnel should reconnect. Instead, I get the following responses on successive attempts to execute the query (note esp. the 3rd one down):

		Time	Action	Response	Duration / Fetch
0	1	17:57:37		Error: Cannot open SSH Tunnel: Client for 10245 disconnected	
		Time	Action	Response	Duration / Fetch
0	1	17:58:37		Error: Cannot open SSH Tunnel: client connection established	
		Time	Action	Response	Duration / Fetch
0	1	18:03:25		Error: Cannot open SSH Tunnel: 3647 INFO Tunnel now open ('127.0.0.1', 51357) -> ('xxx.xxx.xxx.xxx', xxxx) -> ('127.0.0.1', 3306)
		Time	Action	Response	Duration / Fetch
0	1	18:04:30		Error: Cannot open SSH Tunnel: Reusing tunnel at port 3647
		Time	Action	Response	Duration / Fetch
0	1	18:04:41		Error: Cannot open SSH Tunnel: New client connection
		Time	Action	Response	Duration / Fetch
0	1	18:04:48		Error: Cannot open SSH Tunnel: client connection established

How to repeat:
I can generally reproduce this by opening a tunnel, then killing the net connection (e.g., disable WiFi), waiting a few minutes, and then re-enabling the connection.

Suggested fix:
This message is particularly suspect to me: Error: Cannot open SSH Tunnel: 3647 INFO Tunnel now open ('127.0.0.1', 51357) -> ('xxx.xxx.xxx.xxx', xxxx) -> ('127.0.0.1', 3306) . It suggests that WB doesn't notice that it's successfully reopened the tunnel.
[14 Jan 2010 6:12] Susanne Ebrecht
Many thanks for writing a feature request.

Unfortunately, we are not able to fix this problem.

You want that always after SSH tunnel was timed out or killed then Workbench should reopen it. That would mean that it will be open forever.

When we would do it we will open a huge security lack.

There is a good reason, why SSH tunnel will time out. It is because of security reasons and we should not workaround SSH rules here.
[14 Jan 2010 14:51] [ name withheld ]
No, you misunderstood my request. I do not want for the tunnel to be re-opened automatically whenever it dies.

I do want for the tunnel to be re-opened automatically, but only at that time when I attempt to query the remote server again. Indeed, this is what WB tries to do already. It apparently succeeds, but doesn't notice that it succeeded. See the log message in the original report.

The effect of the existing bug is that when WB does not notice that it succeeded, I have to close and restart WB to establish a new connection to the server.
[21 Jan 2010 19:24] [ name withheld ]
I'm no longer seeing this behavior in WB 5.2.14.