Ceilometer API doesn't returns resources with '/'

Bug #1508010 reported by Yurii Prokulevych
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ceilometer
Triaged
Undecided
ZhiQiang Fan

Bug Description

Some resources might have '/' in the name. For e.g. swift related resources:
"5ab4227b1c4a43a3a02412b5c450d341/glance", " a99ec6fe5d2c4f58b4f75d4a3565c790/AdminTenantContainer1".

CLI call 'ceilometer resource-show' fails with next message:
ceilometer resource-show 5ab4227b1c4a43a3a02412b5c450d341/glance
Resource not found: 5ab4227b1c4a43a3a02412b5c450d341/glance

When running with debug output next lines are present:
DEBUG (client) REQ: curl -g -i -X 'GET' 'http://192.0.2.18:8777/v2/resources/5ab4227b1c4a43a3a02412b5c450d341/glance' -H 'User-Agent: ceilometerclient.openstack.common.apiclient' -H 'X-Auth-Token: {SHA1}1536c56d348b03c0d84268cc191ecfceafdb7ab3'
INFO (connectionpool) Starting new HTTP connection (1): 192.0.2.18
DEBUG (connectionpool) "GET /v2/resources/5ab4227b1c4a43a3a02412b5c450d341/glance HTTP/1.1" 404 186

Resources are properly stored in the MongoDB backend:
> db.resource.findOne({'_id':'5ab4227b1c4a43a3a02412b5c450d341/glance'})
{
        "_id" : "5ab4227b1c4a43a3a02412b5c450d341/glance",
        "source" : "openstack",
        "project_id" : "5ab4227b1c4a43a3a02412b5c450d341",
        "user_id" : null,
        "first_sample_timestamp" : ISODate("2015-10-13T10:57:01.470Z"),
        "last_sample_timestamp" : ISODate("2015-10-20T11:33:22.109Z"),
        "metadata" : null,
        "meter" : [
                {
                        "counter_name" : "storage.containers.objects",
                        "counter_unit" : "object",
                        "counter_type" : "gauge"
                },
                {
                        "counter_name" : "storage.containers.objects.size",
                        "counter_unit" : "B",
                        "counter_type" : "gauge"
                }
        ]
}

Also, meters that belong to this resource can be filtered:
ceilometer meter-list -q 'resource_id=5ab4227b1c4a43a3a02412b5c450d341/glance'
+---------------------------------+-------+--------+-----------------------------------------+---------+----------------------------------+
| Name | Type | Unit | Resource ID | User ID | Project ID |
+---------------------------------+-------+--------+-----------------------------------------+---------+----------------------------------+
| storage.containers.objects | gauge | object | 5ab4227b1c4a43a3a02412b5c450d341/glance | None | 5ab4227b1c4a43a3a02412b5c450d341 |
| storage.containers.objects.size | gauge | B | 5ab4227b1c4a43a3a02412b5c450d341/glance | None | 5ab4227b1c4a43a3a02412b5c450d341 |
+---------------------------------+-------+--------+-----------------------------------------+---------+----------------------------------+

Packages:
openstack-ceilometer-compute-5.0.0.0-rc1.el7.centos.noarch
openstack-ceilometer-alarm-5.0.0.0-rc1.el7.centos.noarch
python-ceilometerclient-1.5.1-dev1.el7.centos.noarch
openstack-ceilometer-polling-5.0.0.0-rc1.el7.centos.noarch
openstack-ceilometer-central-5.0.0.0-rc1.el7.centos.noarch
openstack-ceilometer-common-5.0.0.0-rc1.el7.centos.noarch
openstack-ceilometer-notification-5.0.0.0-rc1.el7.centos.noarch
openstack-ceilometer-api-5.0.0.0-rc1.el7.centos.noarch
python-ceilometer-5.0.0.0-rc1.el7.centos.noarch
openstack-ceilometer-collector-5.0.0.0-rc1.el7.centos.noarch

Regards,
Yurii

Revision history for this message
ZhiQiang Fan (aji-zqfan) wrote :

can you try to replace the / with %2F?

Changed in ceilometer:
status: New → Incomplete
Revision history for this message
Yurii Prokulevych (yprokule) wrote :

curl -XGET -H 'Content-Type: application/json' -H 'X-Auth-Token: faad0811e6b449879c600637155f2508' 'http://192.0.2.18:8777/v2/resources/5ab4227b1c4a43a3a02412b5c450d341%2Fglance'

{"error_message": "<html>\n <head>\n <title>404 Not Found</title>\n </head>\n <body>\n <h1>404 Not Found</h1>\n The resource could not be found.<br /><br />\n\n\n\n </body>\n</html>"}

And from api.log:
...
 [20/Oct/2015 12:04:39] "GET /v2/resources/5ab4227b1c4a43a3a02412b5c450d341%2Fglance HTTP/1.1" 404 -
...

ZhiQiang Fan (aji-zqfan)
Changed in ceilometer:
assignee: nobody → ZhiQiang Fan (aji-zqfan)
status: Incomplete → Confirmed
Revision history for this message
gordon chung (chungg) wrote :

this is (potentially) a pecan issue. see https://bugs.launchpad.net/gnocchi/+bug/1500890

Changed in ceilometer:
status: Confirmed → Triaged
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.