Action definition list does not know namespace field

Bug #1869353 reported by Pierre Gaxatte
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Mistral
Fix Released
Medium
ali abdelal

Bug Description

When running `openstack action definition list` with python-mistralclient==4.0.0 and mistral==rocky the command returns:

> Field(s) namespace are invalid.

This does not occur with python-mistralclient==3.10.0

I guess this would work with any version of mistral < train.

I identified the following change in python-mistralclient as potentially problematic: https://review.opendev.org/#/c/700777/

Related change on mistral side: https://review.opendev.org/#/c/700772/

Commands needed to reproduce on my side (with mistral rocky on API side):

$ pip3 install python-mistralclient==3.10.0

$ openstack action definition list --limit=5
+------------------------+------------------------+-----------+------------------------+------------------------+--------+---------------------+------------+
| ID | Name | Is system | Input | Description | Tags | Created at | Updated at |
+------------------------+------------------------+-----------+------------------------+------------------------+--------+---------------------+------------+
| 0638bfcc-a67b-4696-886 | nova.hypervisors_searc | True | hypervisor_match, | Get a list of matching | <none> | 2020-03-11 11:30:46 | None |
| a-434e95d97c8b | h | | action_... | hy... | | | |
| 093170bf-b8bf-44ea-91c | nova.flavor_access_fin | True | action_region="", | Find a single item | <none> | 2020-03-11 11:30:46 | None |
| 3-c560a6254ef7 | d | | **kwarg... | with a... | | | |
| 0c720401-5bf9-4b67-ac6 | nova.hypervisor_stats_ | True | action_region="" | Get hypervisor | <none> | 2020-03-11 11:30:46 | None |
| 9-aa2bb4a6e571 | statistics | | | statistics... | | | |
| 117cfd46-12fc-449b-96f | nova.servers_stop | True | server, | Stop the server. | <none> | 2020-03-11 11:30:46 | None |
| 7-ddf6db30103a | | | action_region="" | | | | |
| | | | | :param ... | | | |
| 125c4989-27f9-44fa-8b9 | nova.server_groups_cre | True | action_region="", obj, | Create (allocate) a | <none> | 2020-03-11 11:30:46 | None |
| b-6021d438ead4 | ate | | **... | serve... | | | |
+------------------------+------------------------+-----------+------------------------+------------------------+--------+---------------------+------------+

$ pip3 install python-mistralclient==4.0.0 --upgrade

$ openstack action definition list --limit=5
Field(s) namespace are invalid.

$ openstack action definition list --limit=5 --debug
[...]
https://workflow.bhs3.cloud.ovh.net:443 "GET /v2/actions?limit=5&sort_keys=created_at&sort_dirs=asc&fields=id%2Cname%2Cnamespace%2Cis_system%2Cinput%2Cdescription%2Ctags%2Ccreated_at%2Cupdated_at HTTP/1.1" 400 92
RESP: [400] Connection: keep-alive Content-Length: 92 Content-Type: application/json Date: Fri, 27 Mar 2020 10:27:14 GMT Server: nginx/1.17.8 Strict-Transport-Security: max-age=15724800; includeSubDomains
RESP BODY: {"debuginfo": null, "faultcode": "Client", "faultstring": "Field(s) namespace are invalid."}
Request returned failure status: 400
Field(s) namespace are invalid.
Traceback (most recent call last):
  File "/home/ubuntu/.local/lib/python3.6/site-packages/mistralclient/api/base.py", line 180, in _list
    resp = self.http_client.get(url, headers)
  File "/home/ubuntu/.local/lib/python3.6/site-packages/mistralclient/api/httpclient.py", line 54, in decorator
    resp = func(self, *args, **kwargs)
  File "/home/ubuntu/.local/lib/python3.6/site-packages/mistralclient/api/httpclient.py", line 114, in get
    return self.session.get(self.base_url + url, **options)
  File "/home/ubuntu/.local/lib/python3.6/site-packages/keystoneauth1/session.py", line 1123, in get
    return self.request(url, 'GET', **kwargs)
  File "/home/ubuntu/.local/lib/python3.6/site-packages/keystoneauth1/session.py", line 968, in request
    raise exceptions.from_response(resp, method, url)
keystoneauth1.exceptions.http.BadRequest: Unrecognized schema in response body. (HTTP 400)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/ubuntu/.local/lib/python3.6/site-packages/cliff/app.py", line 400, in run_subcommand
    result = cmd.run(parsed_args)
  File "/home/ubuntu/.local/lib/python3.6/site-packages/osc_lib/command/command.py", line 41, in run
    return super(Command, self).run(parsed_args)
  File "/home/ubuntu/.local/lib/python3.6/site-packages/cliff/display.py", line 117, in run
    column_names, data = self.take_action(parsed_args)
  File "/home/ubuntu/.local/lib/python3.6/site-packages/mistralclient/commands/v2/base.py", line 116, in take_action
    ret = self._get_resources(parsed_args)
  File "/home/ubuntu/.local/lib/python3.6/site-packages/mistralclient/commands/v2/actions.py", line 88, in _get_resources
    **base.get_filters(parsed_args)
  File "/home/ubuntu/.local/lib/python3.6/site-packages/mistralclient/api/v2/actions.py", line 72, in list
    response_key='actions',
  File "/home/ubuntu/.local/lib/python3.6/site-packages/mistralclient/api/base.py", line 182, in _list
    self._raise_api_exception(ex.response)
  File "/home/ubuntu/.local/lib/python3.6/site-packages/mistralclient/api/base.py", line 220, in _raise_api_exception
    error_message=error_data)
mistralclient.api.base.APIException: Field(s) namespace are invalid.
clean_up List: Field(s) namespace are invalid.
END return value: 1

Exact curl command:
$ curl -g -i -X GET 'https://workflow.bhs3.cloud.ovh.net/v2/actions?limit=5&sort_keys=created_at&sort_dirs=asc&fields=id%2Cname%2Cnamespace%2Cis_system%2Cinput%2Cdescription%2Ctags%2Ccreated_at%2Cupdated_at' -H "X-Auth-Token: $(openstack token issue -f value -c id)"
HTTP/1.1 400 Bad Request
Content-Length: 92
Content-Type: application/json
Date: Fri, 27 Mar 2020 10:30:17 GMT
X-IPLB-Instance: 30321
Strict-Transport-Security: max-age=15768000

{"debuginfo": null, "faultcode": "Client", "faultstring": "Field(s) namespace are invalid."}

Same curl without namespace:
$ curl -g -i -X GET 'https://workflow.bhs3.cloud.ovh.net/v2/actions?limit=5&sort_keys=created_at&sort_dirs=asc&fields=id%2Cname%2Cis_system%2Cinput%2Cdescription%2Ctags%2Ccreated_at%2Cupdated_at' -H "X-Auth-Token: $(openstack token issue -f value -c id)"
HTTP/1.1 200 OK
Content-Length: 2072
Content-Type: application/json
Date: Fri, 27 Mar 2020 10:31:43 GMT
X-IPLB-Instance: 30324
Strict-Transport-Security: max-age=15768000

{"actions": [...]}

Revision history for this message
Pierre Gaxatte (pierre-gaxatte) wrote :

BTW I see the same behavior with mistral client (without openstack):

$ mistral action-list
WARNING (keystone) Only one of project_name or project_id should be set,project_name will be ignored
ERROR (app) Field(s) namespace are invalid.

description: updated
description: updated
Changed in mistral:
importance: Undecided → Medium
assignee: nobody → ali abdelal (alielal)
milestone: none → ussuri-3
Revision history for this message
ali abdelal (alielal) wrote :

recently we added a new field to the actions (namespace) to mistral, the client was updated to use that new field, but mistral-rocky does not have it which is whats causing the issue.

I will update the client to not use that field if not specified.

Changed in mistral:
status: New → In Progress
Changed in mistral:
status: In Progress → 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.