APIException when using mistral CLI

asked 2017-01-26 06:39:30 -0500

pcastets gravatar image

updated 2017-01-26 06:41:40 -0500

I am currently testing Mistral in Ubuntu 16.04. I have previously tested it quickly in devstack, and now, I would like to add Mistral to my current OpenStack Newton deployment.

I am using the source code, on the master branch.

  • Cloned source code from git
  • Created a virtualenv and installed mistral and dependencies inside the venv: pip install -e . (I also had to install pymysql)
  • Created the database
  • Created the Keystone user, service, endpoints for the mistral service
  • Created config file in /etc/mistral/mistral.conf, using oslo-config-generator
  • Copied policy.json to /etc/mistral/policy.json
  • Upgraded and populated database

[keystone]

  auth_uri = http://controller:5000/v3
  auth_url = http://controller:35357
  auth_version = v3
  memcached_servers = controller:11211
  auth_type = password
  project_domain_name = Default
  user_domain_name = Default
  project_name = service
  username = mistral
  password = ...

[oslo_messaging_rabbit]

  rabbit_userid = ...
  rabbit_password = ... 
  rabbit_host = controller

[database]

connection = mysql+pymysql://mistral:password@controller/mistral

I run mistral in 4 separate processes:

mistral-server --server api --config-file /etc/mistral/mistral.conf
mistral-server --server engine --config-file /etc/mistral/mistral.conf
mistral-server --server executor --config-file /etc/mistral/mistral.conf
mistral-server --server event-engine --config-file /etc/mistral/mistral.conf

The processes seem to start fine, according to the logs, although the connection to AMQP seems to take a long time (2 minutes).

Executing a mistral command with the demo user:

(venv) 1 stack@controller:~/mistralāŸ« mistral workflow-list -v --debug
...
DEBUG (base) Making authentication request to http://controller:5000/v3/auth/tokens
DEBUG (connectionpool) Starting new HTTP connection (1): controller
DEBUG (connectionpool) http://controller:5000 "POST /v3/auth/tokens HTTP/1.1" 201 282
DEBUG (base) {"token": {"issued_at": "2017-01-26T11:04:21.000000Z", "user": {"domain": {"id": "default", "name": "Default"}, "id": "f2992167d8f246dd82b604a88575e0e7", "name": "demo"}, "methods": ["password"], "expires_at": "2017-01-26T12:04:21.000000Z", "audit_ids": ["DFP-atNkRDO2gB7OtoWt6A"]}}
...
DEBUG (connectionpool) Starting new HTTP connection (1): localhost
DEBUG (connectionpool) http://localhost:8989 "GET /v2/workflows HTTP/1.1" 500 0
DEBUG (httpclient) HTTP GET http://localhost:8989/v2/workflows 500
...
Traceback (most recent call last):
....
    ret = self._get_resources(parsed_args)
  File "/home/stack/mistral/venv/local/lib/python2.7/site-packages/mistralclient/commands/v2/workflows.py", line 84, in _get_resources
    **base.get_filters(parsed_args)
  File "/home/stack/mistral/venv/local/lib/python2.7/site-packages/mistralclient/api/v2/workflows.py", line 99, in list
    response_key='workflows',
  File "/home/stack/mistral/venv/local/lib/python2.7/site-packages/mistralclient/api/base.py", line 114, in _list
    self._raise_api_exception(resp)
  File "/home/stack/mistral/venv/local/lib/python2.7/site-packages/mistralclient/api/base.py", line 143, in _raise_api_exception
    error_message=error_data)
mistralclient.api.base.APIException

In keystone log, there is:

2017-01-26 12:04:21.577 162955 INFO keystone.common.wsgi [req-f34871b3-c0d7-42c6-817a-6629dc7e0fc6 - - - - -] POST http://controller:5000/v3/auth/tokens

In mistral API log, there is:

2017-01-26 12:04:21.723 182505 DEBUG keystonemiddleware.auth_token [-] Authenticating user token process_request /home/stack/mistral/venv/local/lib/python2.7/site-packages/keystonemiddleware/auth_token/__init__.py:401
edit retag flag offensive close merge delete

Comments

Are there any other Mistral logs from the engine? I don't even see the request in the API log, just the initial authorisation. Have you tried accessing the API via curl or your browser? Just fetch http://localhost:8989/v2

I think that it can't find the mistral API.

d0ugal gravatar imaged0ugal ( 2017-01-30 13:56:00 -0500 )edit

Using curl, it seems that the API is reachable:

curl -I http://localhost:8989/v2 HTTP/1.1 302 Found

The API logs:

INFO keystonemiddleware.auth_token [-] Deferring reject downstream DEBUG keystonemiddleware.auth_token [-] Received request from process_request /home/stack/mistral/venv/lo

pcastets gravatar imagepcastets ( 2017-01-31 03:10:53 -0500 )edit