I also ran into this exact same issue. We have mysql as the backend. And the datetime type is not timezone aware. Neither "--verbose" and "--debug" are effective for the online_data_migrations command as they are not being taken into consideration. I ended up manually printing out the traceback by adding these two lines
I also ran into this exact same issue. We have mysql as the backend. And the datetime type is not timezone aware. Neither "--verbose" and "--debug" are effective for the online_ data_migrations command as they are not being taken into consideration. I ended up manually printing out the traceback by adding these two lines
import sys, traceback print_exc( file=sys. stdout)
traceback.
here https:/ /github. com/openstack/ nova/blob/ stable/ newton/ nova/cmd/ manage. py#L897
And able to see more information on the failure. Here's a sample traceback.
Running batches of 50 until complete venv/nova- 20170728T171245 Z/lib/python2. 7/site- packages/ nova/cmd/ manage. py", line 892, in _run_migration meth(ctxt, count) venv/nova- 20170728T171245 Z/lib/python2. 7/site- packages/ nova/objects/ flavor. py", line 717, in migrate_flavors _flavor_ create( ctxt, flavor_values) venv/nova- 20170728T171245 Z/lib/python2. 7/site- packages/ nova/objects/ flavor. py", line 463, in _flavor_create create( context, updates) venv/nova- 20170728T171245 Z/lib/python2. 7/site- packages/ oslo_db/ sqlalchemy/ enginefacade. py", line 824, in wrapper venv/nova- 20170728T171245 Z/lib/python2. 7/site- packages/ nova/objects/ flavor. py", line 166, in _flavor_create exceptions. OperationalErro r) (1292, "Incorrect datetime value: '2017-05-19 23:34:43+00:00' for column 'created_at' at row 1") [SQL: u'INSERT INTO flavors (created_at, updated_at, id, name, memory_mb, vcpus, root_gb, ephemeral_gb, flavorid, swap, rxtx_factor, vcpu_weight, disabled, is_public) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)'] [parameters: (datetime. datetime( 2017, 5, 19, 23, 34, 43, tzinfo= <iso8601. Utc>), None, 16, 'foo', 1024, 1, 2, 0, '50aae60f- ba2a-40d8- a0c3-2117ba0dd2 a6', 0, 1.0, 0, 0, 0)]
-------------- 2017-05-19 23:34:43+00:00 -----------------
Error attempting to run <function migrate_flavors at 0x7f5a0d758e60>
Traceback (most recent call last):
File "/opt/stack/
found, done = migration_
File "/opt/stack/
flavor.
File "/opt/stack/
return _flavor_
File "/opt/stack/
return fn(*args, **kwargs)
File "/opt/stack/
raise db_exc.DBError(e)
DBError: (_mysql_
Looks like migrations code is attempting to insert a timezone aware datetime field into mysql.