volume.snapshot.size broken due to user_id attributeerror

Bug #1794475 reported by Tobias Urdin
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ceilometer
Fix Released
Undecided
Tobias Urdin

Bug Description

Ceilometer is polling snapshots using cinderclient volume_snapshots.list() but for some reason it's not using the api_version >= 3.41 which makes sure user_id is included in the output data.

This causes an attributeerror
2018-09-26 11:21:45.696 26825 INFO ceilometer.polling.manager [-] Polling pollster volume.snapshot.size in the context of some_pollsters
2018-09-26 11:21:45.697 26825 ERROR ceilometer.polling.manager [-] Continue after error from volume.snapshot.size: user_id: AttributeError: user_id
2018-09-26 11:21:45.697 26825 ERROR ceilometer.polling.manager Traceback (most recent call last):
2018-09-26 11:21:45.697 26825 ERROR ceilometer.polling.manager File "/usr/lib/python2.7/site-packages/ceilometer/polling/manager.py", line 204, in poll_and_notify
2018-09-26 11:21:45.697 26825 ERROR ceilometer.polling.manager for sample in samples:
2018-09-26 11:21:45.697 26825 ERROR ceilometer.polling.manager File "/usr/lib/python2.7/site-packages/ceilometer/volume/cinder.py", line 85, in get_samples
2018-09-26 11:21:45.697 26825 ERROR ceilometer.polling.manager user_id=snapshot.user_id,
2018-09-26 11:21:45.697 26825 ERROR ceilometer.polling.manager File "/usr/lib/python2.7/site-packages/cinderclient/apiclient/base.py", line 510, in __getattr__
2018-09-26 11:21:45.697 26825 ERROR ceilometer.polling.manager raise AttributeError(k)
2018-09-26 11:21:45.697 26825 ERROR ceilometer.polling.manager AttributeError: user_id

It must use atleast 3.41 here [1] or we need to check before accessing the value here [2]

[1] https://github.com/openstack/ceilometer/blob/stable/rocky/ceilometer/volume/discovery.py#L32
[2] https://github.com/openstack/ceilometer/blob/stable/rocky/ceilometer/volume/cinder.py#L85

summary: - volume.snapshot.size broken due to user_id not in dict
+ volume.snapshot.size broken due to user_id attributeerror
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to ceilometer (master)

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

Changed in ceilometer:
assignee: nobody → Tobias Urdin (tobias-urdin)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to ceilometer (master)

Reviewed: https://review.openstack.org/605459
Committed: https://git.openstack.org/cgit/openstack/ceilometer/commit/?id=be524d2b74ad61fd208a505980af00fefe37022c
Submitter: Zuul
Branch: master

commit be524d2b74ad61fd208a505980af00fefe37022c
Author: Tobias Urdin <email address hidden>
Date: Wed Sep 26 17:25:01 2018 +0200

    Volume discovery minimum 3.43 api version

    Set the volume api version to 3.43 to make
    sure we get 3.41 change where it exposes
    the user_id for snapshots.

    This will fix the volume.snapshot.size metric
    that is not working when trying to access the
    user_id throws a AttributeError.

    Change-Id: I2414717e7c9e64b0092fe93c97a062a48dbf09a8
    Closes-Bug: 1794475

Changed in ceilometer:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to ceilometer (stable/rocky)

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

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

Reviewed: https://review.openstack.org/609444
Committed: https://git.openstack.org/cgit/openstack/ceilometer/commit/?id=6ed05135a8b25c811f980950d88635e68bfbf179
Submitter: Zuul
Branch: stable/rocky

commit 6ed05135a8b25c811f980950d88635e68bfbf179
Author: Tobias Urdin <email address hidden>
Date: Wed Sep 26 17:25:01 2018 +0200

    Volume discovery minimum 3.43 api version

    Set the volume api version to 3.43 to make
    sure we get 3.41 change where it exposes
    the user_id for snapshots.

    This will fix the volume.snapshot.size metric
    that is not working when trying to access the
    user_id throws a AttributeError.

    Change-Id: I2414717e7c9e64b0092fe93c97a062a48dbf09a8
    Closes-Bug: 1794475
    (cherry picked from commit be524d2b74ad61fd208a505980af00fefe37022c)

tags: added: in-stable-rocky
Revision history for this message
Tobias Urdin (tobias-urdin) wrote :

This will be released in 11.0.1 release https://review.openstack.org/#/c/609650/

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

This issue was fixed in the openstack/ceilometer 11.0.1 release.

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

This issue was fixed in the openstack/ceilometer 12.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.