image not present not printed during validate call

Bug #1209091 reported by Steven Dake
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Heat
Fix Released
Medium
Steven Dake

Bug Description

heat stack-create teststack -f /home/sdake/repos/heat-templates/cfn/F19/WordPress_NoKey.yaml

where F19 is the F18/WordPress_NoKey.yaml template with F18 replaced by F19. The F19 image was not registered, and the client prints the following error instead of something useful:
[sdake@bigiron ~]$ ./ls1
ERROR: 400 Bad Request

The server could not comply with the request since it is either malformed or otherwise incorrect.

This could be a server problem.

The client backtrace:
2013-08-06 23:28:46.165 26229 DEBUG heat.openstack.common.rpc.amqp [-] UNIQUE_ID
 is ffb4181d2bc641ef823fa55828efadec. _add_unique_id /opt/stack/heat/heat/openst
ack/common/rpc/amqp.py:325
2013-08-06 23:28:46.447 26229 ERROR root [-] Exception handling resource: __str_
_ returned non-string (type Message)
Traceback (most recent call last):

  File "/opt/stack/heat/heat/openstack/common/rpc/amqp.py", line 424, in _process_data
    **args)

  File "/opt/stack/heat/heat/openstack/common/rpc/dispatcher.py", line 172, in dispatch
    result = getattr(proxyobj, method)(ctxt, **kwargs)

  File "/opt/stack/heat/heat/engine/service.py", line 54, in wrapped
    return func(self, ctx, *args, **kwargs)

  File "/opt/stack/heat/heat/engine/service.py", line 251, in create_stack
    stack.validate()

  File "/opt/stack/heat/heat/engine/parser.py", line 261, in validate
    raise StackValidationFailed(message=str(ex))

TypeError: __str__ returned non-string (type Message)

The server backtrace:
2013-08-06 23:28:46.439 26154 INFO heat.engine.resources.instance [-] Image F19-
x86_64-cfntools was not found in glance
Traceback (most recent call last):
  File "/usr/lib64/python2.7/logging/__init__.py", line 851, in emit
    msg = self.format(record)
  File "/usr/lib64/python2.7/logging/__init__.py", line 724, in format
    return fmt.format(record)
  File "/opt/stack/heat/heat/openstack/common/log.py", line 516, in format
    return logging.Formatter.format(self, record)
  File "/usr/lib64/python2.7/logging/__init__.py", line 464, in format
    record.message = record.getMessage()
  File "/usr/lib64/python2.7/logging/__init__.py", line 324, in getMessage
    msg = str(self.msg)

TypeError: __str__ returned non-string (type Message)
Logged from file parser.py, line 260
2013-08-06 23:28:46.440 26154 ERROR heat.openstack.common.rpc.amqp [-] Exception
 during message handling
2013-08-06 23:28:46.440 26154 TRACE heat.openstack.common.rpc.amqp Traceback (mo
st recent call last):
2013-08-06 23:28:46.440 26154 TRACE heat.openstack.common.rpc.amqp File "/opt/
stack/heat/heat/openstack/common/rpc/amqp.py", line 424, in _process_data
2013-08-06 23:28:46.440 26154 TRACE heat.openstack.common.rpc.amqp **args)
2013-08-06 23:28:46.440 26154 TRACE heat.openstack.common.rpc.amqp File "/opt/
stack/heat/heat/openstack/common/rpc/dispatcher.py", line 172, in dispatch
2013-08-06 23:28:46.440 26154 TRACE heat.openstack.common.rpc.amqp result =
getattr(proxyobj, method)(ctxt, **kwargs)
2013-08-06 23:28:46.440 26154 TRACE heat.openstack.common.rpc.amqp File "/opt/
stack/heat/heat/engine/service.py", line 54, in wrapped
2013-08-06 23:28:46.440 26154 TRACE heat.openstack.common.rpc.amqp return fu
nc(self, ctx, *args, **kwargs)
2013-08-06 23:28:46.440 26154 TRACE heat.openstack.common.rpc.amqp File "/opt/
stack/heat/heat/engine/service.py", line 251, in create_stack
2013-08-06 23:28:46.440 26154 TRACE heat.openstack.common.rpc.amqp stack.val
idate()
2013-08-06 23:28:46.440 26154 TRACE heat.openstack.common.rpc.amqp File "/opt/stack/heat/heat/engine/parser.py", line 261, in validate

2013-08-06 23:28:46.440 26154 TRACE heat.openstack.common.rpc.amqp File "/opt/stack/heat/heat/engine/parser.py", line 261, in validate
2013-08-06 23:28:46.440 26154 TRACE heat.openstack.common.rpc.amqp raise StackValidationFailed(message=str(ex))
2013-08-06 23:28:46.440 26154 TRACE heat.openstack.common.rpc.amqp TypeError: __str__ returned non-string (type Message)
2013-08-06 23:28:46.440 26154 TRACE heat.openstack.common.rpc.amqp
2013-08-06 23:28:46.441 26154 ERROR heat.openstack.common.rpc.common [-] Returning exception __str__ returned non-string (type Message) to caller
2013-08-06 23:28:46.441 26154 ERROR heat.openstack.common.rpc.common [-] ['Traceback (most recent call last):\n', ' File "/opt/stack/heat/heat/openstack/common/rpc/amqp.py", line 424, in _process_data\n **args)\n', ' File "/opt/stack/heat/heat/openstack/common/rpc/dispatcher.py", line 172, in dispatch\n result = getattr(proxyobj, method)(ctxt, **kwargs)\n', ' File "/opt/stack/heat/heat/engine/service.py", line 54, in wrapped\n return func(self, ctx, *args, **kwargs)\n', ' File "/opt/stack/heat/heat/engine/service.py", line 251, in create_stack\n stack.validate()\n', ' File "/opt/stack/heat/heat/engine/parser.py", line 261, in validate\n raise StackValidationFailed(message=str(ex))\n', 'TypeError: __str__ returned non-string (type Message)\n']
2013-08-06 23:28:46.441 26154 DEBUG heat.openstack.common.rpc.amqp [-] UNIQUE_ID is f13a605382184f24b7eb1b3b1516397f. _add_unique_id /opt/stack/heat/heat/openstack/common/rpc/amqp.py:325

no longer affects: python-heatclient
Steven Dake (sdake)
Changed in heat:
assignee: nobody → Steven Dake (sdake)
status: New → Triaged
importance: Undecided → Medium
milestone: none → icehouse-1
Changed in heat:
milestone: icehouse-1 → icehouse-2
Revision history for this message
Thomas Herve (therve) wrote :

I checked against latest master with the following template:

HeatTemplateFormatVersion: '2012-12-12'
Resources:
  Instance:
     Type: AWS::EC2::Instance
     Properties:
       ImageId: foo
       InstanceType: m1.tiny

$ heat stack-create -f template.yaml stack
ERROR: The Image (foo) could not be found.

So it seems to work now?

Revision history for this message
Steve Baker (steve-stevebaker) wrote :

Correct, this seems to be fixed.

Changed in heat:
status: Triaged → Fix Committed
Thierry Carrez (ttx)
Changed in heat:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in heat:
milestone: icehouse-2 → 2014.1
Revision history for this message
Kevin Fox (kevpn) wrote :

I'm still seeing this in RDO icehouse, but with a different message. Nothing useful is returned to the user launching the stack:

==> /var/log/heat/heat-engine.log <==
2014-05-08 17:29:48.043 4359 TRACE heat.engine.parser File "/usr/lib/python2.6/site-packages/heat/engine/parser.py", line 356, in validate
2014-05-08 17:29:48.043 4359 TRACE heat.engine.parser result = res.validate()
2014-05-08 17:29:48.043 4359 TRACE heat.engine.parser File "/usr/lib/python2.6/site-packages/heat/engine/resources/server.py", line 863, in validate
2014-05-08 17:29:48.043 4359 TRACE heat.engine.parser super(Server, self).validate()
2014-05-08 17:29:48.043 4359 TRACE heat.engine.parser File "/usr/lib/python2.6/site-packages/heat/engine/resource.py", line 646, in validate
2014-05-08 17:29:48.043 4359 TRACE heat.engine.parser return self.properties.validate()
2014-05-08 17:29:48.043 4359 TRACE heat.engine.parser File "/usr/lib/python2.6/site-packages/heat/engine/properties.py", line 313, in validate
2014-05-08 17:29:48.043 4359 TRACE heat.engine.parser raise exception.StackValidationFailed(message=msg)
2014-05-08 17:29:48.043 4359 TRACE heat.engine.parser StackValidationFailed: Property error : Instance: image "SL6-base" does not validate glance.image
2014-05-08 17:29:48.043 4359 TRACE heat.engine.parser

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.