Bug #69713 ERROR: Determine number of rows to copy: unsupported operand type(s) for +: 'Non
Submitted: 10 Jul 2013 15:57 Modified: 28 Jul 2013 2:00
Reporter: Steven Combs Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Workbench: Migration Severity:S3 (Non-critical)
Version:5.2.47 CE OS:Windows
Assigned to: CPU Architecture:Any

[10 Jul 2013 15:57] Steven Combs
Description:
Trying to perform a Migration from SQL Server 2012 to MySQL 5.5.16. I get all the way to the end before it does the actual data copy and I get this error.

Starting...

Prepare information for data copy...

Prepare information for data copy done

Determine number of rows to copy....

Counting number of rows in tables...

wbcopytables.exe --count-only --passwords-from-stdin --odbc-source=Dsn=MyDB --table-file=e:\users\steven\appdata\local\temp\tmpdlyxg2

ERROR: Determine number of rows to copy: unsupported operand type(s) for +: 'NoneType' and 'str'

Failed

How to repeat:
Follow steps through Migration, till Bulk Data Transfer. 

Need a SQL Server setup and MySQL

Suggested fix:
Not sure
[10 Jul 2013 21:02] Sergio Andres De La Cruz Rodriguez
Hi Steven:

Can you try reproducing this issue and pasting here what gets printed in the Output Window (View --> Output in Workbench's main menu)?

Thanks for helping us to improve MySQL Workbench.
[10 Jul 2013 22:10] Steven Combs
Yes I believe this is it.

Traceback (most recent call last):

  File "E:\Program Files (x86)\MySQL\MySQL Workbench CE 5.2.47\workbench\wizard_progress_page_widget.py", line 192, in thread_work

    self.func()

  File "E:\Program Files (x86)\MySQL\MySQL Workbench CE 5.2.47\modules\migration_data_transfer.py", line 534, in _count_rows

    total = self._transferer.count_table_rows(self._working_set)

  File "E:\Program Files (x86)\MySQL\MySQL Workbench CE 5.2.47\modules\DataMigrator.py", line 208, in count_table_rows

    passwords= (self._src_password+"\n").encode("utf8")

TypeError: unsupported operand type(s) for +: 'NoneType' and 'str'
[10 Jul 2013 22:11] Steven Combs
Here is what was on the left.

Info:	Time: 11:36:00	Message: wb.migration.open finished in 0.16s	Details: n/a
Info:	Time: 11:44:22	Message: Connecting to Mssql@Dsn=MyDB...	Details: n/a
Info:	Time: 11:44:22	Message: Opening ODBC connection to Dsn=MyDB...	Details: n/a
Info:	Time: 11:44:23	Message: Connected	Details: n/a
[11 Jul 2013 15:16] Sergio Andres De La Cruz Rodriguez
Thanks, Steven, that was very helpful.

This issue has already been fixed in the most recents betas of Workbench 6.0. Please install the most recent one and confirm that the issue is gone.

These betas are pretty stable and have many issues from previous versions fixed. In case you want to stick to 5.2.47, you have to modify the DataMigrator.py file (see the traceback you pasted to locate it) and look for the lines that read:

self._src_password = srcpassword
self._tgt_password = tgtpassword

and add "or ''" to the end of each of them, so that they look like:

self._src_password = srcpassword or ''
self._tgt_password = tgtpassword or ''

Save the file and restart Workbench. That should solve the issue.
[11 Jul 2013 17:43] Steven Combs
Thanks, I performed that change and got a little bit further than before. Now I am running into this problem. 

Traceback (most recent call last):

  File "E:\Program Files (x86)\MySQL\MySQL Workbench CE 5.2.47\workbench\wizard_progress_page_widget.py", line 192, in thread_work

    self.func()

  File "E:\Program Files (x86)\MySQL\MySQL Workbench CE 5.2.47\modules\migration_data_transfer.py", line 534, in _count_rows

    total = self._transferer.count_table_rows(self._working_set)

  File "E:\Program Files (x86)\MySQL\MySQL Workbench CE 5.2.47\modules\DataMigrator.py", line 225, in count_table_rows

    raise Exception("Error getting row count from source tables")

Exception: Error getting row count from source tables
[11 Jul 2013 17:45] Steven Combs
Starting...

Prepare information for data copy...

Prepare information for data copy done

Determine number of rows to copy....

Counting number of rows in tables...

wbcopytables.exe --count-only --passwords-from-stdin --odbc-source=Dsn=MyDB --table-file=e:\users\steven\appdata\local\temp\tmp3avka0

--table [MyDB]	[dbo].[MyTable]

13:39:45 [INF][      copytable]: Opening ODBC connection to 'Dsn=MyDB;PWD=XXX'

13:40:04 [ERR][      copytable]: ODBC connection to 'Dsn=MyDB;PWD=' failed

13:40:04 [ERR][      copytable]: Exception: SQLDriverConnect: IM008:10:[Microsoft][SQL Server Native Client 11.0]Dialog failed

ERROR: Determine number of rows to copy: Error getting row count from source tables

Failed
[11 Jul 2013 19:48] Sergio Andres De La Cruz Rodriguez
Yes, no matter what password you had set in your DSN, you still have to explicitely provide one in the migration wizard. Are you putting your password in the Source Selection page?
[11 Jul 2013 20:21] Steven Combs
I didn't at first. But I just tried to do it manually and that didn't work either. There were a couple of options. One was to just build the connection string myself and I tried that but it didn't seem to supply the password and I got the same error message. 

The other I chose the connection from the drop down and specified my username and password explicitly, and that didn't work either. Maybe it was a code change that was needed again?
[11 Jul 2013 20:32] Steven Combs
And for the one connection string to build myself I used.

Dsn=MyDB;PWD=MyPassword;
[11 Jul 2013 20:46] Steven Combs
Ok I went back and tried the one with the drop down. ODBC Data Source, and chose my DSN then I didn't store the password in the vault and proceeded with the Wizard. When I got to Data Migration, it actually prompted me for the password this time. I entered it in, it had the username as sa, and it finally processed all the data. 

I don't think that it knows how to read the password stored in the vault. I am going to try another table really quick and see what happens.
[11 Jul 2013 21:07] Steven Combs
Ok actually that worked just fine. Well I can't wait for the next release then. It will probably fix a lot of my problems here.
[11 Jul 2013 21:08] Steven Combs
Thanks for your help!!
[27 Jul 2013 22:46] Philip Olson
Fixed as of MySQL Workbench 6.0.4, and here's the changelog entry:

Several improvements were made to the Microsoft SQL server migration
wizard, which included fixes for unsupported operand types.

Thank you for the bug report.
[28 Jul 2013 2:00] Steven Combs
Thanks, yeah the new workbench looks amazing!