No such file or directory: '/var/snap/prometheus-openstack-exporter/common/<region_name>'

Bug #1823011 reported by Jamon Camisso
20
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Prometheus Openstack Exporter Charm
New
Medium
Unassigned
prometheus-openstack-exporter-snap
New
Unknown

Bug Description

On a fresh deploy of a unit using the charm, connecting to the unit and curling the /metrics endpoint results in the following error:

curl -s http://localhost:9183/metrics
Traceback (most recent call last):
  File "/snap/prometheus-openstack-exporter/25/bin/prometheus-openstack-exporter", line 607, in do_GET
    neutron = Neutron()
  File "/snap/prometheus-openstack-exporter/25/bin/prometheus-openstack-exporter", line 220, in __init__
    with open(config['cache_file'], 'rb') as f:
IOError: [Errno 2] No such file or directory: '/var/snap/prometheus-openstack-exporter/common/<region_name>'

Touching that file and trying again gives an EOF error.

So something needs to a) create the file, and b) populate it on unit creation.

Revision history for this message
Wouter van Bommel (woutervb) wrote :

Could you please provide us with a bundle and / or more instructions on how to reproduce the problem?

Changed in charm-prometheus-openstack-exporter:
status: New → Incomplete
Changed in charm-prometheus-openstack-exporter:
importance: Undecided → Medium
Revision history for this message
David van der Spek (vanderspek-david) wrote :

I am currently also experiencing this bug while I am attempting to create a monitoring overlay for the openstack-base bundle.

Traceback (most recent call last):
  File "/snap/prometheus-openstack-exporter/29/bin/prometheus-openstack-exporter", line 740, in do_GET
    collectors = [COLLECTORS[collector]() for collector in get_collectors(config.get('enabled_collectors'))]
  File "/snap/prometheus-openstack-exporter/29/bin/prometheus-openstack-exporter", line 326, in __init__
    with open(config['cache_file'], 'rb') as f:
IOError: [Errno 2] No such file or directory: '/var/snap/prometheus-openstack-exporter/common/RegionOne'

Revision history for this message
Nikolay Vinogradov (nikolay.vinogradov) wrote :

Also seeing this issue with cs:prometheus-openstack-exporter-15:

Traceback (most recent call last):
  File "/snap/prometheus-openstack-exporter/29/bin/prometheus-openstack-exporter", line 740, in do_GET
    collectors = [COLLECTORS[collector]() for collector in get_collectors(config.get('enabled_collectors'))]
  File "/snap/prometheus-openstack-exporter/29/bin/prometheus-openstack-exporter", line 326, in __init__
    with open(config['cache_file'], 'rb') as f:
IOError: [Errno 2] No such file or directory: '/var/snap/prometheus-openstack-exporter/common/REGION'

Revision history for this message
Nobuto Murata (nobuto) wrote (last edit ):
Download full text (7.2 KiB)

This is most likely another error rather than the cache file itself. The snap doesn't expose a backend error in a nice way to the /metrics endpoint.

In my case, it was an exception in keystone client with SSL verification failure:

HTTPSConnectionPool(host='192.168.151.118', port=5000): Max retries exceeded with url: /v3/auth/tokens (Caused by SSLError(SSLError(1, u'[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:590)'),))

$ curl localhost:9183/metrics
Traceback (most recent call last):
  File "/snap/prometheus-openstack-exporter/29/bin/prometheus-openstack-exporter", line 740, in do_GET
    collectors = [COLLECTORS[collector]() for collector in get_collectors(config.get('enabled_collectors'))]
  File "/snap/prometheus-openstack-exporter/29/bin/prometheus-openstack-exporter", line 326, in __init__
    with open(config['cache_file'], 'rb') as f:
IOError: [Errno 2] No such file or directory: '/var/snap/prometheus-openstack-exporter/common/RegionOne'

$ journalctl -u snap.prometheus-openstack-exporter.prometheus-openstack-exporter.service
...
Aug 11 01:05:19 juju-2ac58b-1-lxd-7 prometheus-openstack-exporter.prometheus-openstack-exporter[15486]: 127.0.0.1 - - [11/Aug/2021 01:05:19] "GET /metrics HTTP/1.1" 500 -
Aug 11 01:10:10 juju-2ac58b-1-lxd-7 python2[15450]: Client setup done, keystone ver 3
Aug 11 01:10:10 juju-2ac58b-1-lxd-7 python2[15450]: Error getting tenants.list, continue with projects.list
Aug 11 01:10:10 juju-2ac58b-1-lxd-7 prometheus-openstack-exporter.prometheus-openstack-exporter[15450]: Client setup done, keystone ver 3
Aug 11 01:10:10 juju-2ac58b-1-lxd-7 prometheus-openstack-exporter.prometheus-openstack-exporter[15450]: Error getting tenants.list, continue with projects.list
Aug 11 01:10:10 juju-2ac58b-1-lxd-7 python2[15450]: Error getting stats: Traceback (most recent call last):
                                                      File "/snap/prometheus-openstack-exporter/29/bin/prometheus-openstack-exporter", line 204, in run
                                                        prodstack.update(self._get_keystone_info(keystone))
                                                      File "/snap/prometheus-openstack-exporter/29/bin/prometheus-openstack-exporter", line 152, in _get_keystone_info
                                                        info['tenants'] = [x._info for x in keystone.projects.list()]
                                                      File "/snap/prometheus-openstack-exporter/29/lib/python2.7/site-packages/positional/__init__.py", line 108, in inner
                                                        return wrapped(*args, **kwargs)
                                                      File "/snap/prometheus-openstack-exporter/29/lib/python2.7/site-packages/keystoneclient/v3/projects.py", line 119, in list
                                                        **kwargs)
                                                      File "/snap/prometheus-openstack-exporter/29/lib/python2.7/site-packages/keystoneclient/base.py", line 75, in func
                                                        return f(*args, **new_kwargs)
                                               ...

Read more...

Nobuto Murata (nobuto)
summary: - charm does not create metrics cache file
+ No such file or directory: '/var/snap/prometheus-openstack-
+ exporter/common/<region_name>'
Revision history for this message
Nobuto Murata (nobuto) wrote :

Filed another bug:
"No way to retrieve root CA through Vault relation"
https://bugs.launchpad.net/charm-prometheus-openstack-exporter/+bug/1939465

Changed in prometheus-openstack-exporter-snap:
status: Unknown → New
Changed in charm-prometheus-openstack-exporter:
status: Incomplete → New
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.