cluster list --limit return error

Bug #1752014 reported by chenyb4
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
senlin
In Progress
Undecided
liyi

Bug Description

Version: python-openstacksdk 0.11.2
         senlin queuens branch
         senlinclient queuens branch

In my local env, create three cluster and use "openstack cluster list --limit 1" operation, the return value not only one data, it's return three data.

Use "openstack --debug cluster list --limit 1" found the request for many times.

The log message:
# openstack --debug cluster list --limit 1
......

GET call to None for http://10.20.10.10:8778/ used request id req-dc5b761d-abf5-42a5-bfab-eb25e73c140d
REQ: curl -g -i -X GET "http://10.20.10.10:8778/v1/clusters?sort=None&global_project=False&limit=1&marker=None" -H "User-Agent: openstacksdk/0.11.2 keystoneauth1/3.4.0 python-requests/2.14.2 CPython/2.7.5" -H "Accept: application/json" -H "X-Auth-Token: {SHA1}899e70a4cc1d1e579c0a7a254763d12782b26f89"
http://10.20.10.10:8778 "GET /v1/clusters?global_project=False&limit=1 HTTP/1.1" 200 696
RESP: [200] Openstack-Api-Version: clustering 1.0 Vary: OpenStack-API-Version Content-Type: application/json Content-Length: 696 X-Openstack-Request-Id: req-e9b403a1-5ed2-44c0-b14d-eea8ced955dd Date: Tue, 27 Feb 2018 08:08:54 GMT Connection: keep-alive
RESP BODY: {"clusters": [{"config": {}, "created_at": "2018-02-09T03:15:06Z", "data": {}, "dependents": {}, "desired_capacity": 1, "domain": null, "id": "41792a15-c383-4db9-beef-a2698f03b0a6", "init_at": "2018-02-09T03:15:06Z", "max_size": -1, "metadata": {}, "min_size": 0, "name": "cl001", "nodes": ["d6ebac09-058a-485f-bd0a-74e5aa8c50f4"], "policies": [], "profile_id": "8f81a3a5-e91b-4fd5-91f1-e4a04ddae20f", "profile_name": "PF001", "project": "e127900ee5d94ff5aff30173aa607765", "status": "ACTIVE", "status_reason": "CLUSTER_SCALE_OUT: number of active nodes is equal or above desired_capacity (1).", "timeout": 3600, "updated_at": "2018-02-23T09:02:45Z", "user": "3914a2df5b7e49e3acbba86044e820ef"}]}

GET call to clustering for http://10.20.10.10:8778/v1/clusters?global_project=False&limit=1 used request id req-e9b403a1-5ed2-44c0-b14d-eea8ced955dd
Manager 10.20.10.16:unknown ran task clustering.GET.clusters in 1.26826786995s
Manager 10.20.10.16:unknown running task clustering.GET.clusters
REQ: curl -g -i -X GET "http://10.20.10.10:8778/v1/clusters?sort=None&global_project=False&limit=1&marker=41792a15-c383-4db9-beef-a2698f03b0a6" -H "User-Agent: openstacksdk/0.11.2 keystoneauth1/3.4.0 python-requests/2.14.2 CPython/2.7.5" -H "Accept: application/json" -H "X-Auth-Token: {SHA1}899e70a4cc1d1e579c0a7a254763d12782b26f89"
http://10.20.10.10:8778 "GET /v1/clusters?global_project=False&limit=1&marker=41792a15-c383-4db9-beef-a2698f03b0a6 HTTP/1.1" 200 655
RESP: [200] Openstack-Api-Version: clustering 1.0 Vary: OpenStack-API-Version Content-Type: application/json Content-Length: 655 X-Openstack-Request-Id: req-8f34f820-8bbc-48de-bb09-76bde14123d0 Date: Tue, 27 Feb 2018 08:08:55 GMT Connection: keep-alive
RESP BODY: {"clusters": [{"config": {}, "created_at": "2018-02-26T09:37:52Z", "data": {}, "dependents": {}, "desired_capacity": 0, "domain": null, "id": "7397ac9d-c97f-44b6-aa30-d6a4ac0f8a93", "init_at": "2018-02-26T09:37:51Z", "max_size": -1, "metadata": {}, "min_size": 0, "name": "cl002", "nodes": [], "policies": [], "profile_id": "8f81a3a5-e91b-4fd5-91f1-e4a04ddae20f", "profile_name": "PF001", "project": "e127900ee5d94ff5aff30173aa607765", "status": "ACTIVE", "status_reason": "CLUSTER_CREATE: number of active nodes is equal or above desired_capacity (0).", "timeout": 3600, "updated_at": "2018-02-26T09:37:52Z", "user": "3914a2df5b7e49e3acbba86044e820ef"}]}

GET call to clustering for http://10.20.10.10:8778/v1/clusters?global_project=False&limit=1&marker=41792a15-c383-4db9-beef-a2698f03b0a6 used request id req-8f34f820-8bbc-48de-bb09-76bde14123d0
Manager 10.20.10.16:unknown ran task clustering.GET.clusters in 0.0919868946075s
Manager 10.20.10.16:unknown running task clustering.GET.clusters
REQ: curl -g -i -X GET "http://10.20.10.10:8778/v1/clusters?sort=None&global_project=False&limit=1&marker=7397ac9d-c97f-44b6-aa30-d6a4ac0f8a93" -H "User-Agent: openstacksdk/0.11.2 keystoneauth1/3.4.0 python-requests/2.14.2 CPython/2.7.5" -H "Accept: application/json" -H "X-Auth-Token: {SHA1}899e70a4cc1d1e579c0a7a254763d12782b26f89"
http://10.20.10.10:8778 "GET /v1/clusters?global_project=False&limit=1&marker=7397ac9d-c97f-44b6-aa30-d6a4ac0f8a93 HTTP/1.1" 200 737
RESP: [200] Openstack-Api-Version: clustering 1.0 Vary: OpenStack-API-Version Content-Type: application/json Content-Length: 737 X-Openstack-Request-Id: req-86d7d5fb-9909-4e26-aa17-def3aff6d17c Date: Tue, 27 Feb 2018 08:08:55 GMT Connection: keep-alive
RESP BODY: {"clusters": [{"config": {}, "created_at": "2018-02-26T09:53:42Z", "data": {}, "dependents": {}, "desired_capacity": 2, "domain": null, "id": "d11c91ae-75a1-4197-8ee0-1ee5181a4b59", "init_at": "2018-02-26T09:53:00Z", "max_size": -1, "metadata": {}, "min_size": 0, "name": "mycluster", "nodes": ["2e1fea1c-8542-496f-856c-ebd4a6129e14", "57612033-d42e-4b6c-9965-c480e5a6923f"], "policies": [], "profile_id": "8f81a3a5-e91b-4fd5-91f1-e4a04ddae20f", "profile_name": "PF001", "project": "e127900ee5d94ff5aff30173aa607765", "status": "ACTIVE", "status_reason": "CLUSTER_CREATE: number of active nodes is equal or above desired_capacity (2).", "timeout": 3600, "updated_at": "2018-02-26T09:53:42Z", "user": "3914a2df5b7e49e3acbba86044e820ef"}]}

GET call to clustering for http://10.20.10.10:8778/v1/clusters?global_project=False&limit=1&marker=7397ac9d-c97f-44b6-aa30-d6a4ac0f8a93 used request id req-86d7d5fb-9909-4e26-aa17-def3aff6d17c
Manager 10.20.10.16:unknown ran task clustering.GET.clusters in 0.0903780460358s
Manager 10.20.10.16:unknown running task clustering.GET.clusters
REQ: curl -g -i -X GET "http://10.20.10.10:8778/v1/clusters?sort=None&global_project=False&limit=1&marker=d11c91ae-75a1-4197-8ee0-1ee5181a4b59" -H "User-Agent: openstacksdk/0.11.2 keystoneauth1/3.4.0 python-requests/2.14.2 CPython/2.7.5" -H "Accept: application/json" -H "X-Auth-Token: {SHA1}899e70a4cc1d1e579c0a7a254763d12782b26f89"
http://10.20.10.10:8778 "GET /v1/clusters?global_project=False&limit=1&marker=d11c91ae-75a1-4197-8ee0-1ee5181a4b59 HTTP/1.1" 200 16
RESP: [200] Openstack-Api-Version: clustering 1.0 Vary: OpenStack-API-Version Content-Type: application/json Content-Length: 16 X-Openstack-Request-Id: req-e8b3441b-67fd-4116-927f-6c8152eca14a Date: Tue, 27 Feb 2018 08:08:55 GMT Connection: keep-alive
RESP BODY: {"clusters": []}

GET call to clustering for http://10.20.10.10:8778/v1/clusters?global_project=False&limit=1&marker=d11c91ae-75a1-4197-8ee0-1ee5181a4b59 used request id req-e8b3441b-67fd-4116-927f-6c8152eca14a
Manager 10.20.10.16:unknown ran task clustering.GET.clusters in 0.0752408504486s
+----------+-----------+--------+----------------------+----------------------+
| id | name | status | created_at | updated_at |
+----------+-----------+--------+----------------------+----------------------+
| 41792a15 | cl001 | ACTIVE | 2018-02-09T03:15:06Z | 2018-02-23T09:02:45Z |
| 7397ac9d | cl002 | ACTIVE | 2018-02-26T09:37:52Z | 2018-02-26T09:37:52Z |
| d11c91ae | mycluster | ACTIVE | 2018-02-26T09:53:42Z | 2018-02-26T09:53:42Z |
+----------+-----------+--------+----------------------+----------------------+

Look python-openstacksdk code, A bug fix is included in the new submission, which takes the limit parameter as the paging processing of the API and no longer supports limit return data that the user expects to see.
Python-openstacksdk bug fix url:
https://review.openstack.org/#/c/539424/

Changed in senlin:
status: New → In Progress
liyi (whyliyi)
Changed in senlin:
assignee: nobody → liyi (whyliyi)
Revision history for this message
liyi (whyliyi) wrote :

The following object list exist the same problems:
cluster\profile\node\policy\receiver\action\event

Revision history for this message
chenyb4 (chenyb4) wrote :

Yes, This problem is openstacksdk not support api limit return.

Revision history for this message
liyi (whyliyi) wrote :
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.