yahoo-eng-team team mailing list archive
-
yahoo-eng-team team
-
Mailing list archive
-
Message #08455
[Bug 1271231] [NEW] securitygroups table is created twice while migrating database from havana to icehouse
Public bug reported:
There is attempt to create a new table securitygroups by
49f5e553f61f_ml2_security_groups.py while table already exists (created
by 3cb5d900c5de_security_groups.py)
INFO [alembic.migration] Context impl MySQLImpl.
INFO [alembic.migration] Will assume non-transactional DDL.
INFO [alembic.migration] Running upgrade havana -> e197124d4b9, add unique constraint to members
INFO [alembic.migration] Running upgrade e197124d4b9 -> 1fcfc149aca4, Add a unique constraint on (agent_type, host) columns to prevent a race
condition when an agent entry is 'upserted'.
INFO [alembic.migration] Running upgrade 1fcfc149aca4 -> 50e86cb2637a, nsx_mappings
INFO [alembic.migration] Running upgrade 50e86cb2637a -> ed93525fd003, bigswitch_quota
INFO [alembic.migration] Running upgrade ed93525fd003 -> 49f5e553f61f, security_groups
Traceback (most recent call last):
File "/usr/local/bin/neutron-db-manage", line 10, in <module>
sys.exit(main())
File "/opt/stack/new/neutron/neutron/db/migration/cli.py", line 143, in main
CONF.command.func(config, CONF.command.name)
File "/opt/stack/new/neutron/neutron/db/migration/cli.py", line 80, in do_upgrade_downgrade
do_alembic_command(config, cmd, revision, sql=CONF.command.sql)
File "/opt/stack/new/neutron/neutron/db/migration/cli.py", line 59, in do_alembic_command
getattr(alembic_command, cmd)(config, *args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/alembic/command.py", line 124, in upgrade
script.run_env()
File "/usr/local/lib/python2.7/dist-packages/alembic/script.py", line 199, in run_env
util.load_python_file(self.dir, 'env.py')
File "/usr/local/lib/python2.7/dist-packages/alembic/util.py", line 199, in load_python_file
module = load_module(module_id, path)
File "/usr/local/lib/python2.7/dist-packages/alembic/compat.py", line 55, in load_module
mod = imp.load_source(module_id, path, fp)
File "/opt/stack/new/neutron/neutron/db/migration/alembic_migrations/env.py", line 105, in <module>
run_migrations_online()
File "/opt/stack/new/neutron/neutron/db/migration/alembic_migrations/env.py", line 89, in run_migrations_online
options=build_options())
File "<string>", line 7, in run_migrations
File "/usr/local/lib/python2.7/dist-packages/alembic/environment.py", line 652, in run_migrations
self.get_context().run_migrations(**kw)
File "/usr/local/lib/python2.7/dist-packages/alembic/migration.py", line 225, in run_migrations
change(**kw)
File "/opt/stack/new/neutron/neutron/db/migration/alembic_migrations/versions/49f5e553f61f_ml2_security_groups.py", line 53, in upgrade
sa.PrimaryKeyConstraint('id')
File "<string>", line 7, in create_table
File "/usr/local/lib/python2.7/dist-packages/alembic/operations.py", line 647, in create_table
self._table(name, *columns, **kw)
File "/usr/local/lib/python2.7/dist-packages/alembic/ddl/impl.py", line 149, in create_table
self._exec(schema.CreateTable(table))
File "/usr/local/lib/python2.7/dist-packages/alembic/ddl/impl.py", line 76, in _exec
conn.execute(construct, *multiparams, **params)
File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1449, in execute
params)
File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1542, in _execute_ddl
compiled
File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1698, in _execute_context
context)
File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1691, in _execute_context
context)
File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/default.py", line 331, in do_execute
cursor.execute(statement, parameters)
File "/usr/lib/python2.7/dist-packages/MySQLdb/cursors.py", line 174, in execute
self.errorhandler(self, exc, value)
File "/usr/lib/python2.7/dist-packages/MySQLdb/connections.py", line 36, in defaulterrorhandler
raise errorclass, errorvalue
sqlalchemy.exc.OperationalError: (OperationalError) (1050, "Table 'securitygroups' already exists") '\nCREATE TABLE securitygroups (\n\ttenant_id VARCHAR(255), \n\tid VARCHAR(36) NOT NULL, \n\tname VARCHAR(255), \n\tdescription VARCHAR(255), \n\tPRIMARY KEY (id)\n)\n\n' ()
** Affects: neutron
Importance: Undecided
Status: New
--
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to neutron.
https://bugs.launchpad.net/bugs/1271231
Title:
securitygroups table is created twice while migrating database from
havana to icehouse
Status in OpenStack Neutron (virtual network service):
New
Bug description:
There is attempt to create a new table securitygroups by
49f5e553f61f_ml2_security_groups.py while table already exists
(created by 3cb5d900c5de_security_groups.py)
INFO [alembic.migration] Context impl MySQLImpl.
INFO [alembic.migration] Will assume non-transactional DDL.
INFO [alembic.migration] Running upgrade havana -> e197124d4b9, add unique constraint to members
INFO [alembic.migration] Running upgrade e197124d4b9 -> 1fcfc149aca4, Add a unique constraint on (agent_type, host) columns to prevent a race
condition when an agent entry is 'upserted'.
INFO [alembic.migration] Running upgrade 1fcfc149aca4 -> 50e86cb2637a, nsx_mappings
INFO [alembic.migration] Running upgrade 50e86cb2637a -> ed93525fd003, bigswitch_quota
INFO [alembic.migration] Running upgrade ed93525fd003 -> 49f5e553f61f, security_groups
Traceback (most recent call last):
File "/usr/local/bin/neutron-db-manage", line 10, in <module>
sys.exit(main())
File "/opt/stack/new/neutron/neutron/db/migration/cli.py", line 143, in main
CONF.command.func(config, CONF.command.name)
File "/opt/stack/new/neutron/neutron/db/migration/cli.py", line 80, in do_upgrade_downgrade
do_alembic_command(config, cmd, revision, sql=CONF.command.sql)
File "/opt/stack/new/neutron/neutron/db/migration/cli.py", line 59, in do_alembic_command
getattr(alembic_command, cmd)(config, *args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/alembic/command.py", line 124, in upgrade
script.run_env()
File "/usr/local/lib/python2.7/dist-packages/alembic/script.py", line 199, in run_env
util.load_python_file(self.dir, 'env.py')
File "/usr/local/lib/python2.7/dist-packages/alembic/util.py", line 199, in load_python_file
module = load_module(module_id, path)
File "/usr/local/lib/python2.7/dist-packages/alembic/compat.py", line 55, in load_module
mod = imp.load_source(module_id, path, fp)
File "/opt/stack/new/neutron/neutron/db/migration/alembic_migrations/env.py", line 105, in <module>
run_migrations_online()
File "/opt/stack/new/neutron/neutron/db/migration/alembic_migrations/env.py", line 89, in run_migrations_online
options=build_options())
File "<string>", line 7, in run_migrations
File "/usr/local/lib/python2.7/dist-packages/alembic/environment.py", line 652, in run_migrations
self.get_context().run_migrations(**kw)
File "/usr/local/lib/python2.7/dist-packages/alembic/migration.py", line 225, in run_migrations
change(**kw)
File "/opt/stack/new/neutron/neutron/db/migration/alembic_migrations/versions/49f5e553f61f_ml2_security_groups.py", line 53, in upgrade
sa.PrimaryKeyConstraint('id')
File "<string>", line 7, in create_table
File "/usr/local/lib/python2.7/dist-packages/alembic/operations.py", line 647, in create_table
self._table(name, *columns, **kw)
File "/usr/local/lib/python2.7/dist-packages/alembic/ddl/impl.py", line 149, in create_table
self._exec(schema.CreateTable(table))
File "/usr/local/lib/python2.7/dist-packages/alembic/ddl/impl.py", line 76, in _exec
conn.execute(construct, *multiparams, **params)
File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1449, in execute
params)
File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1542, in _execute_ddl
compiled
File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1698, in _execute_context
context)
File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1691, in _execute_context
context)
File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/default.py", line 331, in do_execute
cursor.execute(statement, parameters)
File "/usr/lib/python2.7/dist-packages/MySQLdb/cursors.py", line 174, in execute
self.errorhandler(self, exc, value)
File "/usr/lib/python2.7/dist-packages/MySQLdb/connections.py", line 36, in defaulterrorhandler
raise errorclass, errorvalue
sqlalchemy.exc.OperationalError: (OperationalError) (1050, "Table 'securitygroups' already exists") '\nCREATE TABLE securitygroups (\n\ttenant_id VARCHAR(255), \n\tid VARCHAR(36) NOT NULL, \n\tname VARCHAR(255), \n\tdescription VARCHAR(255), \n\tPRIMARY KEY (id)\n)\n\n' ()
To manage notifications about this bug go to:
https://bugs.launchpad.net/neutron/+bug/1271231/+subscriptions
Follow ups
References