DB migration upgrade/downgrade not employed for brocade-plugin

Bug #1238921 reported by Shiv Haris
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Fix Released
High
Shiv Haris

Bug Description

Foreign keys are being referenced by routerl3agentbinding, while the routers table has not been created yet:

2013-10-11 11:40:36 INFO [alembic.migration] Running upgrade 511471cc46b -> 3b54bf9e29f7, NEC plugin sharednet
2013-10-11 11:40:36 INFO [alembic.migration] Running upgrade 3b54bf9e29f7 -> 4692d074d587, agent scheduler
2013-10-11 11:40:36 Traceback (most recent call last):
2013-10-11 11:40:36 File "/usr/local/bin/neutron-db-manage", line 10, in <module>
2013-10-11 11:40:36 sys.exit(main())
2013-10-11 11:40:36 File "/opt/stack/neutron/neutron/db/migration/cli.py", line 143, in main
2013-10-11 11:40:36 CONF.command.func(config, CONF.command.name)
2013-10-11 11:40:36 File "/opt/stack/neutron/neutron/db/migration/cli.py", line 80, in do_upgrade_downgrade
2013-10-11 11:40:36 do_alembic_command(config, cmd, revision, sql=CONF.command.sql)
2013-10-11 11:40:36 File "/opt/stack/neutron/neutron/db/migration/cli.py", line 59, in do_alembic_command
2013-10-11 11:40:36 getattr(alembic_command, cmd)(config, *args, **kwargs)
2013-10-11 11:40:36 File "/usr/local/lib/python2.7/dist-packages/alembic/command.py", line 124, in upgrade
2013-10-11 11:40:36 script.run_env()
2013-10-11 11:40:36 File "/usr/local/lib/python2.7/dist-packages/alembic/script.py", line 193, in run_env
2013-10-11 11:40:36 util.load_python_file(self.dir, 'env.py')
2013-10-11 11:40:36 File "/usr/local/lib/python2.7/dist-packages/alembic/util.py", line 177, in load_python_file
2013-10-11 11:40:36 module = load_module(module_id, path)
2013-10-11 11:40:36 File "/usr/local/lib/python2.7/dist-packages/alembic/compat.py", line 39, in load_module
2013-10-11 11:40:36 return imp.load_source(module_id, path, fp)
2013-10-11 11:40:36 File "/opt/stack/neutron/neutron/db/migration/alembic_migrations/env.py", line 105, in <module>
2013-10-11 11:40:36 run_migrations_online()
2013-10-11 11:40:36 File "/opt/stack/neutron/neutron/db/migration/alembic_migrations/env.py", line 89, in run_migrations_online
2013-10-11 11:40:36 options=build_options())
2013-10-11 11:40:36 File "<string>", line 7, in run_migrations
2013-10-11 11:40:36 File "/usr/local/lib/python2.7/dist-packages/alembic/environment.py", line 652, in run_migrations
2013-10-11 11:40:36 self.get_context().run_migrations(**kw)
2013-10-11 11:40:36 File "/usr/local/lib/python2.7/dist-packages/alembic/migration.py", line 224, in run_migrations
2013-10-11 11:40:36 change(**kw)
2013-10-11 11:40:36 File "/opt/stack/neutron/neutron/db/migration/alembic_migrations/versions/4692d074d587_agent_scheduler.py", line 71, in upgrade
2013-10-11 11:40:36 sa.PrimaryKeyConstraint('id')
2013-10-11 11:40:36 File "<string>", line 7, in create_table
2013-10-11 11:40:36 File "/usr/local/lib/python2.7/dist-packages/alembic/operations.py", line 631, in create_table
2013-10-11 11:40:36 self._table(name, *columns, **kw)
2013-10-11 11:40:36 File "/usr/local/lib/python2.7/dist-packages/alembic/ddl/impl.py", line 149, in create_table
2013-10-11 11:40:36 self._exec(schema.CreateTable(table))
2013-10-11 11:40:36 File "/usr/local/lib/python2.7/dist-packages/alembic/ddl/impl.py", line 76, in _exec
2013-10-11 11:40:36 conn.execute(construct, *multiparams, **params)
2013-10-11 11:40:36 File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1449, in execute
2013-10-11 11:40:36 params)
2013-10-11 11:40:36 File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1542, in _execute_ddl
2013-10-11 11:40:36 compiled
2013-10-11 11:40:36 File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1698, in _execute_context
2013-10-11 11:40:36 context)
2013-10-11 11:40:36 File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1691, in _execute_context
2013-10-11 11:40:36 context)
2013-10-11 11:40:36 File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/default.py", line 331, in do_execute
2013-10-11 11:40:36 cursor.execute(statement, parameters)
2013-10-11 11:40:36 File "/usr/lib/python2.7/dist-packages/MySQLdb/cursors.py", line 174, in execute
2013-10-11 11:40:36 self.errorhandler(self, exc, value)
2013-10-11 11:40:36 File "/usr/lib/python2.7/dist-packages/MySQLdb/connections.py", line 36, in defaulterrorhandler
2013-10-11 11:40:36 raise errorclass, errorvalue
2013-10-11 11:40:36 sqlalchemy.exc.OperationalError: (OperationalError) (1005, "Can't create table 'brcd_neutron.routerl3agentbindings' (errno: 150)") '\nCREATE TABLE routerl3agentbindings (\n\tid VARCHAR(36) NOT NULL, \n\trouter_id VARCHAR(36), \n\tl3_agent_id VARCHAR(36), \n\tPRIMARY KEY (id), \n\tFOREIGN KEY(l3_agent_id) REFERENCES agents (id) ON DELETE CASCADE, \n\tFOREIGN KEY(router_id) REFERENCES routers (id) ON DELETE CASCADE\n)\n\n' ()
2013-10-11 11:40:36 ++ failed

Tags: brocade
Shiv Haris (shh)
Changed in neutron:
assignee: nobody → Shiv Haris (shh)
tags: added: brocade
Revision history for this message
Shiv Haris (shh) wrote :

This is happening due to migration upgade/downgrade not employed for brocade plugin.

Shiv Haris (shh)
summary: - fail to deploy brocade based neutron using devstack
+ DB migration upgrade/downgrade not employed for brocade-plugin
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (master)

Fix proposed to branch: master
Review: https://review.openstack.org/51320

Changed in neutron:
status: New → In Progress
Shiv Haris (shh)
tags: added: havana-rc-potential
Changed in neutron:
milestone: none → havana-rc2
importance: Undecided → High
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (master)

Reviewed: https://review.openstack.org/51320
Committed: http://github.com/openstack/neutron/commit/9d01010e8826eafc48044fc4018944a34bc96ba4
Submitter: Jenkins
Branch: master

commit 9d01010e8826eafc48044fc4018944a34bc96ba4
Author: Shiv Haris <email address hidden>
Date: Fri Oct 11 16:27:53 2013 -0700

    DB migration upgrade/downgrade not employed for brocade-plugin

    Fixes bug: 1238921

    Change-Id: I441d82a92588d7318a2f3b725643bc1b050a2c9c

Changed in neutron:
status: In Progress → Fix Committed
tags: removed: havana-rc-potential
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (milestone-proposed)

Fix proposed to branch: milestone-proposed
Review: https://review.openstack.org/51332

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (milestone-proposed)

Reviewed: https://review.openstack.org/51332
Committed: http://github.com/openstack/neutron/commit/9ba5b551ebfd5511f524397d5efbac0a2b07488f
Submitter: Jenkins
Branch: milestone-proposed

commit 9ba5b551ebfd5511f524397d5efbac0a2b07488f
Author: Shiv Haris <email address hidden>
Date: Fri Oct 11 16:27:53 2013 -0700

    DB migration upgrade/downgrade not employed for brocade-plugin

    Fixes bug: 1238921

    Change-Id: I441d82a92588d7318a2f3b725643bc1b050a2c9c
    (cherry picked from commit 9d01010e8826eafc48044fc4018944a34bc96ba4)

Changed in neutron:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in neutron:
milestone: havana-rc2 → 2013.2
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.