Bug #72309 Mysql Work Bench error loading Server logs
Submitted: 10 Apr 2014 18:21 Modified: 8 Oct 2014 14:53
Reporter: gu si Email Updates:
Status: No Feedback Impact on me:
None 
Category:MySQL Workbench: Administration Severity:S2 (Serious)
Version:6.1.4 OS:Linux
Assigned to: CPU Architecture:Any

[10 Apr 2014 18:21] gu si
Description:
I get the following error on Mysql Workbench while opening server logs . I get unhandled exception error .

11:18:30 [INF][               ]: unhandled sidebar action admin_server_logs
11:18:30 [INF][wb_log_reader.py:__init__:301]: Will use sudo and dd to get contents of log file /mysql/ghldev/glogs/ghldev.err
11:18:40 [ERR][wb_admin_ssh.py:exec_cmd:739]: Exception in SSH: 
11:18:40 [ERR][wb_admin_main.py:tab_changed:202]: Unhandled exception in Admin for <wb_admin_logs.WbAdminLogs; proxy of <Swig Object of type 'mforms::Box *' at 0x17A0CA28> >: Traceback (most recent call last):
  File "C:\Program Files (x86)\MySQL\MySQL Workbench 6.1 CE\modules\wb_admin_main.py", line 199, in tab_changed
    panel.page_activated()
  File "C:\Program Files (x86)\MySQL\MySQL Workbench 6.1 CE\modules\wb_admin_logs.py", line 640, in page_activated
    self.update_ui()
  File "C:\Program Files (x86)\MySQL\MySQL Workbench 6.1 CE\modules\wb_admin_logs.py", line 597, in update_ui
    self._add_tabs('error_file_tab')
  File "C:\Program Files (x86)\MySQL\MySQL Workbench 6.1 CE\modules\wb_admin_logs.py", line 563, in _add_tabs
    self.error_file_log_tab = LogView(self, ErrorLogFileReader, self.ctrl_be, self.server_profile.error_log_file_path)
  File "C:\Program Files (x86)\MySQL\MySQL Workbench 6.1 CE\modules\wb_admin_logs.py", line 207, in __init__
    self.update_ui()
  File "C:\Program Files (x86)\MySQL\MySQL Workbench 6.1 CE\modules\wb_admin_logs.py", line 248, in update_ui
    self.log_reader = self.BackendLogReaderClass(*self.args)
  File "C:\Program Files (x86)\MySQL\MySQL Workbench 6.1 CE\modules\wb_log_reader.py", line 489, in __init__
    super(ErrorLogFileReader, self).__init__(ctrl_be, file_name, pat, chunk_size, truncate_long_lines, append_gaps=False)
  File "C:\Program Files (x86)\MySQL\MySQL Workbench 6.1 CE\modules\wb_log_reader.py", line 305, in __init__
    self.file_size = self.log_file.size
  File "C:\Program Files (x86)\MySQL\MySQL Workbench 6.1 CE\modules\wb_server_management.py", line 1927, in size
    files = self.server_helper.listdir(self.path, as_user = Users.ADMIN, user_password=self._password, include_size=True)
  File "C:\Program Files (x86)\MySQL\MySQL Workbench 6.1 CE\modules\wb_server_management.py", line 1811, in listdir
    return self.file.listdir(path, as_user, user_password, include_size=include_size)
  File "C:\Program Files (x86)\MySQL\MySQL Workbench 6.1 CE\modules\wb_server_management.py", line 982, in listdir
    self.raise_exception(output, custom_messages)
  File "C:\Program Files (x86)\MySQL\MySQL Workbench 6.1 CE\modules\wb_server_management.py", line 1435, in raise_exception
    raise Exception(custom_messages.get(None, message))
Exception

11:18:40 [INF][               ]: unhandled sidebar action admin_server_logs
11:18:40 [INF][wb_log_reader.py:__init__:301]: Will use sudo and dd to get contents of log file /mysql/ghldev/glogs/ghldev.err
11:18:40 [ERR][wb_admin_ssh.py:exec_cmd:717]: exec_cmd : 
11:18:51 [ERR][wb_admin_ssh.py:exec_cmd:739]: Exception in SSH: 
11:18:51 [ERR][wb_admin_main.py:tab_changed:202]: Unhandled exception in Admin for <wb_admin_logs.WbAdminLogs; proxy of <Swig Object of type 'mforms::Box *' at 0x17A0CA28> >: Traceback (most recent call last):
  File "C:\Program Files (x86)\MySQL\MySQL Workbench 6.1 CE\modules\wb_admin_main.py", line 199, in tab_changed
    panel.page_activated()
  File "C:\Program Files (x86)\MySQL\MySQL Workbench 6.1 CE\modules\wb_admin_logs.py", line 640, in page_activated
    self.update_ui()
  File "C:\Program Files (x86)\MySQL\MySQL Workbench 6.1 CE\modules\wb_admin_logs.py", line 597, in update_ui
    self._add_tabs('error_file_tab')
  File "C:\Program Files (x86)\MySQL\MySQL Workbench 6.1 CE\modules\wb_admin_logs.py", line 563, in _add_tabs
    self.error_file_log_tab = LogView(self, ErrorLogFileReader, self.ctrl_be, self.server_profile.error_log_file_path)
  File "C:\Program Files (x86)\MySQL\MySQL Workbench 6.1 CE\modules\wb_admin_logs.py", line 207, in __init__
    self.update_ui()
  File "C:\Program Files (x86)\MySQL\MySQL Workbench 6.1 CE\modules\wb_admin_logs.py", line 248, in update_ui
    self.log_reader = self.BackendLogReaderClass(*self.args)
  File "C:\Program Files (x86)\MySQL\MySQL Workbench 6.1 CE\modules\wb_log_reader.py", line 489, in __init__
    super(ErrorLogFileReader, self).__init__(ctrl_be, file_name, pat, chunk_size, truncate_long_lines, append_gaps=False)
  File "C:\Program Files (x86)\MySQL\MySQL Workbench 6.1 CE\modules\wb_log_reader.py", line 305, in __init__
    self.file_size = self.log_file.size
  File "C:\Program Files (x86)\MySQL\MySQL Workbench 6.1 CE\modules\wb_server_management.py", line 1927, in size
    files = self.server_helper.listdir(self.path, as_user = Users.ADMIN, user_password=self._password, include_size=True)
  File "C:\Program Files (x86)\MySQL\MySQL Workbench 6.1 CE\modules\wb_server_management.py", line 1811, in listdir
    return self.file.listdir(path, as_user, user_password, include_size=include_size)
  File "C:\Program Files (x86)\MySQL\MySQL Workbench 6.1 CE\modules\wb_server_management.py", line 982, in listdir
    self.raise_exception(output, custom_messages)
  File "C:\Program Files (x86)\MySQL\MySQL Workbench 6.1 CE\modules\wb_server_management.py", line 1435, in raise_exception
    raise Exception(custom_messages.get(None, message))
Exception

11:18:56 [INF][wb_log_reader.py:__init__:301]: Will use sudo and dd to get contents of log file /mysql/ghldev/glogs/ghldev.err
11:18:56 [ERR][wb_admin_ssh.py:exec_cmd:717]: exec_cmd : 
11:19:06 [ERR][wb_admin_ssh.py:exec_cmd:739]: Exception in SSH: 
11:19:06 [ERR][wb_admin_main.py:tab_changed:202]: Unhandled exception in Admin for <wb_admin_logs.WbAdminLogs; proxy of <Swig Object of type 'mforms::Box *' at 0x17A0CA28> >: Traceback (most recent call last):
  File "C:\Program Files (x86)\MySQL\MySQL Workbench 6.1 CE\modules\wb_admin_main.py", line 199, in tab_changed
    panel.page_activated()
  File "C:\Program Files (x86)\MySQL\MySQL Workbench 6.1 CE\modules\wb_admin_logs.py", line 640, in page_activated
    self.update_ui()
  File "C:\Program Files (x86)\MySQL\MySQL Workbench 6.1 CE\modules\wb_admin_logs.py", line 597, in update_ui
    self._add_tabs('error_file_tab')
  File "C:\Program Files (x86)\MySQL\MySQL Workbench 6.1 CE\modules\wb_admin_logs.py", line 563, in _add_tabs
    self.error_file_log_tab = LogView(self, ErrorLogFileReader, self.ctrl_be, self.server_profile.error_log_file_path)
  File "C:\Program Files (x86)\MySQL\MySQL Workbench 6.1 CE\modules\wb_admin_logs.py", line 207, in __init__
    self.update_ui()
  File "C:\Program Files (x86)\MySQL\MySQL Workbench 6.1 CE\modules\wb_admin_logs.py", line 248, in update_ui
    self.log_reader = self.BackendLogReaderClass(*self.args)
  File "C:\Program Files (x86)\MySQL\MySQL Workbench 6.1 CE\modules\wb_log_reader.py", line 489, in __init__
    super(ErrorLogFileReader, self).__init__(ctrl_be, file_name, pat, chunk_size, truncate_long_lines, append_gaps=False)
  File "C:\Program Files (x86)\MySQL\MySQL Workbench 6.1 CE\modules\wb_log_reader.py", line 305, in __init__
    self.file_size = self.log_file.size
  File "C:\Program Files (x86)\MySQL\MySQL Workbench 6.1 CE\modules\wb_server_management.py", line 1927, in size
    files = self.server_helper.listdir(self.path, as_user = Users.ADMIN, user_password=self._password, include_size=True)
  File "C:\Program Files (x86)\MySQL\MySQL Workbench 6.1 CE\modules\wb_server_management.py", line 1811, in listdir
    return self.file.listdir(path, as_user, user_password, include_size=include_size)
  File "C:\Program Files (x86)\MySQL\MySQL Workbench 6.1 CE\modules\wb_server_management.py", line 982, in listdir
    self.raise_exception(output, custom_messages)
  File "C:\Program Files (x86)\MySQL\MySQL Workbench 6.1 CE\modules\wb_server_management.py", line 1435, in raise_exception
    raise Exception(custom_messages.get(None, message))
Exception

11:19:07 [ERR][wb_admin_ssh.py:exec_cmd:717]: exec_cmd : 
11:19:10 [ERR][wb_admin_ssh.py:exec_cmd:717]: exec_cmd : 

How to repeat:
1) open server logs in MySQL Work Bench 6.1.4
[25 Apr 2014 18:41] Alfredo Kojima
Please start workbench with --log-level=debug3 and paste the relevant wb.log parts
[25 Apr 2014 19:21] gu si
Workbench error log

Attachment: workbench error log.txt (text/plain), 16.07 KiB.

[25 Apr 2014 19:23] gu si
work bench error log

Attachment: wb.log (application/octet-stream, text), 19.16 KiB.

[21 Aug 2014 21:23] Alfredo Kojima
Please try the following patch:

Find and open wb_admin_ssh.py in a text editor

Locate the following lines:
            # Reads from the stdout if available
            if chan.recv_ready():
                data = stdout.read(read_size)

            # Reads from the stderr if available
            if chan.recv_stderr_ready():
                error = stderr.read(read_size)

Replace them with the following:

            # Reads from the stdout if available
            while chan.recv_ready() and len(data) < read_size:
                data += stdout.read(1)

            # Reads from the stderr if available
            while chan.recv_stderr_ready() and len(error) < read_size:
                error += stderr.read(1)

Save and retry.
[8 Sep 2014 14:53] MySQL Verification Team
Please try version Development Releases 6.2.2 rc. Thanks.
[9 Oct 2014 1: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".