[openstack-dev] [Nova] How to confirm I have the right database schema when checkout to another branch?

严超 yanchao727 at gmail.com
Thu Jun 12 02:54:35 UTC 2014


Hi, All:
        When I checkout nova to another branch. how to confirm I have the
right database schema ?
        When I run "nova-manage db sync", I've got below error:

2014-06-11 22:53:27.977 CRITICAL nova [-] KeyError: <VerNum(242)>

2014-06-11 22:53:27.977 TRACE nova Traceback (most recent call last):
2014-06-11 22:53:27.977 TRACE nova   File "/usr/local/bin/nova-manage",
line 10, in <module>
2014-06-11 22:53:27.977 TRACE nova     sys.exit(main())
2014-06-11 22:53:27.977 TRACE nova   File
"/opt/stack/nova/nova/cmd/manage.py", line 1376, in main
2014-06-11 22:53:27.977 TRACE nova     ret = fn(*fn_args, **fn_kwargs)
2014-06-11 22:53:27.977 TRACE nova   File
"/opt/stack/nova/nova/cmd/manage.py", line 885, in sync
2014-06-11 22:53:27.977 TRACE nova     return migration.db_sync(version)
2014-06-11 22:53:27.977 TRACE nova   File
"/opt/stack/nova/nova/db/migration.py", line 32, in db_sync
2014-06-11 22:53:27.977 TRACE nova     return IMPL.db_sync(version=version)
2014-06-11 22:53:27.977 TRACE nova   File
"/opt/stack/nova/nova/db/sqlalchemy/migration.py", line 44, in db_sync
2014-06-11 22:53:27.977 TRACE nova     return
versioning_api.upgrade(get_engine(), repository, version)
2014-06-11 22:53:27.977 TRACE nova   File
"/usr/local/lib/python2.7/dist-packages/migrate/versioning/api.py", line
186, in upgrade
2014-06-11 22:53:27.977 TRACE nova     return _migrate(url, repository,
version, upgrade=True, err=err, **opts)
2014-06-11 22:53:27.977 TRACE nova   File "<string>", line 2, in _migrate
2014-06-11 22:53:27.977 TRACE nova   File
"/usr/local/lib/python2.7/dist-packages/migrate/versioning/util/__init__.py",
line 160, in with_engine
2014-06-11 22:53:27.977 TRACE nova     return f(*a, **kw)
2014-06-11 22:53:27.977 TRACE nova   File
"/usr/local/lib/python2.7/dist-packages/migrate/versioning/api.py", line
345, in _migrate
2014-06-11 22:53:27.977 TRACE nova     changeset = schema.changeset(version)
2014-06-11 22:53:27.977 TRACE nova   File
"/usr/local/lib/python2.7/dist-packages/migrate/versioning/schema.py", line
82, in changeset
2014-06-11 22:53:27.977 TRACE nova     changeset =
self.repository.changeset(database, start_ver, version)
2014-06-11 22:53:27.977 TRACE nova   File
"/usr/local/lib/python2.7/dist-packages/migrate/versioning/repository.py",
line 225, in changeset
2014-06-11 22:53:27.977 TRACE nova     changes =
[self.version(v).script(database, op) for v in versions]
2014-06-11 22:53:27.977 TRACE nova   File
"/usr/local/lib/python2.7/dist-packages/migrate/versioning/repository.py",
line 189, in version
2014-06-11 22:53:27.977 TRACE nova     return self.versions.version(*p, **k)
2014-06-11 22:53:27.977 TRACE nova   File
"/usr/local/lib/python2.7/dist-packages/migrate/versioning/version.py",
line 173, in version
2014-06-11 22:53:27.977 TRACE nova     return self.versions[VerNum(vernum)]
2014-06-11 22:53:27.977 TRACE nova KeyError: <VerNum(242)>
2014-06-11 22:53:27.977 TRACE nova


*Best Regards!*


*Chao Yan--------------**My twitter:Andy Yan @yanchao727
<https://twitter.com/yanchao727>*


*My Weibo:http://weibo.com/herewearenow
<http://weibo.com/herewearenow>--------------*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20140612/3f79ea45/attachment.html>


More information about the OpenStack-dev mailing list