Ocata - "nova-manage db sync" fails

asked 2017-06-24 10:13:41 -0600

Elangovan Anganann gravatar image

I am installing OpenStack (Ocata) following RDO Install Guide. When I ran nova-manage db sync command, I got the error ERROR: could not access cell mapping database - has api db been created?. I have provided the command output below. What could be the issue?

[root@controller1 ~ (admin)]# su -s /bin/sh -c "nova-manage db sync" nova
/usr/lib/python2.7/site-packages/pymysql/cursors.py:166: Warning: (1831, u'Duplicate index `block_device_mapping_instance_uuid_virtual_name_device_name_idx`. This is deprecated and will be disallowed in a future release.')
  result = self._query(query)
/usr/lib/python2.7/site-packages/pymysql/cursors.py:166: Warning: (1831, u'Duplicate index `uniq_instances0uuid`. This is deprecated and will be disallowed in a future release.')
  result = self._query(query)
ERROR: could not access cell mapping database - has api db been created?
An error has occurred:
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/nova/cmd/manage.py", line 1594, in main
    ret = fn(*fn_args, **fn_kwargs)
  File "/usr/lib/python2.7/site-packages/nova/cmd/manage.py", line 644, in sync
    return migration.db_sync(version)
  File "/usr/lib/python2.7/site-packages/nova/db/migration.py", line 26, in db_sync
    return IMPL.db_sync(version=version, database=database, context=context)
  File "/usr/lib/python2.7/site-packages/nova/db/sqlalchemy/migration.py", line 57, in db_sync
    repository, version)
  File "/usr/lib/python2.7/site-packages/migrate/versioning/api.py", line 186, in upgrade
    return _migrate(url, repository, version, upgrade=True, err=err, **opts)
  File "<string>", line 2, in _migrate
  File "/usr/lib/python2.7/site-packages/migrate/versioning/util/__init__.py", line 160, in with_engine
    return f(*a, **kw)
  File "/usr/lib/python2.7/site-packages/migrate/versioning/api.py", line 366, in _migrate
    schema.runchange(ver, change, changeset.step)
  File "/usr/lib/python2.7/site-packages/migrate/versioning/schema.py", line 91, in runchange
    (self.version, startver))
InvalidVersionError: 317 is not 318

What could be the issue?

edit retag flag offensive close merge delete

Comments

My guess: You forgot to populate the api database (step 3 in https://docs.openstack.org/ocata/inst...), or this step failed. Or perhaps another DB step in that chapter.

Bernd Bausch gravatar imageBernd Bausch ( 2017-06-24 10:29:58 -0600 )edit

Drop the cell0 database and recreate it. Then try populating the nova db.

Praveen N gravatar imagePraveen N ( 2017-06-27 11:21:14 -0600 )edit

I too face this issue in spite of following each step in tje above installation steps.. Please elaborate on 'drop the cell0 data base' how to do it?

hai_senthil gravatar imagehai_senthil ( 2017-07-10 01:01:57 -0600 )edit

I deletd (DROP) cell0 as you said and recreated as per the instructions.. This time I got this error

DBNonExistentTable: (sqlite3.OperationalError) no such table: cell_mappings [SQL: u'INSERT INTO cell_ mappings (created_at, updated_at, uuid, name, transport_url, database_connection) VALU

hai_senthil gravatar imagehai_senthil ( 2017-07-10 01:11:56 -0600 )edit

I recreated it. I got the error : "NovaException: Upgrade DB using Essex release first." Any help

hai_senthil gravatar imagehai_senthil ( 2017-07-10 01:25:41 -0600 )edit