audit middleware unable to handle services with no endpoints

Bug #1800017 reported by Guang Yee on 2018-10-25
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
keystonemiddleware
Medium
Guang Yee

Bug Description

If a service does not contain any endpoints for whatever reason, audit middleware will fail to parse the service catalog. Consequently, you may see the service logs flooded with tracebacks similar to this.

2018-10-24 21:15:35.615 3885 ERROR keystonemiddleware.audit File "/opt/stack/venv/nova-20181024T070321Z/lib/python2.7/site-packages/keystonemiddleware/audit/_api.py", line 264, in get_target_resource
2018-10-24 21:15:35.615 3885 ERROR keystonemiddleware.audit endpoint_urls = endp['endpoints'][0]
2018-10-24 21:15:35.615 3885 ERROR keystonemiddleware.audit IndexError: list index out of range

See

https://github.com/openstack/keystonemiddleware/blob/stable/rocky/keystonemiddleware/audit/_api.py#L264

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

Changed in keystonemiddleware:
assignee: nobody → Guang Yee (guang-yee)
status: New → In Progress
Changed in keystonemiddleware:
importance: Undecided → Medium

Reviewed: https://review.openstack.org/613410
Committed: https://git.openstack.org/cgit/openstack/keystonemiddleware/commit/?id=6779838a242b222672721407cc320672ab24067a
Submitter: Zuul
Branch: master

commit 6779838a242b222672721407cc320672ab24067a
Author: Guang Yee <email address hidden>
Date: Thu Oct 25 13:01:23 2018 -0700

    Skip the services with no endpoints when parsing service catalog

    When parsing the service catalog to find the source, audit middleware
    should skip over the services which have no endpoints instead of
    assuming they will have at least one endpoint.

    Change-Id: I287873e99338d95baaf20d52ecb3a43763a401fc
    Closes-Bug: #1800017

Changed in keystonemiddleware:
status: In Progress → Fix Released

Reviewed: https://review.openstack.org/614021
Committed: https://git.openstack.org/cgit/openstack/keystonemiddleware/commit/?id=e37bbe0a116689043e8c3ec8867bbb3eae062093
Submitter: Zuul
Branch: stable/rocky

commit e37bbe0a116689043e8c3ec8867bbb3eae062093
Author: Guang Yee <email address hidden>
Date: Thu Oct 25 13:01:23 2018 -0700

    Skip the services with no endpoints when parsing service catalog

    When parsing the service catalog to find the source, audit middleware
    should skip over the services which have no endpoints instead of
    assuming they will have at least one endpoint.

    Change-Id: I287873e99338d95baaf20d52ecb3a43763a401fc
    Closes-Bug: #1800017
    (cherry picked from commit 6779838a242b222672721407cc320672ab24067a)

tags: added: in-stable-rocky

This issue was fixed in the openstack/keystonemiddleware 6.0.0 release.

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

Other bug subscribers