'GetPMEMNamespacesFailed' is not a valid exception

Bug #1904446 reported by Stephen Finucane
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Medium
Stephen Finucane
Train
Fix Released
Undecided
Stephen Finucane
Ussuri
Fix Released
Undecided
Stephen Finucane
Victoria
Fix Released
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'.

Tags: libvirt
Changed in nova:
importance: Undecided → Medium
status: New → Confirmed
tags: added: libvirt
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

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

Changed in nova:
assignee: nobody → Stephen Finucane (stephenfinucane)
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

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
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (stable/victoria)

Fix proposed to branch: stable/victoria
Review: https://review.opendev.org/763389

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

Fix proposed to branch: stable/ussuri
Review: https://review.opendev.org/763390

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

Fix proposed to branch: stable/train
Review: https://review.opendev.org/763393

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/nova 22.1.0

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

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/nova 23.0.0.0rc1

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

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/nova 21.2.1

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

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (stable/train)

Reviewed: https://review.opendev.org/c/openstack/nova/+/763393
Committed: https://opendev.org/openstack/nova/commit/eaecd1ceb0243b31cde9b3c909e8fb3fbef7e635
Submitter: "Zuul (22348)"
Branch: stable/train

commit eaecd1ceb0243b31cde9b3c909e8fb3fbef7e635
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.

    Conflicts:
            nova/exception.py

    NOTE(stephenfin): Conflicts are because change
    I6fd027fb51823b8a8a24ed7b864a2191c4e8e8c0 doesn't exist on this branch,
    meaning the misnamed exception still exists and simply needs to be
    renamed.

    Change-Id: I3b597a46314a1b29a952fc0f7a9c4537341e37b8
    Signed-off-by: Stephen Finucane <email address hidden>
    Closes-Bug: #1904446
    (cherry picked from commit 160ed6ff652b80cd0a86d41dc3f66c15cee66290)
    (cherry picked from commit 82d415d200e39a5c11fe134e9ef62e427988f2ba)
    (cherry picked from commit 8f65de96a07623c6a8a9cd49db942ad6d4d3ab03)

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/nova train-eol

This issue was fixed in the openstack/nova train-eol release.

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.