Tried to setup fresh nova db, version from trunk:
nova-manage db sync
with PostgreSQL 9.0 and got following error:
$ sudo -u nova nova-manage --flagfile=/etc/nova/nova.conf db sync
2011-02-14 14:27:05,238 INFO migrate.versioning.api [-] 0 -> 1...
2011-02-14 14:27:05,351 INFO nova.root [-] Table('export_devices', MetaData(Engine(postgresql+psycopg2://nova:nova@localhost/nova)), Column('created_at', DateTime(timezone=False), table=<export_devices>), Column('updated_at', DateTime(timezone=False), table=<export_devices>), Column('deleted_at', DateTime(timezone=False), table=<export_devices>), Column('deleted', Boolean(create_constraint=True, name=None), table=<export_devices>), Column('id', Integer(), table=<export_devices>, primary_key=True, nullable=False), Column('shelf_id', Integer(), table=<export_devices>), Column('blade_id', Integer(), table=<export_devices>), Column('volume_id', Integer(), ForeignKey('volumes.id'), table=<export_devices>), schema=None)
2011-02-14 14:27:05,351 ERROR nova.root [-] Exception while creating table
(nova.root): TRACE: Traceback (most recent call last):
(nova.root): TRACE: File "/usr/lib/pymodules/python2.6/nova/db/sqlalchemy/migrate_repo/versions/001_austin.py", line 518, in upgrade
(nova.root): TRACE: table.create()
(nova.root): TRACE: File "/usr/lib/python2.6/dist-packages/sqlalchemy/schema.py", line 439, in create
(nova.root): TRACE: bind.create(self, checkfirst=checkfirst)
(nova.root): TRACE: File "/usr/lib/python2.6/dist-packages/sqlalchemy/engine/base.py", line 1647, in create
(nova.root): TRACE: connection=connection, **kwargs)
(nova.root): TRACE: File "/usr/lib/python2.6/dist-packages/sqlalchemy/engine/base.py", line 1682, in _run_visitor
(nova.root): TRACE: **kwargs).traverse_single(element)
(nova.root): TRACE: File "/usr/lib/python2.6/dist-packages/sqlalchemy/sql/visitors.py", line 77, in traverse_single
(nova.root): TRACE: return meth(obj, **kw)
(nova.root): TRACE: File "/usr/lib/python2.6/dist-packages/sqlalchemy/engine/ddl.py", line 58, in visit_table
(nova.root): TRACE: self.connection.execute(schema.CreateTable(table))
(nova.root): TRACE: File "/usr/lib/python2.6/dist-packages/sqlalchemy/engine/base.py", line 1157, in execute
(nova.root): TRACE: params)
(nova.root): TRACE: File "/usr/lib/python2.6/dist-packages/sqlalchemy/engine/base.py", line 1210, in _execute_ddl
(nova.root): TRACE: return self.__execute_context(context)
(nova.root): TRACE: File "/usr/lib/python2.6/dist-packages/sqlalchemy/engine/base.py", line 1268, in __execute_context
(nova.root): TRACE: context.parameters[0], context=context)
(nova.root): TRACE: File "/usr/lib/python2.6/dist-packages/sqlalchemy/engine/base.py", line 1367, in _cursor_execute
(nova.root): TRACE: context)
(nova.root): TRACE: File "/usr/lib/python2.6/dist-packages/sqlalchemy/engine/base.py", line 1360, in _cursor_execute
(nova.root): TRACE: context)
(nova.root): TRACE: File "/usr/lib/python2.6/dist-packages/sqlalchemy/engine/default.py", line 288, in do_execute
(nova.root): TRACE: cursor.execute(statement, parameters)
(nova.root): TRACE: ProgrammingError: (ProgrammingError) relation "volumes" does not exist
(nova.root): TRACE: '\nCREATE TABLE export_devices (\n\tcreated_at TIMESTAMP WITHOUT TIME ZONE, \n\tupdated_at TIMESTAMP WITHOUT TIME ZONE, \n\tdeleted_at TIMESTAMP WITHOUT TIME ZONE, \n\tdeleted BOOLEAN, \n\tid SERIAL NOT NULL, \n\tshelf_id INTEGER, \n\tblade_id INTEGER, \n\tvolume_id INTEGER, \n\tPRIMARY KEY (id), \n\tFOREIGN KEY(volume_id) REFERENCES volumes (id)\n)\n\n' {}
(nova.root): TRACE:
2011-02-14 14:27:05,372 CRITICAL nova.root [-] (ProgrammingError) relation "volumes" does not exist
'\nCREATE TABLE export_devices (\n\tcreated_at TIMESTAMP WITHOUT TIME ZONE, \n\tupdated_at TIMESTAMP WITHOUT TIME ZONE, \n\tdeleted_at TIMESTAMP WITHOUT TIME ZONE, \n\tdeleted BOOLEAN, \n\tid SERIAL NOT NULL, \n\tshelf_id INTEGER, \n\tblade_id INTEGER, \n\tvolume_id INTEGER, \n\tPRIMARY KEY (id), \n\tFOREIGN KEY(volume_id) REFERENCES volumes (id)\n)\n\n' {}
(nova.root): TRACE: Traceback (most recent call last):
(nova.root): TRACE: File "/usr/bin/nova-manage", line 694, in <module>
(nova.root): TRACE: main()
(nova.root): TRACE: File "/usr/bin/nova-manage", line 686, in main
(nova.root): TRACE: fn(*argv)
(nova.root): TRACE: File "/usr/bin/nova-manage", line 565, in sync
(nova.root): TRACE: return migration.db_sync(version)
(nova.root): TRACE: File "/usr/lib/pymodules/python2.6/nova/db/migration.py", line 33, in db_sync
(nova.root): TRACE: return IMPL.db_sync(version=version)
(nova.root): TRACE: File "/usr/lib/pymodules/python2.6/nova/db/sqlalchemy/migration.py", line 33, in db_sync
(nova.root): TRACE: return versioning_api.upgrade(FLAGS.sql_connection, repo_path, version)
(nova.root): TRACE: File "/usr/lib/pymodules/python2.6/migrate/versioning/api.py", line 185, in upgrade
(nova.root): TRACE: return _migrate(url, repository, version, upgrade=True, err=err, **opts)
(nova.root): TRACE: File "<string>", line 2, in _migrate
(nova.root): TRACE: File "/usr/lib/pymodules/python2.6/migrate/versioning/util/__init__.py", line 160, in with_engine
(nova.root): TRACE: return f(*a, **kw)
(nova.root): TRACE: File "/usr/lib/pymodules/python2.6/migrate/versioning/api.py", line 364, in _migrate
(nova.root): TRACE: schema.runchange(ver, change, changeset.step)
(nova.root): TRACE: File "/usr/lib/pymodules/python2.6/migrate/versioning/schema.py", line 83, in runchange
(nova.root): TRACE: change.run(self.engine, step)
(nova.root): TRACE: File "/usr/lib/pymodules/python2.6/migrate/versioning/script/py.py", line 140, in run
(nova.root): TRACE: script_func(engine)
(nova.root): TRACE: File "/usr/lib/pymodules/python2.6/nova/db/sqlalchemy/migrate_repo/versions/001_austin.py", line 518, in upgrade
(nova.root): TRACE: table.create()
(nova.root): TRACE: File "/usr/lib/python2.6/dist-packages/sqlalchemy/schema.py", line 439, in create
(nova.root): TRACE: bind.create(self, checkfirst=checkfirst)
(nova.root): TRACE: File "/usr/lib/python2.6/dist-packages/sqlalchemy/engine/base.py", line 1647, in create
(nova.root): TRACE: connection=connection, **kwargs)
(nova.root): TRACE: File "/usr/lib/python2.6/dist-packages/sqlalchemy/engine/base.py", line 1682, in _run_visitor
(nova.root): TRACE: **kwargs).traverse_single(element)
(nova.root): TRACE: File "/usr/lib/python2.6/dist-packages/sqlalchemy/sql/visitors.py", line 77, in traverse_single
(nova.root): TRACE: return meth(obj, **kw)
(nova.root): TRACE: File "/usr/lib/python2.6/dist-packages/sqlalchemy/engine/ddl.py", line 58, in visit_table
(nova.root): TRACE: self.connection.execute(schema.CreateTable(table))
(nova.root): TRACE: File "/usr/lib/python2.6/dist-packages/sqlalchemy/engine/base.py", line 1157, in execute
(nova.root): TRACE: params)
(nova.root): TRACE: File "/usr/lib/python2.6/dist-packages/sqlalchemy/engine/base.py", line 1210, in _execute_ddl
(nova.root): TRACE: return self.__execute_context(context)
(nova.root): TRACE: File "/usr/lib/python2.6/dist-packages/sqlalchemy/engine/base.py", line 1268, in __execute_context
(nova.root): TRACE: context.parameters[0], context=context)
(nova.root): TRACE: File "/usr/lib/python2.6/dist-packages/sqlalchemy/engine/base.py", line 1367, in _cursor_execute
(nova.root): TRACE: context)
(nova.root): TRACE: File "/usr/lib/python2.6/dist-packages/sqlalchemy/engine/base.py", line 1360, in _cursor_execute
(nova.root): TRACE: context)
(nova.root): TRACE: File "/usr/lib/python2.6/dist-packages/sqlalchemy/engine/default.py", line 288, in do_execute
(nova.root): TRACE: cursor.execute(statement, parameters)
(nova.root): TRACE: ProgrammingError: (ProgrammingError) relation "volumes" does not exist
(nova.root): TRACE: '\nCREATE TABLE export_devices (\n\tcreated_at TIMESTAMP WITHOUT TIME ZONE, \n\tupdated_at TIMESTAMP WITHOUT TIME ZONE, \n\tdeleted_at TIMESTAMP WITHOUT TIME ZONE, \n\tdeleted BOOLEAN, \n\tid SERIAL NOT NULL, \n\tshelf_id INTEGER, \n\tblade_id INTEGER, \n\tvolume_id INTEGER, \n\tPRIMARY KEY (id), \n\tFOREIGN KEY(volume_id) REFERENCES volumes (id)\n)\n\n' {}
(nova.root): TRACE:
Ok, I investigated this issue. It seems that table creation table is wrong or maybe this point for only PostgreSQL. I provided fix in separate branch: https:/ /code.launchpad .net/~vash- vasiliyshlykov/ nova/lp718675