New resources are unable to be created in gnocchi after upgrade to Yoga

Bug #1971753 reported by Tristan Zhang
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
ceilometer (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

After upgrade from Ussuri to Yoga, ceilometer doesn't work properly. Metric measures are generated for old servers. But for new created servers, metric measures are unable to be published to gnocchi.

The issue happens in batch_measures function:

    def batch_measures(self, measures, resource_infos):
        # NOTE(sileht): We don't care about error here, we want
        # resources metadata always been updated
        try:
            self._gnocchi.metric.batch_resources_metrics_measures(
                measures, create_metrics=True)
        except gnocchi_exc.BadRequest as e:
            if not isinstance(e.message, dict):
                LOG.debug("Tristan: if not isinstance ")
                raise
            if e.message.get('cause') != 'Unknown resources':
                LOG.debug("Tristan: if cause != Unknown resources ")
                raise

Here we test if e.message is a dict. In my case ceilometer gets a message with a dict. But for some reason the character "'" in the exception message from gnocchi-api is converted to "'", that breaks this part of code.

Errors in notification logs:

2022-05-04 17:02:45.762 20 ERROR ceilometer.publisher.gnocchi [-] <html>
 <head>
  <title>400 Bad Request</title>
 </head>
 <body>
  <h1>400 Bad Request</h1>
  The server could not comply with the request since it is either malformed or otherwise incorrect.<br /><br />
{&#x27;cause&#x27;: &#x27;Unknown resources&#x27;, &#x27;detail&#x27;: [{&#x27;resource_id&#x27;: &#x27;23c43227-0f8c-5da1-b367-9abd5be48a00&#x27;, &#x27;original_resource_id&#x27;:&#x27;36f2c1be-50b6-4b58-b91f-b9153e28855a-hda&#x27;}, {&#x27;resource_id&#x27;: &#x27;e8e
033d7-f774-5026-a0d2-a06153b99ec3&#x27;, &#x27;original_resource_id&#x27;: &#x27;36f2c1be-50b6-4b58-b91f-b9153e28855a-vda&#x27;}, {&#x27;resource_id&#x27;: &#x27;87feb8f9-cff5-5118-9e85-ec3747111cfc&#x27;, &#x27;original_resource_id&#x27;: &#x27;67171b6e-1147-4084-8ba3-ed352d4f4238-vda&#x27;}]}

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in ceilometer (Ubuntu):
status: New → Confirmed
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.