Bug #90884 Unable to reopen connection after losing ssh connection
Submitted: 16 May 2018 8:23 Modified: 18 Nov 2019 8:06
Reporter: Fredric Johansson Email Updates:
Status: Closed Impact on me:
Category:MySQL Workbench Severity:S3 (Non-critical)
Version:8.0.11 OS:Windows
Assigned to: CPU Architecture:Any

[16 May 2018 8:23] Fredric Johansson
I have connections to remote mysql servers over ssh (Standard TCP/IP over ssh). If I have an open MySQL connection tab and lose network connectivity I'm unable to reopen the current connection after regaining network connectivity if the underlying ssh connection timed out.

Workbench claims an existing ssh tunnel exists and try to reuse it. It writes the following to the log. The first SSH tunnel messages when it tries to reconnect in the background and the last together with the ERR when actively trying to reconnect:
07:22:38 [INF][     SSH tunnel]: Existing SSH tunnel found, connecting
07:24:15 [INF][     SSH tunnel]: Existing SSH tunnel found, connecting
07:24:48 [INF][     SSH tunnel]: Existing SSH tunnel found, connecting
07:27:22 [INF][     SSH tunnel]: Existing SSH tunnel found, connecting
07:27:32 [ERR][SQL Editor Form]: Error Code: 2013
Lost connection to MySQL server at 'waiting for initial communication packet', system error: 10060

To reconnect I need to open a new connection from the home tab.

This worked fine in v6.3.10 so its a regression in v8

How to repeat:
1. Have an open connection tab
2. Lose network connectivity lasting at least as long the ssh timeout.
3. Regain network connectivity and try to reconnect with the current MySQL connection tab
[2 Aug 2018 12:45] Chiranjeevi Battula
Hello Fredric Johansson,

Thank you for the bug report.
I could not repeat the issue at our end using with MySQL Workbench 8.0.12 version on Windows 7/10.
If you can provide more information, feel free to add it to this bug and change the status back to 'Open'.

Thank you for your interest in MySQL.

[10 Oct 2018 8:18] Fredric Johansson
I can repeat this by blocking the ssh connection to the remote host and trying to run a query in the open editor. When removing the block, workbench still thinks the connection is available and try to reuse it.

This worked fine in Workbench 6.3 so the change have likely to do with the change from paramiko to libssh for the ssh tunneling.
[17 Oct 2018 12:38] Marcin Szalowicz
Thank you for the bug report, 
verified as described.
[4 Dec 2018 16:30] Christine Cole
Posted by developer:
Fixed as of the upcoming MySQL Workbench 8.0.14 release, and here's the changelog entry:

Connections made to a remote MySQL server over SSH did not recover
properly after the network was interrupted temporarily.

Thank you for the bug report.
[24 Jun 2019 22:19] Igor Andrade
I am still experiencing this bug. Installed version: 8.0.15 build 14271522 CE (64 bits) macOS.
[18 Nov 2019 6:03] charlie zhao
I am on 8.0.18 build. Still have the issue.
[18 Nov 2019 8:06] Fredric Johansson
Yeah, the issue is still there. The difference now is that workbench might run/start one query before it thinks the connection is gone.