Bug #57758 cannot start SSH tunnel manager
Submitted: 27 Oct 2010 2:48 Modified: 19 Mar 2015 7:35
Reporter: Xiangfei Jia Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Workbench Severity:S1 (Critical)
Version:5.2.29 OS:MacOS (10.6.4)
Assigned to: CPU Architecture:Any
Tags: Mac OS, MySQL Workbench, ssh tunnel manager

[27 Oct 2010 2:48] Xiangfei Jia
Description:
 start to having problem using workbench, it always saying "cannot start SSH tunnel manager". Because of the error, I can't ssh to my remove servers. 

I'm using Mac OS Leopard, and latest 5.2.29 32-bit Workbench. It seems only 32-bit is available for download on Mac OS.

I found the problem is caused by switch to use macport's python instead of the default python provided by the system. The problem disappears as soon as I switch back to default python. 

I inspected both version of python, they are all 64 bit. I can't see any difference between these two versions. 

Below is the error message. It complains the incompatibility between python lib and Workbench. However, not sure how to fix the problem. Need some help! 

I also tried to import these required libs from inside python, they all succeeded, no error.

Thanks!
Fei

Traceback (most recent call last): 
File "/Applications/MySQLWorkbench.app/Contents/PlugIns/wb_admin_grt.py", line 21, in <module> 
import tempfile 
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/tempfile.py", line 33, in <module> 
from random import Random as _Random 
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/random.py", line 43, in <module> 
from math import log as _log, exp as _exp, pi as _pi, e as _e, ceil as _ceil 
ImportError: dlopen(/opt/local/lib/python2.5/lib-dynload/math.so, 2): no suitable image found. Did find: 
/opt/local/lib/python2.5/lib-dynload/math.so: mach-o, but wrong architecture 
** Message: Failed loading module '/Applications/MySQLWorkbench.app/Contents/PlugIns/wb_admin_grt.py' (python) 
Traceback (most recent call last): 
File "/Applications/MySQLWorkbench.app/Contents/PlugIns/wb_doclib_grt.py", line 27, in <module> 
import socket 
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/socket.py", line 45, in <module> 
import _socket 
ImportError: dlopen(/opt/local/lib/python2.5/lib-dynload/_socket.so, 2): no suitable image found. Did find: 
/opt/local/lib/python2.5/lib-dynload/_socket.so: mach-o, but wrong architecture 
** Message: Failed loading module '/Applications/MySQLWorkbench.app/Contents/PlugIns/wb_doclib_grt.py' (python) 
Traceback (most recent call last): 
File "/Applications/MySQLWorkbench.app/Contents/Resources/sshtunnel.py", line 5, in <module> 
from random import randint 
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/random.py", line 43, in <module> 
from math import log as _log, exp as _exp, pi as _pi, e as _e, ceil as _ceil 
ImportError: dlopen(/opt/local/lib/python2.5/lib-dynload/math.so, 2): no suitable image found. Did find: 
/opt/local/lib/python2.5/lib-dynload/math.so: mach-o, but wrong architecture 

** (process:1920): WARNING **: Tunnel manager could not be executed 

** (process:1920): WARNING **: Error starting tunnel manager: Cannot start SSH tunnel manager

How to repeat:
#use python_select (provided by macport)
> python_select -l
current none python24 python25 python26 python26-apple
> sudo python_select python26

#then start MySQL Workbench from command line

Suggested fix:
Maybe a 64-bit version of Workbench can solve the problem.
[27 Oct 2010 3:19] Xiangfei Jia
I found out the problem. The system default python has support of multiple architectures, while the python supplied(compiled) with macport only support x86_64 on Leopard.

We do need a x86_64 version of MySQL Workbench!!!

Fei

Here is an example of _socket.so shared library.

# system default python
> file /System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/lib-dynload/_socket.so
_socket.so: Mach-O universal binary with 3 architectures
_socket.so (for architecture x86_64):   Mach-O 64-bit bundle x86_64
_socket.so (for architecture i386):     Mach-O bundle i386
_socket.so (for architecture ppc7400):  Mach-O bundle ppc

# macport's python
> file /opt/local/lib/python2.5/lib-dynload/_socket.so
/opt/local/lib/python2.5/lib-dynload/_socket.so: Mach-O 64-bit bundle x86_64
[27 Oct 2010 6:43] Xiangfei Jia
The error message is really miss leading. A detection should be performed first. If there is a incompatibility between Workbench and the underlying python lib, a proper warning message should be display.
[28 Oct 2010 16:24] Johannes Taxacher
Thanks for the thorough investigation, unfortunately we cannot provide a 64bit build of Workbench so we will aim for proper detection of used python-env
[19 Mar 2015 7:35] Philip Olson
Posted by developer:
 
Fixed as of the upcoming MySQL Workbench 6.3.3 release, and here's the changelog entry:

On OS X, SSH tunneling would sometimes fail start.

Thank you for the bug report.