Bug #49525 WbAdmin.openSecurityManager: unhandled exception (type std::exception)
Submitted: 8 Dec 2009 6:31 Modified: 12 Mar 2010 23:26
Reporter: Carl Karsten (Silver Quality Contributor) Email Updates:
Status: No Feedback Impact on me:
None 
Category:MySQL Workbench: Administration Severity:S2 (Serious)
Version:5.2.10 beta OS:Linux
Assigned to: CPU Architecture:Any
Tags: qc

[8 Dec 2009 6:31] Carl Karsten
Description:
carl@gw42:~$ mysql-workbench
** Message: Trying to load module '/usr/lib/mysql-workbench/modules/wb_utils_grt.py' (python)
** Message: Trying to load module '/usr/lib/mysql-workbench/modules/wb_admin_grt.py' (python)
** Message: Trying to load module '/usr/lib/mysql-workbench/modules/db.mysql.query.grt.so' (cpp)
** Message: Trying to load module '/usr/lib/mysql-workbench/modules/catalog_utils.grt.lua' (lua)
** Message: Initialized Lua module /usr/lib/mysql-workbench/modules/catalog_utils.grt.lua (WbUtils)
** Message: Trying to load module '/usr/lib/mysql-workbench/modules/db.mysql.sqlide.grt.so' (cpp)
** Message: Trying to load module '/usr/lib/mysql-workbench/modules/forms.grt.so' (cpp)
** Message: Trying to load module '/usr/lib/mysql-workbench/modules/dbutils.grt.so' (cpp)
** Message: Trying to load module '/usr/lib/mysql-workbench/modules/wb.mysql.validation.grt.so' (cpp)
** Message: WARNING: Could not get pointer to grt_module_init in module /usr/lib/mysql-workbench/modules/wb.mysql.validation.grt.so (`grt_module_init': /usr/lib/mysql-workbench/modules/wb.mysql.validation.grt.so: undefined symbol: grt_module_init)    
** Message: WARNING: Could not load wb.mysql.validation.grt.so: Invalid module /usr/lib/mysql-workbench/modules/wb.mysql.validation.grt.so    
** Message: Trying to load module '/usr/lib/mysql-workbench/modules/wb.mysql.import.grt.so' (cpp)
** Message: Trying to load module '/usr/lib/mysql-workbench/modules/db.mysql.sqlparser.grt.so' (cpp)
** Message: Trying to load module '/usr/lib/mysql-workbench/modules/db.mysql.grt.so' (cpp)
** Message: Trying to load module '/usr/lib/mysql-workbench/modules/wb.model.grt.so' (cpp)
** Message: Trying to load module '/usr/lib/mysql-workbench/modules/tools.grt.lua' (lua)
** Message: Initialized Lua module /usr/lib/mysql-workbench/modules/tools.grt.lua (WbTools)
** Message: Trying to load module '/usr/lib/mysql-workbench/modules/table_utils.grt.lua' (lua)
** Message: Initialized Lua module /usr/lib/mysql-workbench/modules/table_utils.grt.lua (WbTableUtils)
** Message: Trying to load module '/usr/lib/mysql-workbench/modules/wb.validation.grt.so' (cpp)
** Message: WARNING: Could not get pointer to grt_module_init in module /usr/lib/mysql-workbench/modules/wb.validation.grt.so (`grt_module_init': /usr/lib/mysql-workbench/modules/wb.validation.grt.so: undefined symbol: grt_module_init)    
** Message: WARNING: Could not load wb.validation.grt.so: Invalid module /usr/lib/mysql-workbench/modules/wb.validation.grt.so    
** Message: Trying to load module '/usr/lib/mysql-workbench/plugins/db.mysql.diff.reporting.wbp.so' (cpp)
** Message: WARNING: Could not open module /usr/lib/mysql-workbench/plugins/db.mysql.diff.reporting.wbp.so (/usr/lib/mysql-workbench/plugins/db.mysql.diff.reporting.wbp.so: undefined symbol: _ZTV9Wb_plugin)    
** Message: WARNING: Could not load db.mysql.diff.reporting.wbp.so: Cannot open /usr/lib/mysql-workbench/plugins/db.mysql.diff.reporting.wbp.so    
** Message: Trying to load module '/usr/lib/mysql-workbench/plugins/db.checks.wbp.so' (cpp)
** Message: Trying to load module '/usr/lib/mysql-workbench/plugins/db.mysql.editors.wbp.so' (cpp)
** Message: Trying to load module '/usr/lib/mysql-workbench/plugins/wb.model.editors.wbp.so' (cpp)
** Message: Trying to load module '/usr/lib/mysql-workbench/plugins/db.mysql.wbp.so' (cpp)
** Message: Trying to load module '/usr/lib/mysql-workbench/plugins/wb.printing.wbp.so' (cpp)

** (mysql-workbench-bin:6134): WARNING **: Plugin 'wb.tools.quickTables' from module WbTools has invalid type ''

** (mysql-workbench-bin:6134): WARNING **: /home/carl/.mysql/workbench/wb_options.xml:329: link 'dc2e4f66-e3c1-11de-ac2d-001ee5d73428' <object GrtObject> key=owner could not be resolved
_view_impl has NULL ptr at 15
_app_impl has NULL ptr at 5
Exception in thread Thread-1:
Traceback (most recent call last):
  File "/usr/lib/python2.6/threading.py", line 525, in __bootstrap_inner
    self.run()
  File "/usr/lib/python2.6/threading.py", line 477, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/usr/lib/mysql-workbench/modules/wba_monitor_be.py", line 491, in poll_sources
    cmd.poll()
  File "/usr/lib/mysql-workbench/modules/wba_monitor_be.py", line 40, in poll
    result = self.ctrl_be.execute(script = self.cmds, sudo = False, password = None)
  File "/usr/lib/mysql-workbench/modules/wb_admin_control_be.py", line 567, in execute
    result = self.ssh.run_cmd(self.wrap_command(script, sudo), sudo, password)
AttributeError: 'NoneType' object has no attribute 'run_cmd'

** Message: function call error
Traceback (most recent call last):
  File "/usr/lib/mysql-workbench/modules/wb_admin_grt.py", line 197, in openSecurityManager
    tab = do_open_administrator(server)
  File "/usr/lib/mysql-workbench/modules/wb_admin_grt.py", line 109, in do_open_administrator
    adminTab = AdministratorTab(server_instance)
  File "/usr/lib/mysql-workbench/modules/wb_admin_grt.py", line 75, in __init__
    self.monitor = wb_admin_monitor.WbAdminMonitor(server_instance_settings, self.ctrl_be)
  File "/usr/lib/mysql-workbench/modules/wb_admin_monitor.py", line 106, in __init__
    mem = self.mon_be.run('get_mem_total').strip(" \r\t\n.,:;")
  File "/usr/lib/mysql-workbench/modules/wba_monitor_be.py", line 478, in run
    result = self.ctrl_be.execute(self.commands[name], sudo = False, password = None)
  File "/usr/lib/mysql-workbench/modules/wb_admin_control_be.py", line 567, in execute
    result = self.ssh.run_cmd(self.wrap_command(script, sudo), sudo, password)
AttributeError: 'NoneType' object has no attribute 'run_cmd'

glibmm-ERROR **: 
unhandled exception (type std::exception) in signal handler:
what: error calling WbAdmin.openSecurityManager: see output for details

aborting...
Aborted

How to repeat:
0. apt-get install mysql-server on a box on my lan. (ubuntu, nothing special here)
1. add connection to the mysql server - name: lappy.
2.0 click "manage server instances" 
2.1 change connection to lappy
2.2 change "instance name" to "lappy db"
2.3 hit close
3.0 click "Server administration" 
3.1 pick "lappy db" 
3.2 click "OK"

see above crash.
[8 Dec 2009 9:22] Johannes Taxacher
hi carl,

what ubuntu are you working on and what 5.2 beta.
[8 Dec 2009 15:50] Carl Karsten
mysql-workbench-oss-5.2.10-1ubu904-amd64.deb

Ubuntu 9.10 karmic

Python 2.6.4 (r264:75706, Nov  2 2009, 14:44:17)
[8 Dec 2009 16:40] MySQL Verification Team
I couldn't repeat on Ubuntu 9.10 X86_64.
[8 Dec 2009 17:25] Carl Karsten
I see the problem: it is using "hostname" to determine if ssh is being used, but hostname can be set even if "enable ssh login based administration" is not.  lines from my ~/.mysql/workbench/server_instances.xml:

        <value type="string" key="ssh.hostName">dhcp216</value>
        <value type="int" key="remoteAdmin">0</value>

This causes .is_local_server() to return true, which causes this to else:

      if self.is_local_server():
        result = run_cmd(script, sudo, password)
      else:
567:       result = self.ssh.run_cmd(self.wrap_command(script, sudo), sudo, password)

    def is_local_server(self):
        if self.is_local is None:
          host = self.settings.loginInfo['ssh.hostName'].strip(" \n\r\t")
          print host
          self.is_local = host == "localhost" or host == "" or host == "127.0.0.1" or host == "0"
        return self.is_local

I added print host to confirm, and it does indeed print 'dhcp216'.
I have no idea how hostname got set.  it is the hostname of the server I am connecting to.

I am assuming you can't repo because hostname is blank. if so,  check "enable ssh login based administration", fill in a hostname, uncheck "enable ssh...", close and 
3.0 click "Server administration"
3.1 pick "lappy db"
3.2 click "OK"
[10 Dec 2009 14:00] Susanne Ebrecht
I am not able to follow you here.

Please, can you give a step by step description what is necessary to do to repeat this.
[10 Dec 2009 16:01] Susanne Ebrecht
I wasn't able to repeat the crash but taking the computer name here and remote connection instead of localhost will occur some mad stuff.

In my personal eyes this is not a bug at all because when you create a new server instance then the first window that opens is asking if you want to connect remote or local. If you click localhost here, you won't get asked again for a hostname.

Anyway, after long discussion with our development here, they said they want to do some magic here that the crash won't happen in future.
[18 Jan 2010 21:04] C F
* bump *
I can verify this still occurs on 5.2.11 Rev 4842 on Win5.1 (XP)
[11 Feb 2010 18:20] Alfredo Kojima
Please try again with latest version to see if this issue is still present.
[19 Feb 2010 16:45] Joakim Lundborg
I still have this problem on 5.2.16
[13 Mar 2010 0:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
[20 May 2010 18:06] Dinesh Kotian
I am using workbench 5.2.21 OSS.   I am getting the same error