db migration (lbaas_pool_scheduler) failed

Bug #1209151 reported by Yoshihiro Kaneko
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
neutron
Fix Released
High
Oleg Bondarev

Bug Description

The following error occurred when I run devstack with ryu plugin.

2013-08-07 08:47:16 INFO [alembic.migration] Running upgrade 2032abe8edac -> 52c5e4a18807, LBaaS Pool scheduler
2013-08-07 08:47:16 Traceback (most recent call last):
2013-08-07 08:47:16 File "/usr/local/bin/neutron-db-manage", line 10, in <module>
2013-08-07 08:47:16 sys.exit(main())
2013-08-07 08:47:16 File "/opt/stack/neutron/neutron/db/migration/cli.py", line 140, in main
2013-08-07 08:47:16 CONF.command.func(config, CONF.command.name)
2013-08-07 08:47:16 File "/opt/stack/neutron/neutron/db/migration/cli.py", line 77, in do_upgrade_downgrade
2013-08-07 08:47:16 do_alembic_command(config, cmd, revision, sql=CONF.command.sql)
2013-08-07 08:47:16 File "/opt/stack/neutron/neutron/db/migration/cli.py", line 56, in do_alembic_command
2013-08-07 08:47:16 getattr(alembic_command, cmd)(config, *args, **kwargs)
2013-08-07 08:47:16 File "/usr/local/lib/python2.7/dist-packages/alembic/command.py", line 123, in upgrade
2013-08-07 08:47:16 script.run_env()
2013-08-07 08:47:16 File "/usr/local/lib/python2.7/dist-packages/alembic/script.py", line 193, in run_env
2013-08-07 08:47:16 util.load_python_file(self.dir, 'env.py')
2013-08-07 08:47:16 File "/usr/local/lib/python2.7/dist-packages/alembic/util.py", line 177, in load_python_file
2013-08-07 08:47:16 module = imp.load_source(module_id, path, open(path, 'rb'))
2013-08-07 08:47:16 File "/opt/stack/neutron/neutron/db/migration/alembic_migrations/env.py", line 102, in <module>
2013-08-07 08:47:16 run_migrations_online()
2013-08-07 08:47:16 File "/opt/stack/neutron/neutron/db/migration/alembic_migrations/env.py", line 86, in run_migrations_online
2013-08-07 08:47:16 options=build_options())
2013-08-07 08:47:16 File "<string>", line 7, in run_migrations
2013-08-07 08:47:16 File "/usr/local/lib/python2.7/dist-packages/alembic/environment.py", line 536, in run_migrations
2013-08-07 08:47:16 self.get_context().run_migrations(**kw)
2013-08-07 08:47:16 File "/usr/local/lib/python2.7/dist-packages/alembic/migration.py", line 220, in run_migrations
2013-08-07 08:47:16 change(**kw)
2013-08-07 08:47:16 File "/opt/stack/neutron/neutron/db/migration/alembic_migrations/versions/52c5e4a18807_lbaas_pool_scheduler.py", line 45, in upgrade
2013-08-07 08:47:16 sa.PrimaryKeyConstraint('pool_id')
2013-08-07 08:47:16 File "<string>", line 7, in create_table
2013-08-07 08:47:16 File "/usr/local/lib/python2.7/dist-packages/alembic/operations.py", line 628, in create_table
2013-08-07 08:47:16 self._table(name, *columns, **kw)
2013-08-07 08:47:16 File "/usr/local/lib/python2.7/dist-packages/alembic/ddl/impl.py", line 148, in create_table
2013-08-07 08:47:16 self._exec(schema.CreateTable(table))
2013-08-07 08:47:16 File "/usr/local/lib/python2.7/dist-packages/alembic/ddl/impl.py", line 75, in _exec
2013-08-07 08:47:16 conn.execute(construct, *multiparams, **params)
2013-08-07 08:47:16 File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1449, in execute
2013-08-07 08:47:16 params)
2013-08-07 08:47:16 File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1542, in _execute_ddl
2013-08-07 08:47:16 compiled
2013-08-07 08:47:16 File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1698, in _execute_context
2013-08-07 08:47:16 context)
2013-08-07 08:47:16 File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1691, in _execute_context
2013-08-07 08:47:16 context)
2013-08-07 08:47:16 File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/default.py", line 331, in do_execute
2013-08-07 08:47:16 cursor.execute(statement, parameters)
2013-08-07 08:47:16 File "/usr/lib/python2.7/dist-packages/MySQLdb/cursors.py", line 174, in execute
2013-08-07 08:47:16 self.errorhandler(self, exc, value)
2013-08-07 08:47:16 File "/usr/lib/python2.7/dist-packages/MySQLdb/connections.py", line 36, in defaulterrorhandler
2013-08-07 08:47:16 raise errorclass, errorvalue
2013-08-07 08:47:16 sqlalchemy.exc.OperationalError: (OperationalError) (1005, "Can't create table 'ovs_neutron.poolloadbalanceragentbindings' (errno: 150)") '\nCREATE TABLE poolloadbalanceragentbindings (\n\tpool_id VARCHAR(36) NOT NULL, \n\tloadbalancer_agent_id VARCHAR(36) NOT NULL, \n\tPRIMARY KEY (pool_id), \n\tFOREIGN KEY(loadbalancer_agent_id) REFERENCES agents (id) ON DELETE CASCADE, \n\tFOREIGN KEY(pool_id) REFERENCES pools (id) ON DELETE CASCADE\n)\n\n' ()

poolloadbalanceragentbindings table created by 52c5e4a18807_lbaas_pool_scheduler.py refer to agents table.
agents table is created by 511471cc46b_agent_ext_model_supp.py.
When uses ryu plugin, 511471cc46b_agent_ext_model_supp.py does not create tables.
Therefore, 52c5e4a18807_lbaas_pool_scheduler.py will fail.

Tags: db lbaas
tags: added: db lbaas
Changed in neutron:
importance: Undecided → High
status: New → Confirmed
Changed in neutron:
assignee: nobody → Oleg Bondarev (obondarev)
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/40636

Changed in neutron:
status: Confirmed → In Progress
Changed in neutron:
milestone: none → havana-3
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (master)

Reviewed: https://review.openstack.org/40636
Committed: http://github.com/openstack/neutron/commit/47c0d2ebd55d4c5de2c3e914a7c3f91a8d31a20d
Submitter: Jenkins
Branch: master

commit 47c0d2ebd55d4c5de2c3e914a7c3f91a8d31a20d
Author: Oleg Bondarev <email address hidden>
Date: Wed Aug 7 16:15:51 2013 +0400

    Add support for service plugins to the migration framework

    Implements blueprint migrations-for-service-plugins
    Fixes bug 1209151

    Change-Id: If7fc7a4488352e9b65b6973d8ea631e0d9ed8b68

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