Bug 1412557

Summary: can't upload instack json file
Product: Red Hat OpenStack Reporter: Amit Ugol <augol>
Component: python-tripleoclientAssignee: RHOS Maint <rhos-maint>
Status: CLOSED ERRATA QA Contact: Amit Ugol <augol>
Severity: urgent Docs Contact:
Priority: unspecified    
Version: 11.0 (Ocata)CC: agurenko, apannu, augol, hbrock, jpichon, jschluet, jslagle, mburns, mcornea, rhel-osp-director-maint
Target Milestone: rc   
Target Release: 11.0 (Ocata)   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-05-17 19:57:07 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Amit Ugol 2017-01-12 09:51:30 UTC
Description of problem:

Uploading json file fails with:

Making authentication request to http://192.0.0.1:5000/v2.0/tokens
Resetting dropped connection: 192.0.0.1
"POST /v2.0/tokens HTTP/1.1" 200 1245
run(Namespace(csv=False, deploy_kernel='bm-deploy-kernel', deploy_ramdisk='bm-deploy-ramdisk', file_in=<open file u'instackenv.json', mode 'r' at 0x1f34b70>, in
itial_state='available', instance_boot_option='local', json=True, no_deploy_image=False, service_host=None))
take_action(Namespace(csv=False, deploy_kernel='bm-deploy-kernel', deploy_ramdisk='bm-deploy-ramdisk', file_in=<open file u'instackenv.json', mode 'r' at 0x1f34
b70>, initial_state='available', instance_boot_option='local', json=True, no_deploy_image=False, service_host=None))
Instantiating baremetal client: <class 'ironicclient.v1.client.Client'>
Baremetal API version: 1.9
Instantiating workflow engine client: <class 'mistralclient.api.v2.client.Client'>
Starting new HTTP connection (1): 192.0.0.1
"POST /v2/executions HTTP/1.1" 400 178
HTTP POST http://192.0.0.1:8989/v2/executions 400
Invalid input [name=tripleo.baremetal.v1.register_or_update, class=DirectWorkflowSpec, unexpected=[u'initial_state']]
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/cliff/app.py", line 400, in run_subcommand
    result = cmd.run(parsed_args)
  File "/usr/lib/python2.7/site-packages/osc_lib/command/command.py", line 41, in run
    return super(Command, self).run(parsed_args)
  File "/usr/lib/python2.7/site-packages/cliff/command.py", line 90, in run
    return self.take_action(parsed_args) or 0
  File "/usr/lib/python2.7/site-packages/tripleoclient/v1/baremetal.py", line 191, in take_action
    initial_state=parsed_args.initial_state,
  File "/usr/lib/python2.7/site-packages/tripleoclient/workflows/baremetal.py", line 34, in register_or_update
    workflow_input=workflow_input
  File "/usr/lib/python2.7/site-packages/tripleoclient/workflows/base.py", line 35, in start_workflow
    workflow_input=workflow_input
  File "/usr/lib/python2.7/site-packages/mistralclient/api/v2/executions.py", line 56, in create
    return self._create('/executions', data)
  File "/usr/lib/python2.7/site-packages/mistralclient/api/base.py", line 92, in _create
    self._raise_api_exception(resp)
  File "/usr/lib/python2.7/site-packages/mistralclient/api/base.py", line 140, in _raise_api_exception
    error_message=error_data)
APIException: Invalid input [name=tripleo.baremetal.v1.register_or_update, class=DirectWorkflowSpec, unexpected=[u'initial_state']]
clean_up ImportBaremetal: Invalid input [name=tripleo.baremetal.v1.register_or_update, class=DirectWorkflowSpec, unexpected=[u'initial_state']]
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/osc_lib/shell.py", line 135, in run
    ret_val = super(OpenStackShell, self).run(argv)
  File "/usr/lib/python2.7/site-packages/cliff/app.py", line 279, in run
    result = self.run_subcommand(remainder)
  File "/usr/lib/python2.7/site-packages/osc_lib/shell.py", line 180, in run_subcommand
    ret_value = super(OpenStackShell, self).run_subcommand(argv)
  File "/usr/lib/python2.7/site-packages/cliff/app.py", line 400, in run_subcommand
    result = cmd.run(parsed_args)
  File "/usr/lib/python2.7/site-packages/osc_lib/command/command.py", line 41, in run
    return super(Command, self).run(parsed_args)
  File "/usr/lib/python2.7/site-packages/cliff/command.py", line 90, in run
    return self.take_action(parsed_args) or 0
  File "/usr/lib/python2.7/site-packages/tripleoclient/v1/baremetal.py", line 191, in take_action
    initial_state=parsed_args.initial_state,
  File "/usr/lib/python2.7/site-packages/tripleoclient/workflows/baremetal.py", line 34, in register_or_update
    workflow_input=workflow_input
  File "/usr/lib/python2.7/site-packages/tripleoclient/workflows/base.py", line 35, in start_workflow
    workflow_input=workflow_input
  File "/usr/lib/python2.7/site-packages/mistralclient/api/v2/executions.py", line 56, in create
    return self._create('/executions', data)
  File "/usr/lib/python2.7/site-packages/mistralclient/api/base.py", line 92, in _create
    self._raise_api_exception(resp)
  File "/usr/lib/python2.7/site-packages/mistralclient/api/base.py", line 140, in _raise_api_exception
    error_message=error_data)
APIException: Invalid input [name=tripleo.baremetal.v1.register_or_update, class=DirectWorkflowSpec, unexpected=[u'initial_state']]


Version-Release number of selected component (if applicable):

$ rpm -qa | grep mistral
openstack-mistral-api-4.0.0-0.20170105020426.9af87bc.el7ost.noarch
python-mistralclient-2.1.2-0.20161207154141.1dcfc2c.el7ost.noarch
python-openstack-mistral-4.0.0-0.20170105020426.9af87bc.el7ost.noarch
openstack-mistral-executor-4.0.0-0.20170105020426.9af87bc.el7ost.noarch
puppet-mistral-10.1.0-0.20161222230115.97f3e48.el7ost.noarch
openstack-mistral-engine-4.0.0-0.20170105020426.9af87bc.el7ost.noarch
openstack-mistral-common-4.0.0-0.20170105020426.9af87bc.el7ost.noarch


How reproducible:
100%

Steps to Reproduce:
1. create a json file for your environment
2. run openstack --debug baremetal import --json instackenv.json
3.

Actual results:
as seen above

Expected results:
ironic node list should give me a list of nodes.

Additional info:

Comment 1 Julie Pichon 2017-01-12 14:20:17 UTC
This looks like an issue with the workflows, at a first glance something related to https://review.openstack.org/#/c/398422/ which added the 'initial_state' argument. I think the tripleo-common and tripleoclient versions would be relevant in this case.

Looking at the 2017-01-12.2 puddle, the tripleo-common version is from 2016: openstack-tripleo-common-6.0.0-0.20161021193416.2af623f and doesn't yet contain the patch, so I suspect this is the origin of the issue.

Comment 2 Julie Pichon 2017-01-26 12:53:46 UTC
Since this was affecting a pretty fundamental functionality and there hasn't been word in a couple of weeks, is it fair to assume this is resolved and close accordingly?

Comment 3 Amit Ugol 2017-01-26 14:30:38 UTC
Seems it was fixed and recent puddle pass this step successfully.
I deem it OK enough to verify.

Comment 5 errata-xmlrpc 2017-05-17 19:57:07 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHEA-2017:1245