Bug #74967 I got an error message when I try to create a database backup
Submitted: 22 Nov 2014 6:48 Modified: 4 Feb 2015 2:41
Reporter: Homero Diaz Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Workbench Severity:S3 (Non-critical)
Version:6.2.4 OS:Linux (Ubuntu 14.04.1 LTS)
Assigned to: CPU Architecture:Any
Tags: WBBugReporter

[22 Nov 2014 6:48] Homero Diaz
Description:
The following error message rises when I try to create a database backup by using Management-Data Export:
Error Unhandled exception: 'builtin_function_or_method' object has no attribute '__getitem__'
this error occurs even if you try to backup a single table

How to repeat:
just try to create a database backup by using Management-->Data Export-->Export to dump project folder and select a table
This error rises after clicking the "Start Export" button
[24 Nov 2014 9:34] MySQL Verification Team
Hello Homero Urueta,

Thank you for the report.

Thanks,
Umesh
[24 Nov 2014 9:35] MySQL Verification Team
// WB version and OS details

MySQL Workbench Community (GPL) for Linux/Unix version 6.2.4  revision 12437 build 2426 (64 bit)
Configuration Directory: /home/ushastry/.mysql/workbench
Data Directory: /usr/share/mysql-workbench
Cairo Version: 1.13.1
OS: Linux 3.13.0-39-generic
CPU: Intel(R) Core(TM)2 Duo CPU     E8400  @ 3.00GHz (2992.790MHz) - 2.94GiB RAM
Distribution: Ubuntu 14.04.1 LTS

## Log

Traceback (most recent call last):
  File "/usr/share/mysql-workbench/libraries/workbench/notifications.py", line 31, in _the_observer
    for obs, nam, obj in self.observers:
  File "/usr/lib/mysql-workbench/modules/wb_admin_export.py", line 1712, in start
    args.append['--skip-triggers']
TypeError: 'builtin_function_or_method' object has no attribute '__getitem__'
[24 Nov 2014 9:36] MySQL Verification Team
Screenshot..

Attachment: 74967.png (image/png, text), 120.76 KiB.

[3 Dec 2014 13:22] Alexander Buchner
I have the same problem. Is there a workaround for migrating the database to a new machine?
[3 Dec 2014 19:58] Homero Diaz
This issue is only related to multiple database and the option 'Export to Dump Project Folder'. You still can backup every database in a single sql file by using 'Data Export' -> 'Export to self-contained file' and choosing your databases/tables and options according to your needs
[11 Dec 2014 12:55] ale prieto
Apparently, as Umesh says, the problem are the brakets on line 1712. 

I changed the line:
args.append['- skip-triggers'] 

by:
args.append('- skip-triggers') 

and it worked.

I also changed the line 1717: args.append ['- no-create-info'] 
by: args.append ('- no-create-info')

I hope might help :)
[13 Jan 2015 17:24] Cord Slatton-Valle
This bug makes MySQL Workbench 6.2 unusable.
[13 Jan 2015 17:32] Cord Slatton-Valle
The replacements of the [] with () worked for me, I am on Windows. the file was located at C:\Program Files\MySQL\MySQL Workbench 6.2 CE\modules\wb_admin_export.py
[20 Jan 2015 8:39] Luca Nappini
I have the same bug....
[20 Jan 2015 21:36] Luis Rocha
I'm having the same issue on OS X Yosemite 10.10.2, but I can't find the file mentioned (wb_admin_export.py), though running a locate command does find it in /Applications/MySQLWorkbench.app/Contents/PlugIns/, but when I try to open it or cd to that directory, it cannot find it. Can anyone point me to the correct path to that file on OS X? That's the only location it finds it in.
[23 Jan 2015 11:22] MySQL Verification Team
Bug #75448 marked as duplicate of this
[23 Jan 2015 15:40] Bobes Calin
The same bug here!

Like Cord Slatton-Valle i make some changes in wb_admin_export.py and change the [] to () 

Line 1712 ['skip-triggers'] to ('skip-triggers') 
Line 1715 ['no-create-info'] to ('no-create-info')

The export now is working!
[23 Jan 2015 20:13] Erick Brenes
Mac path = / Applications / MySQLWorkbench.app / Contents / Resources / plugins / wb_admin_export.py
[25 Jan 2015 6:04] MySQL Verification Team
Bug #75618 marked as duplicate of this
[30 Jan 2015 12:27] Cleber Dias
Same bug here. I also changed the lines:

Line 1712 ['skip-triggers'] to ('skip-triggers') 
Line 1715 ['no-create-info'] to ('no-create-info')

And it worked for me too.
[30 Jan 2015 16:21] Bobes Calin
I guess it`s working only for export, but when i try to import that i just exported it give`s me an error
[30 Jan 2015 16:40] Cord Slatton-Valle
regarding import: They changed the interface somewhat and now you have to click the checkbox for "include create schema" where you did not have to select that before...at least for me this fixes the problems I get trying to import.
[1 Feb 2015 6:21] MySQL Verification Team
Bug #75711 marked as duplicate of this
[4 Feb 2015 2:41] Philip Olson
Posted by developer:
 
Fixed as of the upcoming MySQL Workbench 6.2.5 release, and here's the changelog entry:

Executing "Data Export" against multiple databases with the "Export to
Dump Project Folder" option enabled would fail and generate an unhandled
exception; "Error Unhandled exception: 'builtin_function_or_method' object
has no attribute '__getitem__'". 

As a workaround, an export with the "Export to self-contained file" 
option functioned properly.

Thank you for the bug report.
[11 Feb 2015 10:52] MySQL Verification Team
http://bugs.mysql.com/bug.php?id=75857 marked as duplicate of this one.
[23 Feb 2015 11:33] MySQL Verification Team
Bug #76005 marked as duplicate of this
[27 Feb 2015 23:37] Walter Gabrielsen III
I can't edit the file that needs to be changed on Windows 8. It says the file is in use.
[28 Feb 2015 20:01] Lee Eden
quick and dirty solution in linux (Mint 17.1), in synaptic completely remove package mysql-workbench-community and then install package mysql-workbench
[2 Mar 2015 23:04] MySQL Verification Team
http://bugs.mysql.com/bug.php?id=76108 marked as duplicate of this one.
[6 Mar 2015 7:23] MySQL Verification Team
Bug #76183 marked as duplicate of this
[22 Mar 2015 8:37] MySQL Verification Team
Bug #76427 marked as duplicate of this
[24 Mar 2015 10:50] Simon Dibble
In windows remember that you need to run your text editor as administrator or you will get an error saying that the file is in use.
[27 Mar 2015 9:18] Shirley ConcepciĆ³n
I also changed the lines:

Line 1712 ['skip-triggers'] to ('skip-triggers') 
Line 1715 ['no-create-info'] to ('no-create-info')

And it worked for me too.
[15 Mar 2016 8:00] Frano Sasvari
Screenshot of export error

Attachment: mysql_workbench_export_error.jpg (image/jpeg, text), 106.52 KiB.

[15 Mar 2016 8:04] Frano Sasvari
I'm using Windows 8 with MySQL Workbench 6.3.6 version installed. Everything works fine - server info, select, import, alter table; except "Data Export" option. When I click on "Data Export" button on the left navigation it popup alert error with following message: "An unhandled exception occurred (global name 'self' is not defined). Please refer to the log files for details."