Ask Your Question
2

keystone db missing version control

asked 2015-07-24 04:20:32 -0500

foexle gravatar image

Hi guys,

I'm trying to upgrade (the usual way) my Keystone database from Icehouse to Kilo. I'm running in an issue if i try to upgrade the database schemata of Keystone.

root@keystone01:~# keystone-manage db_sync
2015-07-24 09:10:04.394 19194 ERROR oslo_db.sqlalchemy.exc_filters [-] DBAPIError exception wrapped from (ProgrammingError) permission denied for relation migrate_version
 'SELECT migrate_version.repository_id, migrate_version.repository_path, migrate_version.version \nFROM migrate_version \nWHERE migrate_version.repository_id = %(repository_id_1)s' {'repository_id_1': 'keystone'}
2015-07-24 09:10:04.394 19194 TRACE oslo_db.sqlalchemy.exc_filters Traceback (most recent call last):
2015-07-24 09:10:04.394 19194 TRACE oslo_db.sqlalchemy.exc_filters   File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 951, in _execute_context
2015-07-24 09:10:04.394 19194 TRACE oslo_db.sqlalchemy.exc_filters     context)
2015-07-24 09:10:04.394 19194 TRACE oslo_db.sqlalchemy.exc_filters   File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/default.py", line 436, in do_execute
2015-07-24 09:10:04.394 19194 TRACE oslo_db.sqlalchemy.exc_filters     cursor.execute(statement, parameters)
2015-07-24 09:10:04.394 19194 TRACE oslo_db.sqlalchemy.exc_filters ProgrammingError: permission denied for relation migrate_version
2015-07-24 09:10:04.394 19194 TRACE oslo_db.sqlalchemy.exc_filters 
2015-07-24 09:10:04.394 19194 TRACE oslo_db.sqlalchemy.exc_filters 
2015-07-24 09:10:04.664 19194 CRITICAL keystone [-] DbMigrationError: The database is not under version control, but has tables. Please stamp the current version of the schema manually.
2015-07-24 09:10:04.664 19194 TRACE keystone Traceback (most recent call last):
2015-07-24 09:10:04.664 19194 TRACE keystone   File "/usr/bin/keystone-manage", line 44, in <module>
2015-07-24 09:10:04.664 19194 TRACE keystone     cli.main(argv=sys.argv, config_files=config_files)
2015-07-24 09:10:04.664 19194 TRACE keystone   File "/usr/lib/python2.7/dist-packages/keystone/cli.py", line 585, in main
2015-07-24 09:10:04.664 19194 TRACE keystone     CONF.command.cmd_class.main()
2015-07-24 09:10:04.664 19194 TRACE keystone   File "/usr/lib/python2.7/dist-packages/keystone/cli.py", line 76, in main
2015-07-24 09:10:04.664 19194 TRACE keystone     migration_helpers.sync_database_to_version(extension, version)
2015-07-24 09:10:04.664 19194 TRACE keystone   File "/usr/lib/python2.7/dist-packages/keystone/common/sql/migration_helpers.py", line 242, in sync_database_to_version
2015-07-24 09:10:04.664 19194 TRACE keystone     _sync_common_repo(version)
2015-07-24 09:10:04.664 19194 TRACE keystone   File "/usr/lib/python2.7/dist-packages/keystone/common/sql/migration_helpers.py", line 148, in _sync_common_repo
2015-07-24 09:10:04.664 19194 TRACE keystone     init_version=init_version)
2015-07-24 09:10:04.664 19194 TRACE keystone   File "/usr/lib/python2.7/dist-packages/oslo_db/sqlalchemy/migration.py", line 74, in db_sync
2015-07-24 09:10:04.664 19194 TRACE keystone     current_version = db_version(engine, abs_path, init_version)
2015-07-24 09:10:04.664 19194 TRACE keystone   File "/usr/lib/python2.7/dist-packages/oslo_db/sqlalchemy/migration.py", line 133, in db_version
2015-07-24 09:10:04.664 19194 TRACE keystone     "The database is not under version control, but has "
2015-07-24 09:10:04.664 19194 TRACE keystone DbMigrationError: The database is not under version control, but has tables. Please stamp the current version of ...
(more)
edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
1

answered 2015-07-24 06:02:59 -0500

foexle gravatar image

Ok, the problem was a mistake of permissions in my database (postgres).

  • Dump original Database
  • create new testing database
  • create new user
  • grant all privileges
  • restore db to testing DB
  • Schema of testing db tables, owner was original user not testing user

Solving this, the migration works well.

In addition, the Icehouse migration_version is 44!

 keystone      | /usr/lib/python2.7/dist-packages/keystone/common/sql/migrate_repo |      44

Cheers Heiko

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2015-07-24 04:20:32 -0500

Seen: 677 times

Last updated: Jul 24 '15