Bug #112978 Unable to connect to SQLServer from Workbench Migration
Submitted: 6 Nov 2023 18:53 Modified: 1 Apr 13:24
Reporter: Annie Abraham Email Updates:
Status: No Feedback Impact on me:
None 
Category:MySQL Workbench: Migration Severity:S2 (Serious)
Version:8.0.29 OS:Red Hat (Operating System: Red Hat Enterprise Linux 8.8)
Assigned to: MySQL Verification Team CPU Architecture:x86

[6 Nov 2023 18:53] Annie Abraham
Description:
I am not able to connect to a remote MSSQL server from a Redhat VM. I connect to the VM via a vnc viewer called Remina, and launch mysql-workbench. I have tried 
both ODBC(FreeTDS) and ODBC Data Source(FreeTDS) connection methods.

ODBC(FreeTDS) gives error -  "NotConnectedError("No open connection to %s" % connection_object.hostIdentifier)

ODBC Data Source(FreeTDS) -- Connects but gives error below when it tries to execute "execute SELECT CAST(SERVERPROPERTY('ProductVersion') AS VARCHAR) () {}":

NameError: ('420', '[420] 0\x000\x00\x00\x00e\x00e\x00T\x00D\x00S\x00]\x00[\x00S\x00Q\x00L\x00 \x00S\x00e\x00r\x00v\x00e\x00r\x00]\x00I\x00n\x00c\x00o\x00r\x00 (102) (SQLExecDirectW)')

After ODBC Data Source(FreeTDS) connection fails, if I try ODBC(FreeTDS) connection again, it gives the same error as the ODBC Data Source(FreeTDS) (that is, it does not give the NotConnectedError like it does the very first time)

Below is the ouptput from 3 times I tried to connect. First ODBC(FreeTDS), then  ODBC Data Source(FreeTDS), then again ODBC(FreeTDS):

[WRN][         mforms]: Resource file not found: migration_check_open_win.png
13:09:15 [WRN][         mforms]: Resource file not found: migration_check_open_win.png
13:09:15 [WRN][         mforms]: Resource file not found: migration_check_open_win.png
13:09:16 [WRN][         mforms]: Resource file not found: migration_check_open_win.png
13:09:18 [WRN][         mforms]: Resource file not found: migration_check_current_win.png
13:09:47 [INF][            grt]: Connecting to Mssql@DRIVER=freetds;SERVER=40.75.119.172;PORT=1433...
13:09:47 [INF][            grt]: Opening ODBC connection to DRIVER={freetds};SERVER=40.75.119.172;PORT=1433;DATABASE=;UID=AAbraham;PWD=XXXX;TDS_VERSION=7.4;DriverUnicodeType=UTF16...
13:09:47 [ERR][            grt]: Connection failed      No open connection to Mssql@DRIVER=freetds;SERVER=40.75.119.172;PORT=1433
13:09:47 [ERR][         python]: error calling DbMssqlRE.connect
Traceback:
  File "/usr/lib64/mysql-workbench/modules/db_mssql_grt.py", line 121, in connect
            con = get_connection(connection)
  File "/usr/lib64/mysql-workbench/modules/db_mssql_grt.py", line 52, in get_connection
            raise NotConnectedError("No open connection to %s" % connection_object.hostIdentifier)
NameError: No open connection to Mssql@DRIVER=freetds;SERVER=40.75.119.172;PORT=1433
13:09:47 [DB1][ mforms backend]: Looking up password for 'AAbraham'@'Mssql@DRIVER=freetds;SERVER=40.75.119.172;PORT=1433' has failed
13:09:47 [DB1][ mforms backend]: Creating and showing password dialog
13:09:59 [INF][            grt]: Connecting to Mssql@DRIVER=freetds;SERVER=40.75.119.172;PORT=1433...
13:09:59 [INF][            grt]: Opening ODBC connection to DRIVER={freetds};SERVER=40.75.119.172;PORT=1433;DATABASE=;UID=AAbraham;PWD=XXXX;TDS_VERSION=7.4;DriverUnicodeType=UTF16...
13:09:59 [ERR][            grt]: Connection failed      No open connection to Mssql@DRIVER=freetds;SERVER=40.75.119.172;PORT=1433
13:09:59 [ERR][         python]: error calling DbMssqlRE.connect
Traceback:
  File "/usr/lib64/mysql-workbench/modules/db_mssql_grt.py", line 121, in connect
            con = get_connection(connection)
  File "/usr/lib64/mysql-workbench/modules/db_mssql_grt.py", line 52, in get_connection
            raise NotConnectedError("No open connection to %s" % connection_object.hostIdentifier)
NameError: No open connection to Mssql@DRIVER=freetds;SERVER=40.75.119.172;PORT=1433

13:12:31 [DB1][ mforms backend]: Looking up password for 'AAbraham'@'Mssql@mssqldsn' has failed
13:12:31 [DB1][ mforms backend]: Creating and showing password dialog
13:12:53 [INF][            grt]: Connection to Mssql@mssqldsn apparently lost, reconnecting...
13:12:53 [INF][            grt]: Connecting to Mssql@mssqldsn...
13:12:53 [INF][            grt]: Opening ODBC connection to DSN=mssqldsn;DATABASE=;UID=AAbraham;TDS_VERSION=7.2;PWD=XXXX...
13:12:53 [INF][            grt]: Connected to Mssql@mssqldsn, 
13:12:53 [DB3][       db.mssql]: execute SELECT CAST(SERVERPROPERTY('ProductVersion') AS VARCHAR) () {}
13:12:53 [ERR][         python]: error calling DbMssqlRE.connect
Traceback:
  File "/usr/lib64/mysql-workbench/modules/db_mssql_grt.py", line 158, in connect
            _connections[connection.__id__]["version"] = getServerVersion(connection)
  File "/usr/lib64/mysql-workbench/modules/db_mssql_grt.py", line 184, in getServerVersion
        ver_string = execute_query(connection, "SELECT CAST(SERVERPROPERTY('ProductVersion') AS VARCHAR)").fetchone()[0]
  File "/usr/lib64/mysql-workbench/modules/db_mssql_grt.py", line 66, in execute_query
        return get_connection(connection_object).cursor().execute(query, *args, **kwargs)
NameError: ('420', '[420] 0\x000\x00\x00\x00e\x00e\x00T\x00D\x00S\x00]\x00[\x00S\x00Q\x00L\x00 \x00S\x00e\x00r\x00v\x00e\x00r\x00]\x00I\x00n\x00c\x00o\x00r\x00 (102) (SQLExecDirectW)')

13:18:03 [DB1][ mforms backend]: Looking up password for 'AAbraham'@'Mssql@DRIVER=freetds;SERVER=40.75.119.172;PORT=1433' has failed
13:18:03 [DB1][ mforms backend]: Creating and showing password dialog
13:18:16 [INF][            grt]: Connection to Mssql@DRIVER=freetds;SERVER=40.75.119.172;PORT=1433 apparently lost, reconnecting...
13:18:16 [INF][            grt]: Connecting to Mssql@DRIVER=freetds;SERVER=40.75.119.172;PORT=1433...
13:18:16 [INF][            grt]: Opening ODBC connection to DRIVER={freetds};SERVER=40.75.119.172;PORT=1433;DATABASE=;UID=AAbraham;PWD=XXXX;TDS_VERSION=7.4;DriverUnicodeType=UTF16...
13:18:16 [INF][            grt]: Connected to Mssql@DRIVER=freetds;SERVER=40.75.119.172;PORT=1433, 
13:18:16 [DB3][       db.mssql]: execute SELECT CAST(SERVERPROPERTY('ProductVersion') AS VARCHAR) () {}
13:18:16 [ERR][         python]: error calling DbMssqlRE.connect
Traceback:
  File "/usr/lib64/mysql-workbench/modules/db_mssql_grt.py", line 158, in connect
            _connections[connection.__id__]["version"] = getServerVersion(connection)
  File "/usr/lib64/mysql-workbench/modules/db_mssql_grt.py", line 184, in getServerVersion
        ver_string = execute_query(connection, "SELECT CAST(SERVERPROPERTY('ProductVersion') AS VARCHAR)").fetchone()[0]
  File "/usr/lib64/mysql-workbench/modules/db_mssql_grt.py", line 66, in execute_query
        return get_connection(connection_object).cursor().execute(query, 

How to repeat:
To repeat launch WB, then "Start Migration", enter Source RDBMS Connection parameters, and click "Test Connection"
[16 Nov 2023 20:41] Annie Abraham
We are waiting on this. Any help is much appreciated
[1 Mar 13:24] MySQL Verification Team
Hello Annie Abraham,

Thank you for the bug report.
Please upgrade to latest version and report us back if issue persist even in latest version along with test case and log file. Thank you.

Regards,
Ashwini Patil
[2 Apr 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".