nova-manage db sync --version <version number> command failed with stack trace.

Bug #1815726 reported by Sagar Waghmare
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
In Progress
Undecided
Sagar Waghmare

Bug Description

nova-manage db sync --version <version number> is failing with stack trace as below,

[stack@hostname ~]$ nova-manage db sync --version 392
.
.
.
ERROR: Could not access cell0.
Has the nova_api database been created?
Has the nova_cell0 database been created?
Has "nova-manage api_db sync" been run?
Has "nova-manage cell_v2 map_cell0" been run?
Is [api_database]/connection set in nova.conf?
Is the cell0 database connection URL correct?
Error: "Database schema file with version 392 doesn't exist."
An error has occurred:
Traceback (most recent call last):
  File "/opt/stack/nova/nova/cmd/manage.py", line 2357, in main
    ret = fn(*fn_args, **fn_kwargs)
  File "/opt/stack/nova/nova/cmd/manage.py", line 490, in sync
    return migration.db_sync(version)
  File "/opt/stack/nova/nova/db/migration.py", line 26, in db_sync
    return IMPL.db_sync(version=version, database=database, context=context)
  File "/opt/stack/nova/nova/db/sqlalchemy/migration.py", line 61, 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 "<decorator-gen-15>", line 2, in _migrate
  File "/usr/lib/python2.7/site-packages/migrate/versioning/util/__init__.py", line 167, in with_engine
    return f(*a, **kw)
  File "/usr/lib/python2.7/site-packages/migrate/versioning/api.py", line 345, in _migrate
    changeset = schema.changeset(version)
  File "/usr/lib/python2.7/site-packages/migrate/versioning/schema.py", line 82, in changeset
    changeset = self.repository.changeset(database, start_ver, version)
  File "/usr/lib/python2.7/site-packages/migrate/versioning/repository.py", line 225, in changeset
    changes = [self.version(v).script(database, op) for v in versions]
  File "/usr/lib/python2.7/site-packages/migrate/versioning/repository.py", line 189, in version
    return self.versions.version(*p, **k)
  File "/usr/lib/python2.7/site-packages/migrate/versioning/version.py", line 174, in version
    "exist.") % {'args': VerNum(vernum)})
VersionNotFoundError: "Database schema file with version 392 doesn't exist."

As, '--version' parameter was deprecated in the Pike cycle and will not be supported in future versions of nova, the expected error message is as below,

ERROR: Could not access cell0.
Has the nova_api database been created?
Has the nova_cell0 database been created?
Has "nova-manage api_db sync" been run?
Has "nova-manage cell_v2 map_cell0" been run?
Is [api_database]/connection set in nova.conf?
Is the cell0 database connection URL correct?
Error: "Database schema file with version 392 doesn't exist."

Openstack version: openstack 3.17.0 (Rocky)

Tags: nova-manage
Changed in nova:
status: New → Confirmed
Changed in nova:
assignee: nobody → Sagar Waghmare (sagarwaghmare92)
Changed in nova:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (stable/rocky)

Fix proposed to branch: stable/rocky
Review: https://review.openstack.org/637491

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on nova (stable/rocky)

Change abandoned by Sagar Waghmare (<email address hidden>) on branch: stable/rocky
Review: https://review.openstack.org/637491

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

Fix proposed to branch: master
Review: https://review.openstack.org/639591

tags: added: nova-manage
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on nova (master)

Change abandoned by Stephen Finucane (<email address hidden>) on branch: master
Review: https://review.opendev.org/639591
Reason: This was completed in change Iff2a23e09f2c5330b8fc0e9456860b65bd6ac149 so I'm abandoning this

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.