Bug #61950 MySQL Workbench crash "Invoke of BeginInvoke cannot be called..."
Submitted: 22 Jul 2011 5:15 Modified: 8 Feb 2012 23:25
Reporter: michael plavins Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Workbench: SQL Editor Severity:S3 (Non-critical)
Version:5.2.34 CE rev 7780 OS:Windows (Win7 x64)
Assigned to: CPU Architecture:Any

[22 Jul 2011 5:15] michael plavins
Description:

MySQL WOrkbench Unexpected Error
  "Invoke of BeginInvoke cannot be called on a control until the window handle has been created"

After clicking OK the program hung.

(It's still hung after about 5 minutes, no longer using CPU and memory usage has not changed (about 85MB).

Also, I haven't tested all of the below behaviour again, however 1 through 5 are repeatable and end with blank "Object Browser" and "Object Information" tabs simply by (a) setting "Save snapshot", open an SQL file so it has a tab, closing Workbench (b) removing the SQL file from the directory (c) open Workbench

How to repeat:

1. I had a bunch of query windows open but wanted to shut down PC so went to the option and selected "Save snapshot of open editors on close" also Auto-save set to 20min - NOTE: one of the windows as to an SQL script file "records_events.sql", the rest were "Query 1" through "Query 12".

2. Closed Workbench & rebooted PC

3. The script file mentioned in (1) was moved to another location

4. Opened Workbench

5. Error message said "file record_events.sql" not found.  The rest of the session windows opened as they were left.  BUG: the database schema list (the entire left window) was completely blank.

6. Closed each of the query tabs one by one

7. After closing the last one I got the error message shown in the description, then the entire Workbench process hung.

8. Killed process with Windows Explorer.

9. Restarted Workbench - BUG: all ~12 of my old query windows came back (I closed them in step (6)).  

10. Closed all windows again & closed Workbench without any error this time.

11. Opened Workbench - BUG: all ~12 of my old query windows came back (I closed them in step (6)).

12. Turned off "Save snapshot of open editors on close" setting and closed Workbench.

13. Opened Workbench, no windows appeared (correct behaviour)

14. Re-enabled "Save snapshot" setting, added some queries, closed Workbench

15. Opened Workbench, new set of queries from (14) appeared (correct behaviour)

Suggested fix:

I've noticed a few times that the "Save snapshot" feature is buggy (I find it extremely useful).  It might be useful to have a way of recovering/editing saved sessions as text and then clearing the cache.
[25 Aug 2011 16:44] Armando Lopez Valencia
Thanks a lot for your report Michael.
Snapshot defect already reported: 12907612
Blank left panel error reproduced as stated by the Reported:

1. I had a bunch of query windows open but wanted to shut down PC so went to the option
and selected "Save snapshot of open editors on close" also Auto-save set to 20min - NOTE:
one of the windows as to an SQL script file "records_events.sql", the rest were "Query 1"
through "Query 12".

2. Closed Workbench & rebooted PC

3. Remove/rename the script file mentioned in step 1.

4. Opened Workbench

5. Error message said "file record_events.sql" not found.  The rest of the session
windows opened as they were left.  BUG: the database schema list (the entire left window)
was completely blank.

6. See attachment for details.
[25 Aug 2011 17:08] Armando Lopez Valencia
Evidence

Attachment: BlankLeftPanel.JPG (image/jpeg, text), 90.13 KiB.

[8 Feb 2012 23:25] Philip Olson
Fixed as of 5.2.38:

Recovery of the last state using either the Auto-save feature,
or the "Save snapshot of open editors on close"
option, would sometimes load improperly by creating an empty
schema and/or crashing (closing) all remaining SQL editor tabs.
[8 Feb 2012 23:29] Philip Olson
The last line of the aforementioned changelog entry should read:

schema and/or crash while closing opened SQL editor tabs.