db migration fails with exception

Bug #1637272 reported by Isaku Yamahata
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
networking-odl
Fix Released
Undecided
Unassigned

Bug Description

db migration fails as follows.
The culprit is https://review.openstack.org/#/c/390017/

2016-10-25 17:41:13.288 | INFO [alembic.runtime.migration] Will assume non-transactional DDL.
2016-10-25 17:41:13.292 | INFO [alembic.runtime.migration] Running upgrade -> b89a299e19f9, Initial odl db, branchpoint
2016-10-25 17:41:13.294 | INFO [alembic.runtime.migration] Running upgrade b89a299e19f9 -> 247501328046, Start of odl expand branch
2016-10-25 17:41:13.295 | INFO [alembic.runtime.migration] Running upgrade 247501328046 -> 37e242787ae5, Opendaylight Neutron mechanism driver refactor
2016-10-25 17:41:13.299 | INFO [alembic.runtime.migration] Running upgrade 37e242787ae5 -> 703dbf02afde, Add journal maintenance table
2016-10-25 17:41:13.305 | INFO [alembic.runtime.migration] Running upgrade 703dbf02afde -> 3d560427d776, add sequence number to journal
2016-10-25 17:41:13.319 | Running upgrade for neutron ...
2016-10-25 17:41:13.319 | OK
2016-10-25 17:41:13.319 | Running upgrade for networking-odl ...
2016-10-25 17:41:13.319 | Traceback (most recent call last):
2016-10-25 17:41:13.319 | File "/usr/local/bin/neutron-db-manage", line 10, in <module>
2016-10-25 17:41:13.319 | sys.exit(main())
2016-10-25 17:41:13.319 | File "/opt/stack/neutron/neutron/db/migration/cli.py", line 687, in main
2016-10-25 17:41:13.319 | return_val |= bool(CONF.command.func(config, CONF.command.name))
2016-10-25 17:41:13.319 | File "/opt/stack/neutron/neutron/db/migration/cli.py", line 208, in do_upgrade
2016-10-25 17:41:13.320 | desc=branch, sql=CONF.command.sql)
2016-10-25 17:41:13.320 | File "/opt/stack/neutron/neutron/db/migration/cli.py", line 109, in do_alembic_command
2016-10-25 17:41:13.320 | getattr(alembic_command, cmd)(config, *args, **kwargs)
2016-10-25 17:41:13.320 | File "/usr/local/lib/python2.7/dist-packages/alembic/command.py", line 174, in upgrade
2016-10-25 17:41:13.320 | script.run_env()
2016-10-25 17:41:13.320 | File "/usr/local/lib/python2.7/dist-packages/alembic/script/base.py", line 407, in run_env
2016-10-25 17:41:13.320 | util.load_python_file(self.dir, 'env.py')
2016-10-25 17:41:13.321 | File "/usr/local/lib/python2.7/dist-packages/alembic/util/pyfiles.py", line 93, in load_python_file
2016-10-25 17:41:13.321 | module = load_module_py(module_id, path)
2016-10-25 17:41:13.321 | File "/usr/local/lib/python2.7/dist-packages/alembic/util/compat.py", line 79, in load_module_py
2016-10-25 17:41:13.321 | mod = imp.load_source(module_id, path, fp)
2016-10-25 17:41:13.321 | File "/opt/stack/networking-odl/networking_odl/db/migration/alembic_migrations/env.py", line 99, in <module>
2016-10-25 17:41:13.321 | run_migrations_online()
2016-10-25 17:41:13.321 | File "/opt/stack/networking-odl/networking_odl/db/migration/alembic_migrations/env.py", line 90, in run_migrations_online
2016-10-25 17:41:13.321 | context.run_migrations()
2016-10-25 17:41:13.321 | File "<string>", line 8, in run_migrations
2016-10-25 17:41:13.321 | File "/usr/local/lib/python2.7/dist-packages/alembic/runtime/environment.py", line 797, in run_migrations
2016-10-25 17:41:13.322 | self.get_context().run_migrations(**kw)
2016-10-25 17:41:13.322 | File "/usr/local/lib/python2.7/dist-packages/alembic/runtime/migration.py", line 312, in run_migrations
2016-10-25 17:41:13.322 | step.migration_fn(**kw)
2016-10-25 17:41:13.322 | File "/opt/stack/networking-odl/networking_odl/db/migration/alembic_migrations/versions/newton/expand/3d560427d776_add_sequence_number_to_journal.py", line 48, in upgrade
2016-10-25 17:41:13.322 | onupdate=sa.func.now()),
2016-10-25 17:41:13.322 | File "<string>", line 8, in create_table
2016-10-25 17:41:13.323 | File "<string>", line 3, in create_table
2016-10-25 17:41:13.323 | File "/usr/local/lib/python2.7/dist-packages/alembic/operations/ops.py", line 1098, in create_table
2016-10-25 17:41:13.323 | return operations.invoke(op)
2016-10-25 17:41:13.323 | File "/usr/local/lib/python2.7/dist-packages/alembic/operations/base.py", line 318, in invoke
2016-10-25 17:41:13.323 | return fn(self, operation)
2016-10-25 17:41:13.323 | File "/usr/local/lib/python2.7/dist-packages/alembic/operations/toimpl.py", line 101, in create_table
2016-10-25 17:41:13.323 | operations.impl.create_table(table)
2016-10-25 17:41:13.323 | File "/usr/local/lib/python2.7/dist-packages/alembic/ddl/impl.py", line 194, in create_table
2016-10-25 17:41:13.324 | self._exec(schema.CreateTable(table))
2016-10-25 17:41:13.324 | File "/usr/local/lib/python2.7/dist-packages/alembic/ddl/impl.py", line 118, in _exec
2016-10-25 17:41:13.324 | return conn.execute(construct, *multiparams, **params)
2016-10-25 17:41:13.324 | File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 914, in execute
2016-10-25 17:41:13.324 | return meth(self, multiparams, params)
2016-10-25 17:41:13.324 | File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/sql/ddl.py", line 68, in _execute_on_connection
2016-10-25 17:41:13.324 | return connection._execute_ddl(self, multiparams, params)
2016-10-25 17:41:13.324 | File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 968, in _execute_ddl
2016-10-25 17:41:13.325 | compiled
2016-10-25 17:41:13.325 | File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1146, in _execute_context
2016-10-25 17:41:13.325 | context)
2016-10-25 17:41:13.325 | File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1337, in _handle_dbapi_exception
2016-10-25 17:41:13.325 | util.raise_from_cause(newraise, exc_info)
2016-10-25 17:41:13.325 | File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/util/compat.py", line 202, in raise_from_cause
2016-10-25 17:41:13.326 | reraise(type(exception), exception, tb=exc_tb, cause=cause)
2016-10-25 17:41:13.326 | File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1139, in _execute_context
2016-10-25 17:41:13.326 | context)
2016-10-25 17:41:13.326 | File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/default.py", line 450, in do_execute
2016-10-25 17:41:13.326 | cursor.execute(statement, parameters)
2016-10-25 17:41:13.327 | File "/usr/local/lib/python2.7/dist-packages/pymysql/cursors.py", line 166, in execute
2016-10-25 17:41:13.327 | result = self._query(query)
2016-10-25 17:41:13.327 | File "/usr/local/lib/python2.7/dist-packages/pymysql/cursors.py", line 322, in _query
2016-10-25 17:41:13.327 | conn.query(q)
2016-10-25 17:41:13.327 | File "/usr/local/lib/python2.7/dist-packages/pymysql/connections.py", line 835, in query
2016-10-25 17:41:13.328 | self._affected_rows = self._read_query_result(unbuffered=unbuffered)
2016-10-25 17:41:13.328 | File "/usr/local/lib/python2.7/dist-packages/pymysql/connections.py", line 1019, in _read_query_result
2016-10-25 17:41:13.328 | result.read()
2016-10-25 17:41:13.328 | File "/usr/local/lib/python2.7/dist-packages/pymysql/connections.py", line 1302, in read
2016-10-25 17:41:13.328 | first_packet = self.connection._read_packet()
2016-10-25 17:41:13.328 | File "/usr/local/lib/python2.7/dist-packages/pymysql/connections.py", line 981, in _read_packet
2016-10-25 17:41:13.329 | packet.check_error()
2016-10-25 17:41:13.329 | File "/usr/local/lib/python2.7/dist-packages/pymysql/connections.py", line 393, in check_error
2016-10-25 17:41:13.329 | err.raise_mysql_exception(self._data)
2016-10-25 17:41:13.329 | File "/usr/local/lib/python2.7/dist-packages/pymysql/err.py", line 107, in raise_mysql_exception
2016-10-25 17:41:13.329 | raise errorclass(errno, errval)
2016-10-25 17:41:13.330 | oslo_db.exception.DBError: (pymysql.err.InternalError) (1067, u"Invalid default value for 'created_at'") [SQL: u"\nCREATE TABLE opendaylightjournal_new (\n\tseqnum BIGINT NOT NULL AUTO_INCREMENT, \n\tobject_type VARCHAR(36) NOT NULL, \n\tobject_uuid VARCHAR(36) NOT NULL, \n\toperation VARCHAR(36) NOT NULL, \n\tdata BLOB, \n\tstate ENUM('pending','processing','failed','completed') NOT NULL, \n\tretry_count INTEGER, \n\tcreated_at DATETIME DEFAULT now(), \n\tlast_retried TIMESTAMP NULL DEFAULT now(), \n\tPRIMARY KEY (seqnum)\n)ENGINE=InnoDB\n\n"]
2016-10-25 17:41:13.404 | + lib/neutron-legacy:init_mutnauq:1 : exit_trap
2016-10-25 17:41:13.406 | + ./stack.sh:exit_trap:487 : local r=1
2016-10-25 17:41:13.408 | ++ ./stack.sh:exit_trap:488 : jobs -p
2016-10-25 17:41:13.410 | + ./stack.sh:exit_trap:488 : jobs=
2016-10-25 17:41:13.411 | + ./stack.sh:exit_trap:491 : [[ -n '' ]]
2016-10-25 17:41:13.413 | + ./stack.sh:exit_trap:497 : kill_spinner
2016-10-25 17:41:13.415 | + ./stack.sh:kill_spinner:383 : '[' '!' -z '' ']'
2016-10-25 17:41:13.416 | + ./stack.sh:exit_trap:499 : [[ 1 -ne 0 ]]
2016-10-25 17:41:13.418 | + ./stack.sh:exit_trap:500 : echo 'Error on exit'
2016-10-25 17:41:13.418 | Error on exit
2016-10-25 17:41:13.419 | + ./stack.sh:exit_trap:501 : generate-subunit 1477415798 1475 fail
2016-10-25 17:41:13.612 | + ./stack.sh:exit_trap:502 : [[ -z /opt/stack/logs ]]
2016-10-25 17:41:13.614 | + ./stack.sh:exit_trap:505 : /home/vagrant/devstack/tools/worlddump.py -d /opt/stack/logs
2016-10-25 17:41:13.911 | + ./stack.sh:exit_trap:511 : exit 1

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to networking-odl (master)
Download full text (7.0 KiB)

Reviewed: https://review.openstack.org/391283
Committed: https://git.openstack.org/cgit/openstack/networking-odl/commit/?id=f90f5ee6572089c090a34fe45960cdd54b992b75
Submitter: Jenkins
Branch: master

commit f90f5ee6572089c090a34fe45960cdd54b992b75
Author: Isaku Yamahata <email address hidden>
Date: Thu Oct 27 19:19:24 2016 +0200

    alembic: db migration fails

    the patch of https://review.openstack.org/#/c/390017/ caused the
    following exception during db migration.
    This patch reverts the migration scripts change of the patch.

    > INFO [alembic.runtime.migration] Running upgrade -> b89a299e19f9, Initial odl db, branchpoint
    > INFO [alembic.runtime.migration] Running upgrade b89a299e19f9 -> 247501328046, Start of odl expand branch
    > INFO [alembic.runtime.migration] Running upgrade 247501328046 -> 37e242787ae5, Opendaylight Neutron mechanism driver refactor
    > INFO [alembic.runtime.migration] Running upgrade 37e242787ae5 -> 703dbf02afde, Add journal maintenance table
    > INFO [alembic.runtime.migration] Running upgrade 703dbf02afde -> 3d560427d776, add sequence number to journal
    > Running upgrade for neutron ...
    > OK
    > Running upgrade for networking-odl ...
    > Traceback (most recent call last):
    > File "/usr/local/bin/neutron-db-manage", line 10, in <module>
    > sys.exit(main())
    > File "/opt/stack/neutron/neutron/db/migration/cli.py", line 687, in main
    > return_val |= bool(CONF.command.func(config, CONF.command.name))
    > File "/opt/stack/neutron/neutron/db/migration/cli.py", line 208, in do_upgrade
    > desc=branch, sql=CONF.command.sql)
    > File "/opt/stack/neutron/neutron/db/migration/cli.py", line 109, in do_alembic_command
    > getattr(alembic_command, cmd)(config, *args, **kwargs)
    > File "/usr/local/lib/python2.7/dist-packages/alembic/command.py", line 174, in upgrade
    > script.run_env()
    > File "/usr/local/lib/python2.7/dist-packages/alembic/script/base.py", line 407, in run_env
    > util.load_python_file(self.dir, 'env.py')
    > File "/usr/local/lib/python2.7/dist-packages/alembic/util/pyfiles.py", line 93, in load_python_file
    > module = load_module_py(module_id, path)
    > File "/usr/local/lib/python2.7/dist-packages/alembic/util/compat.py", line 79, in load_module_py
    > mod = imp.load_source(module_id, path, fp)
    > File "/opt/stack/networking-odl/networking_odl/db/migration/alembic_migrations/env.py", line 99, in <module>
    > run_migrations_online()
    > File "/opt/stack/networking-odl/networking_odl/db/migration/alembic_migrations/env.py", line 90, in run_migrations_online
    > context.run_migrations()
    > File "<string>", line 8, in run_migrations
    > File "/usr/local/lib/python2.7/dist-packages/alembic/runtime/environment.py", line 797, in run_migrations
    > self.get_context().run_migrations(**kw)
    > File "/usr/local/lib/python2.7/dist-packages/alembic/runtime/migration.py", line 312, in run_migrations
    > step.migration_fn(**kw)
    > File "/opt/stack/networking-odl/networking_odl/db/migration/alembic_migrations/versions/newton/e...

Read more...

Changed in networking-odl:
status: New → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/networking-odl 3.0.0

This issue was fixed in the openstack/networking-odl 3.0.0 release.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.