validation error with no details

Bug #1195228 reported by Robert Collins
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Heat
New
Undecided
Unassigned

Bug Description

I have a template i'm trying to boot which fails with this error:
400 Bad Request

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

 Remote error: StackValidationFailed [u'Traceback (most recent call last):\n', u' File "/opt/stack/venvs/heat/local/lib/python2.7/site-packages/heat/openstack/common/rpc/amqp.py", line 434, in _process_data\n **args)\n', u' File "/opt/stack/venvs/heat/local/lib/python2.7/site-packages/heat/openstack/common/rpc/dispatcher.py", line 172, in dispatch\n result = getattr(proxyobj, method)(ctxt, **kwargs)\n', u' File "/opt/stack/venvs/heat/local/lib/python2.7/site-packages/heat/engine/service.py", line 51, in wrapped\n return func(self, ctx, *args, **kwargs)\n', u' File "/opt/stack/venvs/heat/local/lib/python2.7/site-packages/heat/engine/service.py", line 222, in create_stack\n stack.validate()\n', u' File "/opt/stack/venvs/heat/local/lib/python2.7/site-packages/heat/engine/parser.py", line 252, in validate\n logger.exception(ex)\n', u'StackValidationFailed\n'].

Given there was no explanation but the code looks like it should have one I popped into pdb and indeed:
---
> /opt/stack/venvs/heat/local/lib/python2.7/site-packages/heat/engine/parser.py(252)validate()
-> logger.exception(ex)
(Pdb) print ex

(Pdb) print res
AccessKey "Key"

---

I suspect the AccessKey resource is raising a bad error.

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

And indeed, its this:
> /opt/stack/venvs/heat/local/lib/python2.7/site-packages/heat/engine/properties.py(179)validate()
-> self[key]
((Pdb)) list
174
175 def validate(self, with_value=True):
176 for (key, prop) in self.props.items():
177 if with_value:
178 try:
179 -> self[key]
180 except ValueError as e:
181 msg = "Property error : %s" % str(e)
182 raise exception.StackValidationFailed(message=msg)
183
184 # are there unimplemented Properties

self[key] here raises AssertionError not ValueError (and btw the error should really capture 'self' and 'key' for debugging.

Revision history for this message
Steven Hardy (shardy) wrote :

Hi, thanks for the report!

Can you provide a link to a template which exhibits this problem, or attach a minimal reproducer template?

I don't yet understand how you're getting AssertionError from self[key], it looks like that statement could only result in ValueError or KeyError so a reproducer will help us more clearly understand the error you're seeing :)

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

And here is the source of the assertion:
> /opt/stack/venvs/heat/local/lib/python2.7/site-packages/heat/engine/resource.py(421)physical_resource_name()
-> assert self.id is not None
(((Pdb))) list
420 def physical_resource_name(self):
421 -> assert self.id is not None
422
423 return '%s-%s-%s' % (self.stack.name,
424 self.name,
425 short_id.get_id(self.id))
426

Which we get into via resolve_runtime_data's transform.
  /opt/stack/venvs/heat/local/lib/python2.7/site-packages/heat/engine/template.py(145)handle_resource_ref()
-> return resources[arg].FnGetRefId()
  /opt/stack/venvs/heat/lib/python2.7/site-packages/heat/engine/resources/user.py(91)FnGetRefId()
-> return unicode(self.physical_resource_name())
> /opt/stack/venvs/heat/local/lib/python2.7/site-packages/heat/engine/resource.py(421)physical_resource_name()
-> assert self.id is not None

Where is self.id meant to be set?

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

(oh, and self - print self
User "User"
)

Revision history for this message
Steven Hardy (shardy) wrote :

Figured out on IRC that reporter was on an old version of heat, which pre-dated the fix for bug #1191931

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.