Modify

Opened 9 years ago

Closed 9 years ago

#12614 closed defect (cantfix)

Script failed - unsupported operand type(s)

Reported by: anonymous Owned by: Jun Omae
Priority: normal Component: TracMigratePlugin
Severity: normal Keywords:
Cc: Trac Release: 1.0

Description

Hi, I'm a PHP developer, so this might be to do with my stack, but when I tried to move to MySQL from SQLite, the script failed. I was missing a few dependencies, but this seems to be to do with the actual script. Here is the cmd & error:

[root@xxxx tracmigrateplugin]# ./trac-migrate.py --in-place /data/trac/xxx/ mysql://trac:xxx@xxx/xxx
Traceback (most recent call last):
  File "./trac-migrate.py", line 55, in <module>
    sys.exit(main(sys.argv[1:]) or 0)
  File "./trac-migrate.py", line 51, in main
    return TracMigrationCommand(env)._do_migrate(dest, dburi)
  File "/data/trac/ddc/plugins/migrate/tracmigrateplugin/tracmigrate/admin.py", line 35, in _do_migrate
    return self._do_migrate_inplace(dburi)
  File "/data/trac/ddc/plugins/migrate/tracmigrateplugin/tracmigrate/admin.py", line 66, in _do_migrate_inplace
    dst_env = self._create_env(env_path, dburi)
  File "/data/trac/xxx/plugins/migrate/tracmigrateplugin/tracmigrate/admin.py", line 116, in _create_env
    env = Environment(env_path, create=True, options=options)
  File "build/bdist.linux-x86_64/egg/trac/core.py", line 124, in __call__
  File "build/bdist.linux-x86_64/egg/trac/env.py", line 281, in __init__
  File "build/bdist.linux-x86_64/egg/trac/env.py", line 572, in create
  File "build/bdist.linux-x86_64/egg/trac/db/api.py", line 239, in init_db
  File "build/bdist.linux-x86_64/egg/trac/db/mysql_backend.py", line 117, in init_db
  File "build/bdist.linux-x86_64/egg/trac/db/mysql_backend.py", line 166, in to_sql
  File "build/bdist.linux-x86_64/egg/trac/db/mysql_backend.py", line 130, in _collist
TypeError: unsupported operand type(s) for /: 'int' and 'NoneType'

Attachments (0)

Change History (5)

comment:1 Changed 9 years ago by anonymous

I'm on CentOS 6.2. Here is the output of 'python -v'

Python 2.6.6 (r266:84292, Jul 23 2015, 15:22:56)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-11)] on linux2

comment:2 Changed 9 years ago by Ryan J Ollos

What is your Trac minor version (1.0.x) and what is your MySQL version?

Last edited 9 years ago by Ryan J Ollos (previous) (diff)

comment:3 Changed 9 years ago by Jun Omae

It seems that your Trac database in MySQL is not configured with utf8 character set. It must be configured with utf8 character set and utf8_bin collation type. See trac:wiki:MySqlDb#MySQL.

comment:4 Changed 9 years ago by anonymous

Our SQL database was not configured correctly. Once adjusted as suggested, the script worked fine, and moved our 2000 tickets across. Many thanks. Oliver

comment:5 Changed 9 years ago by Jun Omae

Resolution: cantfix
Status: newclosed

Thanks for the feedback.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Jun Omae.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.