Public bug reported:

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)

** Affects: nova
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Compute (nova).
https://bugs.launchpad.net/bugs/1815726

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

Status in OpenStack Compute (nova):
  New

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)

To manage notifications about this bug go to:
https://bugs.launchpad.net/nova/+bug/1815726/+subscriptions

-- 
Mailing list: https://launchpad.net/~yahoo-eng-team
Post to     : yahoo-eng-team@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yahoo-eng-team
More help   : https://help.launchpad.net/ListHelp

Reply via email to