check_cinder_services.py broken in Xena and Yoga

Bug #1963549 reported by Gustavo Sanchez
24
This bug affects 3 people
Affects Status Importance Assigned to Milestone
charm-openstack-service-checks
Fix Released
Undecided
JamesLin

Bug Description

/usr/local/lib/nagios/plugins/check_cinder_services.py
<function check_cinder_services at 0x7f6561a84310> raised unknown exception '<class 'keystoneauth1.exceptions.catalog.EndpointNotFound'>'
============================================================
Traceback (most recent call last):
  File "/usr/local/lib/nagios/plugins/nagios_plugin3.py", line 37, in try_check
    function(*args, **kwargs)
  File "/usr/local/lib/nagios/plugins/check_cinder_services.py", line 35, in check_cinder_services
    services = cinder.get("/os-services").json()["services"]
  File "/usr/lib/python3/dist-packages/keystoneauth1/adapter.py", line 386, in get
    return self.request(url, 'GET', **kwargs)
  File "/usr/lib/python3/dist-packages/openstack/proxy.py", line 94, in request
    response = super(Proxy, self).request(
  File "/usr/lib/python3/dist-packages/keystoneauth1/adapter.py", line 248, in request
    return self.session.request(url, method, **kwargs)
  File "/usr/lib/python3/dist-packages/keystoneauth1/session.py", line 797, in request
    raise exceptions.EndpointNotFound()
keystoneauth1.exceptions.catalog.EndpointNotFound: Could not find requested endpoint in Service Catalog.
============================================================

Related branches

Revision history for this message
Gustavo Sanchez (gustavosr98) wrote :
Revision history for this message
Przemyslaw Hausman (phausman) wrote (last edit ):

I have hit this bug on Yoga too. It looks related to API version.

The issue is causing Nagios to report "Unknown" status on juju-openstack-service-checks-0 host, with the message "<function check_cinder_services at 0x7f1cd41b0160> raised unknown exception '<class 'keystoneauth1.exceptions.catalog.EndpointNotFound'>'".

As a test, I have added `export OS_VOLUME_API_VERSION=3` to /var/lib/nagios/nagios.novarc and it temporarily fixes the problem.

Steps to reproduce:

```
$ source /var/lib/nagios/nagios.novarc

$ openstack endpoint list \
  -c "Service Name" \
  -c "Service Type" \
  -c Interface \
  -c URL \
  -f value | grep cinder
cinderv3 volumev3 internal https://cinder-internal.redacted.com:8776/v3/$(tenant_id)s
cinderv3 volumev3 public https://cinder.redacted.com:8776/v3/$(tenant_id)s
cinderv3 volumev3 admin https://cinder.redacted.com:8776/v3/$(tenant_id)s

$ /usr/local/lib/nagios/plugins/check_cinder_services.py
<function check_cinder_services at 0x7f324d8c73a0> raised unknown exception '<class 'keystoneauth1.exceptions.catalog.EndpointNotFound'>'
============================================================
Traceback (most recent call last):
  File "/usr/local/lib/nagios/plugins/nagios_plugin3.py", line 37, in try_check
    function(*args, **kwargs)
  File "/usr/local/lib/nagios/plugins/check_cinder_services.py", line 35, in check_cinder_services
    services = cinder.get("/os-services").json()["services"]
  File "/usr/lib/python3/dist-packages/keystoneauth1/adapter.py", line 386, in get
    return self.request(url, 'GET', **kwargs)
  File "/usr/lib/python3/dist-packages/openstack/proxy.py", line 94, in request
    response = super(Proxy, self).request(
  File "/usr/lib/python3/dist-packages/keystoneauth1/adapter.py", line 248, in request
    return self.session.request(url, method, **kwargs)
  File "/usr/lib/python3/dist-packages/keystoneauth1/session.py", line 797, in request
    raise exceptions.EndpointNotFound()
keystoneauth1.exceptions.catalog.EndpointNotFound: Could not find requested endpoint in Service Catalog.
============================================================

$ export OS_VOLUME_API_VERSION=3

$ /usr/local/lib/nagios/plugins/check_cinder_services.py
OK: All cinder services happy
```

summary: - check_cinder_services.py broken in Xena
+ check_cinder_services.py broken in Xena and Yoga
Revision history for this message
JamesLin (jneo8) wrote :
JamesLin (jneo8)
Changed in charm-openstack-service-checks:
assignee: nobody → JamesLin (jneo8)
JamesLin (jneo8)
Changed in charm-openstack-service-checks:
status: New → Fix Committed
Changed in charm-openstack-service-checks:
milestone: none → 22.10
Changed in charm-openstack-service-checks:
status: Fix Committed → Fix Released
Changed in charm-openstack-service-checks:
status: Fix Released → Fix Committed
Changed in charm-openstack-service-checks:
status: Fix Committed → Fix Released
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.