input_values object of type 'NoneType' has no len() (HTTP 400)

Bug #1319825 reported by Robert Collins
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Heat
Fix Released
High
Ryan Brown

Bug Description

With this logged in heat-engine.log:
    2014-05-15 07:08:01.003 18487 ERROR heat.engine.resource [-] CREATE : StructuredDeployment "NovaCompute17Config" Stack "overcloud" [2dee1929-a7fd-4bbc-98e3-78f115df3c7c]

    2014-05-15 07:08:01.003 18487 TRACE heat.engine.resource Traceback (most recent call last):

    2014-05-15 07:08:01.003 18487 TRACE heat.engine.resource File "/opt/stack/venvs/heat/local/lib/python2.7/site-packages/heat/engine/resource.py", line 389, in _do_action

    2014-05-15 07:08:01.003 18487 TRACE heat.engine.resource pre_func()

    2014-05-15 07:08:01.003 18487 TRACE heat.engine.resource File "/opt/stack/venvs/heat/local/lib/python2.7/site-packages/heat/engine/properties.py", line 314, in validate

    2014-05-15 07:08:01.003 18487 TRACE heat.engine.resource raise exception.StackValidationFailed(message=msg)

    2014-05-15 07:08:01.003 18487 TRACE heat.engine.resource StackValidationFailed: Property error : NovaCompute17Config: input_values object of type 'NoneType' has no len() (HTTP 400)

    2014-05-15 07:08:01.003 18487 TRACE heat.engine.resource

Now, something might be generically setting the property to None, but I couldn't see anything that knows about input_values doing that except the service update method...

And that method could perhaps be called with None:
update() in heat/api/openstack/v1/software_deployments.py does this:
        update_data = dict((k, body.get(k)) for k in (
            'config_id', 'input_values', 'output_values', 'action',
            'status', 'status_reason'))
        sd = self.rpc_client.update_software_deployment(req.context,
                                                        deployment_id,
                                                        **update_data)

If input_values isn't in the body, then it will create an update_dict with input_values:None which is invalid.

Revision history for this message
Robert Collins (lifeless) wrote :

I put an assert in there and it fired:
2014-05-15 15:01:39.955 1240 ERROR heat.engine.resource [req-f31c6b62-d02e-48b3-9e99-3f12aa87bd6c None] signal StructuredDeployment "NovaCompute18Config" [6774f17c-f4c4-4bb8-8d28-4edfada87215] Stack "overcloud" [00d02dae-320f-4116-ac2f-98004a41ead0] : ERROR:
2014-05-15 15:01:39.955 1240 TRACE heat.engine.resource Traceback (most recent call last):
2014-05-15 15:01:39.955 1240 TRACE heat.engine.resource File "/opt/stack/venvs/heat/local/lib/python2.7/site-packages/heat/engine/resource.py", line 893, in signal
2014-05-15 15:01:39.955 1240 TRACE heat.engine.resource self.handle_signal(details)
2014-05-15 15:01:39.955 1240 TRACE heat.engine.resource File "/opt/stack/venvs/heat/lib/python2.7/site-packages/heat/engine/resources/software_config/software_deployment.py", line 464, in handle_signal
2014-05-15 15:01:39.955 1240 TRACE heat.engine.resource sd.update(output_values=ov, status=status, status_reason=status_reason)
2014-05-15 15:01:39.955 1240 TRACE heat.engine.resource File "/opt/stack/venvs/heat/local/lib/python2.7/site-packages/heatclient/v1/software_deployments.py", line 23, in update
2014-05-15 15:01:39.955 1240 TRACE heat.engine.resource self.manager.update(deployment_id=self.id, **fields)
2014-05-15 15:01:39.955 1240 TRACE heat.engine.resource File "/opt/stack/venvs/heat/local/lib/python2.7/site-packages/heatclient/v1/software_deployments.py", line 68, in update
2014-05-15 15:01:39.955 1240 TRACE heat.engine.resource 'PUT', '/software_deployments/%s' % deployment_id, data=kwargs)
2014-05-15 15:01:39.955 1240 TRACE heat.engine.resource File "/opt/stack/venvs/heat/local/lib/python2.7/site-packages/heatclient/common/http.py", line 235, in json_request
2014-05-15 15:01:39.955 1240 TRACE heat.engine.resource resp = self._http_request(url, method, **kwargs)
2014-05-15 15:01:39.955 1240 TRACE heat.engine.resource File "/opt/stack/venvs/heat/local/lib/python2.7/site-packages/heatclient/common/http.py", line 196, in _http_request
2014-05-15 15:01:39.955 1240 TRACE heat.engine.resource raise exc.from_response(resp)
2014-05-15 15:01:39.955 1240 TRACE heat.engine.resource HTTPInternalServerError: ERROR:

Changed in heat:
status: New → Triaged
importance: Undecided → High
assignee: nobody → Steve Baker (steve-stevebaker)
milestone: none → juno-1
Thierry Carrez (ttx)
Changed in heat:
milestone: juno-1 → juno-2
Revision history for this message
Steven Hardy (shardy) wrote :

No fix proposed so bumping to J3

Changed in heat:
milestone: juno-2 → juno-3
Ryan Brown (sb-p)
Changed in heat:
assignee: Steve Baker (steve-stevebaker) → Ryan Brown (sb-p)
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to heat (master)

Fix proposed to branch: master
Review: https://review.openstack.org/110300

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to heat (master)

Reviewed: https://review.openstack.org/110300
Committed: https://git.openstack.org/cgit/openstack/heat/commit/?id=8d139b9368a85b9e8b4017ba14b91552e000a795
Submitter: Jenkins
Branch: master

commit 8d139b9368a85b9e8b4017ba14b91552e000a795
Author: Ryan Brown <email address hidden>
Date: Tue Jul 29 10:15:17 2014 -0400

    Stop software_deployments from passing empty keys

    When software_deployments was given a body missing the "input_values"
    field it would pass update info with input_values=None, which would
    later fail and cause an internal server error.

    This change prevents software_deployments from passing on NoneType
    values.

    Change-Id: I02e9c08bbd7429d808de1451de12cc02fc879ecb
    Closes-Bug: 1319825

Changed in heat:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in heat:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in heat:
milestone: juno-3 → 2014.2
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.