Bug #83238 mysqlworkbench won't close Cannot Close SQL IDE while being busy
Submitted: 1 Oct 2016 22:46 Modified: 2 Oct 2016 3:56
Reporter: John Tamplin Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Workbench: SQL Editor Severity:S3 (Non-critical)
Version:6.2.4 OS:Mac OS X (unknown)
Assigned to: CPU Architecture:Any
Tags: WBBugReporter

[1 Oct 2016 22:46] John Tamplin
Description:
When I try to end the MySQL Workbench program, it refuses to close. At the bottom left of the SQL Editor screen, it displays "Cannot Close SQL IDE while being busy".  However, there is nothing running. All editor tabs are closed or blank. If I 'Force Quit' the program, the same error still occurs next time I open the program.

How to repeat:
Open the program, attempt to close it.

Suggested fix:
I suspect the MySQL has crashed previously and some setting is 'remembering' a query that was executing at that time.
[2 Oct 2016 3:56] Miguel Solorzano
Thank you for the bug report. I couldn't repeat with current release 6.3.7.
[18 Oct 2016 15:00] JC Quirin
For what it's worth, this has been happening to me constantly for the past couple of weeks. I believe that, as stated in original post, it is triggered by (or coincidental to) a crash that necessitates force-quitting the application. 

In addition to very often getting the "Cannot close SQL IDE while being busy" error, if I click the "Reconnect to DBMS" button, it hangs the application, necessitating a force-quit. For a while, I wasn't able to execute any queries on any connections. I reinstalled the application, to no avail. I deleted the .autosave items in the sql_workspaces directory, which removed the "autosaved" state, but didn't fix the issue. At the moment, I can execute some simple queries, but any time I attempt to query a large table (even with a limit of 1000 records), I am now getting a crash.

For me, I think there's a decent chance that this started after I upgraded to macOS Sierra. I am using MySQL Workbench 6.3.7, and am connecting to databases running 5.7.11-log.
[23 Oct 2016 17:12] Hashim Sharif
I have the same exact problem and started after the upgrade to MacOs Sierra !!
[24 Oct 2016 19:06] Aaron Anderson
I am also consistently having this problem. I have deleted the Workbench preferences and did a fresh install. If I open workbench and do not open a connection, the application quits fine. If I open workbench, open connection to local DB and immediately quit. The application quits fine.  But if anything is entered in the query, even if the query is empty at the time of quitting, I get this issue.
[31 Oct 2016 14:23] Greg French
I had the same problem after an upgrade to Sierra. What worked for me was to uninstall Workbench, then delete /Users/yourusername/Library/Application Support/MySQL directory, not just the sql_workspaces directory. Then Reinstall. You'll want to make sure you have a record of connection details!
[1 Nov 2016 23:07] Kirk Dickinson
I have this message on Windows 7.
[2 Nov 2016 11:29] Gabriel Capparelli
I had this problem when I upgraded to Sierra, but got resolved after installing version 6.3.8
[30 Nov 2016 22:40] Karl Shea
I have this issue on Sierra with 6.3.8. I've tried redownloading and also deleting everything in ~/Library/Application Support/MySQL/Workbench and nothing solves the issue.
[9 Dec 2016 23:30] Pittle Fart
Note the message at the bottom.

Attachment: snip.png (image/png, text), 62.28 KiB.

[9 Dec 2016 23:31] Pittle Fart
I too have this issue.  As mentioned, once you start getting this problem it doesn't seem to go away.  It is specific to two connections right now.  I have another two that are still working correctly.
[15 Dec 2016 19:18] Hector Medina
I have this issue too, I´ m in MacOS with MySqlWorkbench 6.3.6 build 511. Thanks a lot in advance for anyone that can help. Regards.
[15 Dec 2016 19:43] Hector Medina
I have this issue too, I´ m in MacOS with MySqlWorkbench 6.3.6 build 511. Thanks a lot in advance for anyone that can help. Regards.
[3 Jan 2017 23:54] Jonathan Shyman
I am having similar issues on OSX Sierra 10.12.2 with the following MySQL Workbench Community versions:

6.2.5
6.3.4
6.3.6
6.3.8

6.1.7 works without issues

6.3.4 worked for a while on Sierra until this morning. Now, removing and reinstalling does not solve the issues with Workbench. Neither does deleting the MySQL folder from ~/Library/Application Support
[4 Jan 2017 18:43] David Garratt
I have this problem as well with the latest version of the Workbench and OS Sierra
[6 Jan 2017 14:09] David Garratt
Is there a pattern to this - did everyone effected by the problem upgrade to OS Sierra rather than doing a fresh clean install ? I upgraded from El Capitan.
[6 Jan 2017 22:54] Cal Hemington
I have this same exact problem as well. Is there no fix?
[8 Jan 2017 11:08] David Garratt
Reverting back to an earlier version helped me
[9 Jan 2017 1:49] Chris Botman
I had the same issue but managed it get things working again.

Was on 6.3.1 when I upgraded from El Capitan to Sierra, and started getting the problem reported. 

I downloaded 6.3.8 and tried that, but same issue happened. 

Then while I still had Workbench open (not on purpose, just wasn't thinking about it), I deleted all the files in these directories:

/Users/foo/Library/Application Support/MySQL/Workbench/cache
/Users/foo/Library/Application Support/MySQL/Workbench/sql_history
/Users/foo/Library/Application Support/MySQL/Workbench/sql_workspaces

As soon as I deleted those, Workbench threw up an error about not being able to save the current workbench state. I force quit then restarted the app, and it's working fine now.
[9 Jan 2017 2:49] Chris Botman
Sorry, spoke too soon. My actions above fixed the immediate problem (I can run queries again), but now it crashes each time I try to close the app. Perhaps some of the connection-specific files I deleted don't get recreated if they're not there. 

Weirdly, I then re-installed 6.3.8 again and the original problem came back (i.e. I couldn't run any queries)!

Next tried deleting all connections and setting up a new one, and get weirdly flakey behaviour with it. I can connect and run queries OK, but whenever I try to close the workspace/connection or the entire app, it will lock and crash.
[20 Jan 2017 13:31] Gabriel Capparelli
It´s incredible that this issue still persists but I think I found a workaround based on Chris Botman's comment. I might be speaking too soon but it has been working for me so far:

I noticed that whenever a session hangs that session will start having persistent issues running queries. It seems to depend on the session and the order it is opened, for example if you have session SERVER1 and it is not working, when you open a second SERVER1 session it will work until someday it crashes (note that it doesn't have the same saved tabs because it is a different session even if the connection is the same). And if any of your open sessions is in this unstable state then Workbench will not close.

Based on this and Chris Botman's comment I went to:

/Users/foo/Library/Application Support/MySQL/Workbench/cache

There you will find a .cache and .column_widths file for each of your connections. With Workbench OPEN (IMPORTANT, it wont work if workbench is closed) I deleted both files from the problematic connection. 

rm SERVER1.cache
rm SERVER1.column_widths

Then I went to:

/Users/foo/Library/Application Support/MySQL/Workbench/sql_workspaces

and deleted the sessions directory which will have one of two names depending on the state it is (most probably .autosave). Make sure Workbench is still opened.

rm -rf SERVER1-1.autosave OR rm -rf SERVER1-1.workspace 

Where the number after the "-" is the tab position, if you are having trouble with the third session tab it would be

rm -rf SERVER1-3.autosave OR rm -rf SERVER1-3.workspace 

Here after a few seconds Workbench will give you an error that it can't autosave (path not found).

Force quit

Reopen Workbench and the session should now be working.

Now I found out that I have to close all sessions tabs before exiting Workbench, if I close Workbench with opened tabs the first session will get screwed up. If workbench hangs while doing a query in any session the first session will also get screwed up and the whole process has to be repeated.

Hope it is of help until someone finds a definitive solution.
[20 Jan 2017 15:08] Richard Thomas
This happens to me multiple times per day. I am constantly having to force quit mysqlworkbench.   

I've been using mysqlworkbench for quite a while so I've done many upgrades of both the OS and the app.

Right now I'm running: Sierra 10.12.2 and mysqlworkbench 6.3.8 build 1228 CE (64bit)
[6 Feb 2017 13:35] Manuel Felici
I am also plagued by bugs.
MacOS Sierra 10.12.2
MySQL Workbench 6.3.8 build 1228 CE (64bit)
[10 Feb 2017 14:09] RONNY BREMER
Same issue here. Mac OS X Sierra and WB 6.3.8. None of the workarounds help.
[10 Feb 2017 14:14] Richard Thomas
I upgraded to 6.3.9 on Mac and so far this issues seems to have been fixed.
[11 Feb 2017 2:13] Blair Zettl
Upgrade 6.3.9 fixed similar issues on my machine.  Running MAC Sierra.
[11 Feb 2017 10:36] RONNY BREMER
6.3.9 solved it here too.
[13 Feb 2017 9:39] Gabriel Capparelli
Finally a new version that seems to solve the issues!!!
[1 May 2017 21:06] Anna Nic
I recently upgraded to Sierra and had the same issue but as with other folks, upgrading to 6.3.9 seems so solve the issue so far.
[23 Feb 2018 3:55] Davidac Lee
Just fix the issue by updating MySQL Workbench with the latest version.
[9 Mar 2018 13:54] Rodrigo Magalhães
Also affects me. I musk manually kill the WB processes so it can be closed.

This issue happens after WB freezes when trying to communicate with the server (get table details, execute query, get SP details...). This other issue has also been reported on  #73172 (Mysql workbench hangs after idle) which rests long unresolved.

I'm using Ubuntu Linus 16.04 and Workbench version 6.3.6 Build 511 CE (64 bits)
[28 Mar 2018 14:26] Mikey Fordyce
The same occurs for me when:
1) I attempt to execute a poorly designed query that never completes execution. 
2) After several minutes of query execution I click stop to stop query execution and in the output window I see an interrupt error "Error Code: 1094 Unknown thread id: 14437904"
3) I can not re-execute query because MySQL Workbench thinks it is still running.
3) I attempt to close MySQL Workbench and it says in the lower left status bar: Cannot close SQL IDE while being busy.