← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1247727] Re: Can't create table error when upgrade nova database from Grizzly to Havana

 

This is no longer relevant for master, but I'll leave it targeted to
havana in case someone can take a closer look.

** Changed in: nova
       Status: New => Invalid

** Also affects: nova/havana
   Importance: Undecided
       Status: New

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Compute (nova).
https://bugs.launchpad.net/bugs/1247727

Title:
  Can't create table error when upgrade nova database from Grizzly to
  Havana

Status in OpenStack Compute (Nova):
  Invalid
Status in OpenStack Compute (nova) havana series:
  New

Bug description:
  Hi list,

  I'm trying to upgrade my set-up from Grizzly to Havana, I get an error
  when I upgrade my nova data base:

  nova-manage db sync

      2013-11-01 14:50:44.197 36655 INFO migrate.versioning.api [-] 208 -> 209...
      Command failed, please check log for more info
      2013-11-01 14:50:44.583 36655 CRITICAL nova [-] (OperationalError) (1005, "Can't create table 'nova.#sql-8a7f_5362' (errno: 121)") 'ALTER TABLE compute_nodes ADD CONSTRAINT fk_compute_nodes_service_id FOREIGN KEY(service_id) REFERENCES services (id)' ()
      2013-11-01 14:50:44.583 36655 TRACE nova Traceback (most recent call last):
      2013-11-01 14:50:44.583 36655 TRACE nova   File "/usr/bin/nova-manage", line 10, in <module>
      2013-11-01 14:50:44.583 36655 TRACE nova     sys.exit(main())
      2013-11-01 14:50:44.583 36655 TRACE nova   File "/usr/lib/python2.6/site-packages/nova/cmd/manage.py", line 1377, in main
      2013-11-01 14:50:44.583 36655 TRACE nova     ret = fn(*fn_args, **fn_kwargs)
      2013-11-01 14:50:44.583 36655 TRACE nova   File "/usr/lib/python2.6/site-packages/nova/cmd/manage.py", line 885, in sync
      2013-11-01 14:50:44.583 36655 TRACE nova     return migration.db_sync(version)
      2013-11-01 14:50:44.583 36655 TRACE nova   File "/usr/lib/python2.6/site-packages/nova/db/migration.py", line 33, in db_sync
      2013-11-01 14:50:44.583 36655 TRACE nova     return IMPL.db_sync(version=version)
      2013-11-01 14:50:44.583 36655 TRACE nova   File "/usr/lib/python2.6/site-packages/nova/db/sqlalchemy/migration.py", line 81, in db_sync
      2013-11-01 14:50:44.583 36655 TRACE nova     return versioning_api.upgrade(get_engine(), repository, version)
      2013-11-01 14:50:44.583 36655 TRACE nova   File "/usr/lib/python2.6/site-packages/migrate/versioning/api.py", line 186, in upgrade
      2013-11-01 14:50:44.583 36655 TRACE nova     return _migrate(url, repository, version, upgrade=True, err=err, **opts)
      2013-11-01 14:50:44.583 36655 TRACE nova   File "<string>", line 2, in _migrate
      2013-11-01 14:50:44.583 36655 TRACE nova   File "/usr/lib/python2.6/site-packages/nova/db/sqlalchemy/migration.py", line 40, in patched_with_engine
      2013-11-01 14:50:44.583 36655 TRACE nova     return f(*a, **kw)
      2013-11-01 14:50:44.583 36655 TRACE nova   File "/usr/lib/python2.6/site-packages/migrate/versioning/api.py", line 366, in _migrate
      2013-11-01 14:50:44.583 36655 TRACE nova     schema.runchange(ver, change, changeset.step)
      2013-11-01 14:50:44.583 36655 TRACE nova   File "/usr/lib/python2.6/site-packages/migrate/versioning/schema.py", line 91, in runchange
      2013-11-01 14:50:44.583 36655 TRACE nova     change.run(self.engine, step)
      2013-11-01 14:50:44.583 36655 TRACE nova   File "/usr/lib/python2.6/site-packages/migrate/versioning/script/py.py", line 145, in run
      2013-11-01 14:50:44.583 36655 TRACE nova     script_func(engine)
      2013-11-01 14:50:44.583 36655 TRACE nova   File "/usr/lib/python2.6/site-packages/nova/db/sqlalchemy/migrate_repo/versions/209_add_missing_foreign_keys.py", line 63, in upgrade
      2013-11-01 14:50:44.583 36655 TRACE nova     fkey.create()
      2013-11-01 14:50:44.583 36655 TRACE nova   File "/usr/lib/python2.6/site-packages/migrate/changeset/constraint.py", line 44, in create
      2013-11-01 14:50:44.583 36655 TRACE nova     self.__do_imports('constraintgenerator', *a, **kw)
      2013-11-01 14:50:44.583 36655 TRACE nova   File "/usr/lib/python2.6/site-packages/migrate/changeset/constraint.py", line 32, in __do_imports
      2013-11-01 14:50:44.583 36655 TRACE nova     run_single_visitor(engine, visitorcallable, self, *a, **kw)
      2013-11-01 14:50:44.583 36655 TRACE nova   File "/usr/lib/python2.6/site-packages/migrate/changeset/databases/visitor.py", line 75, in run_single_visitor
      2013-11-01 14:50:44.583 36655 TRACE nova     fn(element, **kwargs)
      2013-11-01 14:50:44.583 36655 TRACE nova   File "/usr/lib/python2.6/site-packages/migrate/changeset/ansisql.py", line 266, in visit_migrate_foreign_key_constraint
      2013-11-01 14:50:44.583 36655 TRACE nova     self._visit_constraint(*p, **k)
      2013-11-01 14:50:44.583 36655 TRACE nova   File "/usr/lib/python2.6/site-packages/migrate/changeset/ansisql.py", line 278, in _visit_constraint
      2013-11-01 14:50:44.583 36655 TRACE nova     self.execute()
      2013-11-01 14:50:44.583 36655 TRACE nova   File "/usr/lib/python2.6/site-packages/migrate/changeset/ansisql.py", line 42, in execute
      2013-11-01 14:50:44.583 36655 TRACE nova     return self.connection.execute(self.buffer.getvalue())
      2013-11-01 14:50:44.583 36655 TRACE nova   File "/usr/lib64/python2.6/site-packages/SQLAlchemy-0.8.2-py2.6-linux-x86_64.egg/sqlalchemy/engine/base.py", line 662, in execute
      2013-11-01 14:50:44.583 36655 TRACE nova     params)
      2013-11-01 14:50:44.583 36655 TRACE nova   File "/usr/lib64/python2.6/site-packages/SQLAlchemy-0.8.2-py2.6-linux-x86_64.egg/sqlalchemy/engine/base.py", line 805, in _execute_text
      2013-11-01 14:50:44.583 36655 TRACE nova     statement, parameters
      2013-11-01 14:50:44.583 36655 TRACE nova   File "/usr/lib64/python2.6/site-packages/SQLAlchemy-0.8.2-py2.6-linux-x86_64.egg/sqlalchemy/engine/base.py", line 874, in _execute_context
      2013-11-01 14:50:44.583 36655 TRACE nova     context)
      2013-11-01 14:50:44.583 36655 TRACE nova   File "/usr/lib64/python2.6/site-packages/SQLAlchemy-0.8.2-py2.6-linux-x86_64.egg/sqlalchemy/engine/base.py", line 1024, in _handle_dbapi_exception
      2013-11-01 14:50:44.583 36655 TRACE nova     exc_info
      2013-11-01 14:50:44.583 36655 TRACE nova   File "/usr/lib64/python2.6/site-packages/SQLAlchemy-0.8.2-py2.6-linux-x86_64.egg/sqlalchemy/util/compat.py", line 195, in raise_from_cause
      2013-11-01 14:50:44.583 36655 TRACE nova     reraise(type(exception), exception, tb=exc_tb)
      2013-11-01 14:50:44.583 36655 TRACE nova   File "/usr/lib64/python2.6/site-packages/SQLAlchemy-0.8.2-py2.6-linux-x86_64.egg/sqlalchemy/engine/base.py", line 867, in _execute_context
      2013-11-01 14:50:44.583 36655 TRACE nova     context)
      2013-11-01 14:50:44.583 36655 TRACE nova   File "/usr/lib64/python2.6/site-packages/SQLAlchemy-0.8.2-py2.6-linux-x86_64.egg/sqlalchemy/engine/default.py", line 324, in do_execute
      2013-11-01 14:50:44.583 36655 TRACE nova     cursor.execute(statement, parameters)
      2013-11-01 14:50:44.583 36655 TRACE nova   File "/usr/lib64/python2.6/site-packages/MySQLdb/cursors.py", line 173, in execute
      2013-11-01 14:50:44.583 36655 TRACE nova     self.errorhandler(self, exc, value)
      2013-11-01 14:50:44.583 36655 TRACE nova   File "/usr/lib64/python2.6/site-packages/MySQLdb/connections.py", line 36, in defaulterrorhandler
      2013-11-01 14:50:44.583 36655 TRACE nova     raise errorclass, errorvalue
      2013-11-01 14:50:44.583 36655 TRACE nova OperationalError: (OperationalError) (1005, "Can't create table 'nova.#sql-8a7f_5362' (errno: 121)") 'ALTER TABLE compute_nodes ADD CONSTRAINT fk_compute_nodes_service_id FOREIGN KEY(service_id) REFERENCES services (id)' ()
      2013-11-01 14:50:44.583 36655 TRACE nova


  Anyone can help me ??

  Thanks. 
  -chen

To manage notifications about this bug go to:
https://bugs.launchpad.net/nova/+bug/1247727/+subscriptions