TypeError when computing QOS feature name

Bug #1948507 reported by Luciano Lo Giudice
16
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Cinder
Fix Released
Low
Luciano Lo Giudice
Ubuntu Cloud Archive
Fix Released
High
Unassigned
Wallaby
Fix Released
High
Unassigned
Xena
Fix Released
High
Unassigned
Yoga
Fix Released
High
Unassigned
cinder (Ubuntu)
Fix Released
High
Unassigned
Impish
Won't Fix
High
Unassigned
Jammy
Fix Released
High
Unassigned

Bug Description

=========== Bug description =============

The utility function 'qos_min_feature_name' computes the QOS by concatenating a prefix to a node name. However, under some circumstances, it's possible that the node name is `None`, thus raising a TypeError. This can happen for example, if the 'storage.aggregate' feature is not present (or the user doesn't have privileges for it), which leads to an always-None node_name (see the method '_get_ssc_aggregate_info' in volume/drivers/netapp/utils/capabilities:270)

An easy fix is to check for `None`, and if so, return an empty string.

=========== SRU details for Ubuntu =============

[Impact]
See above.

[Test Case]
charm-cinder-netapp gate fails (https://review.opendev.org/c/openstack/charm-cinder-netapp/+/815130) with the following when unpatched:

2021-11-22 21:17:10.298776 | focal-medium | 2021-11-22 21:17:10 [INFO] test_create_volume (zaza.openstack.charm_tests.cinder_netapp.tests.CinderNetAppTest)
2021-11-22 21:17:10.298864 | focal-medium | 2021-11-22 21:17:10 [INFO] Test creating volumes with basic configuration.
2021-11-22 21:17:10.298940 | focal-medium | 2021-11-22 21:17:10 [INFO] ...
2021-11-22 21:17:34.664694 | focal-medium | 2021-11-22 21:17:34 [INFO] Volume status wait: resource 26a180f3-07d3-4297-99ff-6f7045b8b7d8 in available state, waiting for available
2021-11-22 21:17:36.016716 | focal-medium | 2021-11-22 21:17:36 [INFO] ERROR
2021-11-22 21:17:36.016827 | focal-medium | 2021-11-22 21:17:36 [INFO] ======================================================================
2021-11-22 21:17:36.016905 | focal-medium | 2021-11-22 21:17:36 [INFO] ERROR: test_create_volume (zaza.openstack.charm_tests.cinder_netapp.tests.CinderNetAppTest)
2021-11-22 21:17:36.016915 | focal-medium | 2021-11-22 21:17:36 [INFO] Test creating volumes with basic configuration.
2021-11-22 21:17:36.016922 | focal-medium | 2021-11-22 21:17:36 [INFO] ----------------------------------------------------------------------
2021-11-22 21:17:36.016930 | focal-medium | 2021-11-22 21:17:36 [INFO] Traceback (most recent call last):
2021-11-22 21:17:36.016938 | focal-medium | 2021-11-22 21:17:36 [INFO] File "/home/ubuntu/src/review.opendev.org/openstack/charm-cinder-netapp/build/builds/cinder-netapp/.tox/func-target/lib/python3.8/site-packages/zaza/openstack/charm_tests/cinder_netapp/tests.py", line 93, in test_create_volume
2021-11-22 21:17:36.017021 | focal-medium | 2021-11-22 21:17:36 [INFO] host = getattr(test_vol, 'os-vol-host-attr:host').split('#')[0]
2021-11-22 21:17:36.017030 | focal-medium | 2021-11-22 21:17:36 [INFO] AttributeError: 'NoneType' object has no attribute 'split'
2021-11-22 21:17:36.017037 | focal-medium | 2021-11-22 21:17:36 [INFO] ----------------------------------------------------------------------

[Regression Potential]

It's possible that a user may expect the QOS to be non-empty and make
some assertions based on that assumption. In addition, a user may
expect an exception of type `TypeError` to be raised when the node name
is None.

tags: added: low-hanging-fruit qos type-error
Changed in cinder:
importance: Undecided → Low
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to cinder (master)

Fix proposed to branch: master
Review: https://review.opendev.org/c/openstack/cinder/+/815560

Changed in cinder:
status: New → In Progress
Changed in cinder:
assignee: nobody → Luciano Lo Giudice (lmlogiudice)
description: updated
description: updated
description: updated
Changed in cinder (Ubuntu Jammy):
status: New → Triaged
importance: Undecided → High
Changed in cloud-archive:
status: Triaged → Fix Committed
Revision history for this message
Corey Bryant (corey.bryant) wrote :

This bug was fixed in the package cinder - 2:19.0.0+git2022030310.b49fb59a6-0ubuntu2~cloud0
---------------

 cinder (2:19.0.0+git2022030310.b49fb59a6-0ubuntu2~cloud0) focal-yoga; urgency=medium
 .
   * New update for the Ubuntu Cloud Archive.
 .
 cinder (2:19.0.0+git2022030310.b49fb59a6-0ubuntu2) jammy; urgency=medium
 .
   * d/p/fix-qos-computation.patch: Cherry-pick from upstream review to
     fix TypeError exception when generating QOS feature name (LP: #1948507).

Changed in cloud-archive:
status: Fix Committed → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package cinder - 2:19.0.0+git2022030310.b49fb59a6-0ubuntu2

---------------
cinder (2:19.0.0+git2022030310.b49fb59a6-0ubuntu2) jammy; urgency=medium

  * d/p/fix-qos-computation.patch: Cherry-pick from upstream review to
    fix TypeError exception when generating QOS feature name (LP: #1948507).

 -- Corey Bryant <email address hidden> Tue, 15 Mar 2022 11:08:32 -0400

Changed in cinder (Ubuntu Jammy):
status: Triaged → Fix Released
Changed in cinder (Ubuntu Impish):
status: New → Triaged
importance: Undecided → High
Revision history for this message
Corey Bryant (corey.bryant) wrote :

Uploaded to ubuntu impish unapproved queue and wallaby-staging cloud archive.

Revision history for this message
Brian Murray (brian-murray) wrote : Please test proposed package

Hello Luciano, or anyone else affected,

Accepted cinder into impish-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/cinder/2:19.0.0-0ubuntu4 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed-impish to verification-done-impish. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-impish. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in cinder (Ubuntu Impish):
status: Triaged → Fix Committed
tags: added: verification-needed verification-needed-impish
Revision history for this message
Corey Bryant (corey.bryant) wrote :

Hello Luciano, or anyone else affected,

Accepted cinder into xena-proposed. The package will build now and be available in the Ubuntu Cloud Archive in a few hours, and then in the -proposed repository.

Please help us by testing this new package. To enable the -proposed repository:

  sudo add-apt-repository cloud-archive:xena-proposed
  sudo apt-get update

Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-xena-needed to verification-xena-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-xena-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

tags: added: verification-xena-needed
Revision history for this message
Corey Bryant (corey.bryant) wrote :

Hello Luciano, or anyone else affected,

Accepted cinder into wallaby-proposed. The package will build now and be available in the Ubuntu Cloud Archive in a few hours, and then in the -proposed repository.

Please help us by testing this new package. To enable the -proposed repository:

  sudo add-apt-repository cloud-archive:wallaby-proposed
  sudo apt-get update

Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-wallaby-needed to verification-wallaby-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-wallaby-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

tags: added: verification-wallaby-needed
Revision history for this message
Corey Bryant (corey.bryant) wrote :

focal-xena and focal-wallaby are both successful in the charm-cinder-netapp gate when running with proposed: https://review.opendev.org/c/openstack/charm-cinder-netapp/+/833770

tags: added: verification-wallaby-done verification-xena-done
removed: verification-wallaby-needed verification-xena-needed
Revision history for this message
Corey Bryant (corey.bryant) wrote : Update Released

The verification of the Stable Release Update for cinder has completed successfully and the package has now been released to -updates. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

Revision history for this message
Corey Bryant (corey.bryant) wrote :

This bug was fixed in the package cinder - 2:19.0.0-0ubuntu4~cloud0
---------------

 cinder (2:19.0.0-0ubuntu4~cloud0) focal-xena; urgency=medium
 .
   * New update for the Ubuntu Cloud Archive.
 .
 cinder (2:19.0.0-0ubuntu4) impish; urgency=medium
 .
   * d/p/fix-qos-computation.patch: Cherry-pick from upstream review to
     fix TypeError exception when generating QOS feature name (LP: #1948507).

Revision history for this message
Corey Bryant (corey.bryant) wrote :

The verification of the Stable Release Update for cinder has completed successfully and the package has now been released to -updates. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

Revision history for this message
Corey Bryant (corey.bryant) wrote :

This bug was fixed in the package cinder - 2:18.1.0-0ubuntu1~cloud2
---------------

 cinder (2:18.1.0-0ubuntu1~cloud2) focal-wallaby; urgency=medium
 .
   * d/p/fix-qos-computation.patch: Cherry-pick from upstream review to
     fix TypeError exception when generating QOS feature name (LP: #1948507).

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

Reviewed: https://review.opendev.org/c/openstack/cinder/+/815560
Committed: https://opendev.org/openstack/cinder/commit/d83a2289d582ad137017f9589c2e42e8d1543c13
Submitter: "Zuul (22348)"
Branch: master

commit d83a2289d582ad137017f9589c2e42e8d1543c13
Author: Luciano Lo Giudice <email address hidden>
Date: Tue Oct 26 19:08:07 2021 -0300

    Fix QOS computation

    It's possible for a volume's node name to be `None` (because an
    API is not present, or the user doesn't have privileges, for example).
    For these cases, computing the QOS name can lead to a TypeError, since
    it needs to concatenate a prefix to the node name. This patchset fixes
    this problem by returning an empty string for the QOS if the node name
    is indeed None.

    Closes-Bug: #1948507
    Change-Id: I16d7bf9fb023f3bc7be0fc8e3e08421b2754d5a5

Changed in cinder:
status: In Progress → Fix Released
Revision history for this message
Brian Murray (brian-murray) wrote : Please test proposed package

Hello Luciano, or anyone else affected,

Accepted cinder into impish-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/cinder/2:19.1.0-0ubuntu1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed-impish to verification-done-impish. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-impish. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Revision history for this message
Ubuntu SRU Bot (ubuntu-sru-bot) wrote : Autopkgtest regression report (cinder/2:19.1.0-0ubuntu1)

All autopkgtests for the newly accepted cinder (2:19.1.0-0ubuntu1) for impish have finished running.
The following regressions have been reported in tests triggered by the package:

cinder/2:19.1.0-0ubuntu1 (armhf)
nova/3:24.0.0-0ubuntu1 (armhf)

Please visit the excuses page listed below and investigate the failures, proceeding afterwards as per the StableReleaseUpdates policy regarding autopkgtest regressions [1].

https://people.canonical.com/~ubuntu-archive/proposed-migration/impish/update_excuses.html#cinder

[1] https://wiki.ubuntu.com/StableReleaseUpdates#Autopkgtest_Regressions

Thank you!

Revision history for this message
Brian Murray (brian-murray) wrote :

Ubuntu 21.10 (Impish Indri) has reached end of life, so this bug will not be fixed for that specific release.

Changed in cinder (Ubuntu Impish):
status: Fix Committed → Won't Fix
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/cinder 21.0.0.0rc1

This issue was fixed in the openstack/cinder 21.0.0.0rc1 release candidate.

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.