Ask Your Question
1

mitaka nova - db sync produces error: Upgrade DB using Essex release first.

asked 2016-08-04 07:52:44 -0600

rjr gravatar image

updated 2017-07-19 15:32:11 -0600

rbowen gravatar image

RHEL 7.2 - mitaka. running su -s /bin/sh -c "nova-manage db sync" nova and i get an error saying "error: Upgrade DB using Essex release first." I've seen this exact error on another mailing list but nobody answered the question. I believe my nova.conf is correct and I've dropped and re-added the nova db.

this is the nova-manage.log output

2016-08-08 10:33:22.517 183254 ERROR nova.db.sqlalchemy.migration [-] list index out of range
2016-08-08 10:33:22.517 183254 ERROR nova.db.sqlalchemy.migration Traceback (most recent call last):
2016-08-08 10:33:22.517 183254 ERROR nova.db.sqlalchemy.migration   File "/usr/lib/python2.7/site-packages/nova/db/sqlalchemy/migration.py", line 66, in db_version
2016-08-08 10:33:22.517 183254 ERROR nova.db.sqlalchemy.migration     return versioning_api.db_version(get_engine(database), repository)
2016-08-08 10:33:22.517 183254 ERROR nova.db.sqlalchemy.migration   File "<string>", line 2, in db_version
2016-08-08 10:33:22.517 183254 ERROR nova.db.sqlalchemy.migration   File "/usr/lib/python2.7/site-packages/migrate/versioning/util/__init__.py", line 160, in with_engine
2016-08-08 10:33:22.517 183254 ERROR nova.db.sqlalchemy.migration     return f(*a, **kw)
2016-08-08 10:33:22.517 183254 ERROR nova.db.sqlalchemy.migration   File "/usr/lib/python2.7/site-packages/migrate/versioning/api.py", line 148, in db_version
2016-08-08 10:33:22.517 183254 ERROR nova.db.sqlalchemy.migration     schema = ControlledSchema(engine, repository)
2016-08-08 10:33:22.517 183254 ERROR nova.db.sqlalchemy.migration   File "/usr/lib/python2.7/site-packages/migrate/versioning/schema.py", line 33, in __init__
2016-08-08 10:33:22.517 183254 ERROR nova.db.sqlalchemy.migration     self.load()
2016-08-08 10:33:22.517 183254 ERROR nova.db.sqlalchemy.migration   File "/usr/lib/python2.7/site-packages/migrate/versioning/schema.py", line 54, in load
2016-08-08 10:33:22.517 183254 ERROR nova.db.sqlalchemy.migration     exceptions.DatabaseNotControlledError(str(exc)), tb)
2016-08-08 10:33:22.517 183254 ERROR nova.db.sqlalchemy.migration   File "/usr/lib/python2.7/site-packages/migrate/versioning/schema.py", line 50, in load
2016-08-08 10:33:22.517 183254 ERROR nova.db.sqlalchemy.migration     data = list(result)[0]
2016-08-08 10:33:22.517 183254 ERROR nova.db.sqlalchemy.migration DatabaseNotControlledError: list index out of range
2016-08-08 10:33:22.517 183254 ERROR nova.db.sqlalchemy.migration

If I drop both databases and re-add but run the db sync on the nova db first it will not error but I then get this same error on the nova_api db sync.

edit retag flag offensive close merge delete

Comments

nobody has seen this error????

rjr gravatar imagerjr ( 2016-08-05 15:02:49 -0600 )edit

This is the nova-manage.log

2016-08-08 10:33:22.517 183254 ERROR nova.db.sqlalchemy.migration [-] list index out of range 2016-08-08 10:33:22.517 183254 ERROR nova.db.sqlalchemy.migration Traceback (most recent call last): 2016-08-08 10:33:22.517 183254 ERROR nova.db.sqlalchemy.migration File "/u

rjr gravatar imagerjr ( 2016-08-08 09:34:21 -0600 )edit

3 answers

Sort by ยป oldest newest most voted
4

answered 2016-08-08 12:12:08 -0600

rjr gravatar image

updated 2017-07-19 15:32:34 -0600

rbowen gravatar image

I figured this out. It was an error in my /etc/nova/nova.conf. I had connection = mysql+pymysql://nova:NOVA_DBPASS@controller/nova_api as the connection setting in both [api_database] and [database]

edit flag offensive delete link more

Comments

Just to add more detail here as I had to same issue.

If you configured your [database] key to have the string mysql+pymysql://nova:NOVA_DBPASS@controller/nova_api change it to mysql+pymysql://nova:NOVA_DBPASS@controller/nova

run the scripts again!

R+ gravatar imageR+ ( 2016-08-15 08:31:21 -0600 )edit

i am running the script with all the changes but still having same issue and getting same exception..Any workaround for this?

Ruchir Nerurkar gravatar imageRuchir Nerurkar ( 2017-07-12 18:20:57 -0600 )edit

even i have same issue... the above ans dint solve my problem

Spoorthi Vaidya gravatar imageSpoorthi Vaidya ( 2019-05-13 03:42:20 -0600 )edit
1

answered 2017-07-26 15:54:49 -0600

JTJohnson gravatar image

To make this even more clear:

Make sure the database connection string for the api_database is the one that ends in nova_api and the one for database ends in just nova.

[api_database] connection = mysql+pymysql://nova:password@controller/nova_api

[database] connection = mysql+pymysql://nova:password@controller/nova

edit flag offensive delete link more
1

answered 2017-01-03 10:18:02 -0600

eriksh7 gravatar image

I had the same problem with Newton release except that it was not a typo. it was the sqlite line that referred to a deleted db (advised by official installation guide)

comment those out in both [database] and [api_database]

connection=sqlite:////var/lib/nova/nova.sqlite

then it will populate normally

/bin/sh -c "nova-manage api_db sync" nova

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: 2016-08-04 07:52:44 -0600

Seen: 3,660 times

Last updated: Jul 26 '17