'GetPMEMNamespacesFailed' is not a valid exception

Bug #1904446 reported by Stephen Finucane on 2020-11-16
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Medium
Stephen Finucane
Train
Undecided
Stephen Finucane
Ussuri
Undecided
Stephen Finucane
Victoria
Undecided
Stephen Finucane

Bug Description

Attempting to retrieve a non-existent PMEM device results in the following traceback:

    ./nova-compute.log.1:2020-11-16 16:01:22.704 7 ERROR nova During handling of the above exception, another exception occurred:
    ./nova-compute.log.1:2020-11-16 16:01:22.704 7 ERROR nova
    ./nova-compute.log.1:2020-11-16 16:01:22.704 7 ERROR nova Traceback (most recent call last):
    ./nova-compute.log.1:2020-11-16 16:01:22.704 7 ERROR nova File "/usr/bin/nova-compute", line 10, in <module>
    ./nova-compute.log.1:2020-11-16 16:01:22.704 7 ERROR nova sys.exit(main())
    ./nova-compute.log.1:2020-11-16 16:01:22.704 7 ERROR nova File "/usr/lib/python3.6/site-packages/nova/cmd/compute.py", line 57, in main
    ./nova-compute.log.1:2020-11-16 16:01:22.704 7 ERROR nova topic=compute_rpcapi.RPC_TOPIC)
    ./nova-compute.log.1:2020-11-16 16:01:22.704 7 ERROR nova File "/usr/lib/python3.6/site-packages/nova/service.py", line 271, in create
    ./nova-compute.log.1:2020-11-16 16:01:22.704 7 ERROR nova periodic_interval_max=periodic_interval_max)
    ./nova-compute.log.1:2020-11-16 16:01:22.704 7 ERROR nova File "/usr/lib/python3.6/site-packages/nova/service.py", line 129, in __init__
    ./nova-compute.log.1:2020-11-16 16:01:22.704 7 ERROR nova self.manager = manager_class(host=self.host, *args, **kwargs)
    ./nova-compute.log.1:2020-11-16 16:01:22.704 7 ERROR nova File "/usr/lib/python3.6/site-packages/nova/compute/manager.py", line 571, in __init__
    ./nova-compute.log.1:2020-11-16 16:01:22.704 7 ERROR nova self.driver = driver.load_compute_driver(self.virtapi, compute_driver)
    ./nova-compute.log.1:2020-11-16 16:01:22.704 7 ERROR nova File "/usr/lib/python3.6/site-packages/nova/virt/driver.py", line 1911, in load_compute_driver
    ./nova-compute.log.1:2020-11-16 16:01:22.704 7 ERROR nova virtapi)
    ./nova-compute.log.1:2020-11-16 16:01:22.704 7 ERROR nova File "/usr/lib/python3.6/site-packages/oslo_utils/importutils.py", line 44, in import_object
    ./nova-compute.log.1:2020-11-16 16:01:22.704 7 ERROR nova return import_class(import_str)(*args, **kwargs)
    ./nova-compute.log.1:2020-11-16 16:01:22.704 7 ERROR nova File "/usr/lib/python3.6/site-packages/nova/virt/libvirt/driver.py", line 446, in __init__
    ./nova-compute.log.1:2020-11-16 16:01:22.704 7 ERROR nova vpmem_conf=CONF.libvirt.pmem_namespaces)
    ./nova-compute.log.1:2020-11-16 16:01:22.704 7 ERROR nova File "/usr/lib/python3.6/site-packages/nova/virt/libvirt/driver.py", line 477, in _discover_vpmems
    ./nova-compute.log.1:2020-11-16 16:01:22.704 7 ERROR nova vpmems_host = self._get_vpmems_on_host()
    ./nova-compute.log.1:2020-11-16 16:01:22.704 7 ERROR nova File "/usr/lib/python3.6/site-packages/nova/virt/libvirt/driver.py", line 512, in _get_vpmems_on_host
    ./nova-compute.log.1:2020-11-16 16:01:22.704 7 ERROR nova raise exception.GetPMEMNamespacesFailed(reason=reason)
    ./nova-compute.log.1:2020-11-16 16:01:22.704 7 ERROR nova AttributeError: module 'nova.exception' has no attribute 'GetPMEMNamespacesFailed'
    ./nova-compute.log.1:2020-11-16 16:01:22.704 7 ERROR nova

It seems there was a typo introduced when this code was added. The code referenced 'GetPMEMNamespacesFailed' but the exception, which has since been removed since it was "unused", was called 'GetPMEMNamespaceFailed'.

Changed in nova:
importance: Undecided → Medium
status: New → Confirmed
tags: added: libvirt

Fix proposed to branch: master
Review: https://review.opendev.org/762898

Changed in nova:
assignee: nobody → Stephen Finucane (stephenfinucane)
status: Confirmed → In Progress

Reviewed: https://review.opendev.org/762898
Committed: https://opendev.org/openstack/nova/commit/160ed6ff652b80cd0a86d41dc3f66c15cee66290
Submitter: Zuul
Branch: master

commit 160ed6ff652b80cd0a86d41dc3f66c15cee66290
Author: Stephen Finucane <email address hidden>
Date: Mon Nov 16 17:35:07 2020 +0000

    Add missing exception

    Change Idd49b0c70caedfcd42420ffa2ac926a6087d406e added support for
    discovery of PMEM devices by the libvirt driver. Some error handling
    code in this was expected to raise a 'GetPMEMNamespacesFailed'
    exception, however, a typo meant the exception was actually called
    'GetPMEMNamespaceFailed' (singular). This exception was later removed in
    change I6fd027fb51823b8a8a24ed7b864a2191c4e8e8c0 because it had no
    references.

    Re-introduce the exception, this time with the correct name, and add
    some unit tests to prevent us regressing.

    Change-Id: I3b597a46314a1b29a952fc0f7a9c4537341e37b8
    Signed-off-by: Stephen Finucane <email address hidden>
    Closes-Bug: #1904446

Changed in nova:
status: In Progress → Fix Released

This issue was fixed in the openstack/nova 22.1.0 release.

This issue was fixed in the openstack/nova 23.0.0.0rc1 release candidate.

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

Other bug subscribers