TypeError on None value for CommaDelimitedListParam

Bug #1500452 reported by James Pic
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Heat
Fix Released
Medium
Peter Razumovsky

Bug Description

When doing a heat stack-show, heat-api crashes because the __str__ method isn't prepared for self.parsed to be None:

2015-09-28 14:49:08.975 14782 ERROR root [req-6968958a-ef92-4d27-8e14-1b161074f220 ] Exception handling resource:
Traceback (most recent call last):

  File "/usr/lib/python2.7/site-packages/oslo/messaging/rpc/dispatcher.py", line 134, in _dispatch_and_reply
    incoming.message))

  File "/usr/lib/python2.7/site-packages/oslo/messaging/rpc/dispatcher.py", line 177, in _dispatch
    return self._do_dispatch(endpoint, method, ctxt, args)

  File "/usr/lib/python2.7/site-packages/oslo/messaging/rpc/dispatcher.py", line 123, in _do_dispatch
    result = getattr(endpoint, method)(ctxt, **new_args)

  File "/usr/lib/python2.7/site-packages/heat/engine/service.py", line 69, in wrapped
    return func(self, ctx, *args, **kwargs)

  File "/usr/lib/python2.7/site-packages/heat/engine/service.py", line 469, in show_stack
    return [api.format_stack(stack) for stack in stacks]

  File "/usr/lib/python2.7/site-packages/heat/engine/api.py", line 97, in format_stack
    api.STACK_PARAMETERS: stack.parameters.map(str),

  File "/usr/lib/python2.7/site-packages/heat/engine/parameters.py", line 482, in map
    for n, p in six.iteritems(self.params) if filter_func(p))

  File "/usr/lib/python2.7/site-packages/heat/engine/parameters.py", line 482, in <genexpr>
    for n, p in six.iteritems(self.params) if filter_func(p))

  File "/usr/lib/python2.7/site-packages/heat/engine/parameters.py", line 363, in __str__
    return ",".join(self.value())

TypeError

I noticed this seems to happen after a stack-update call was made without a parameter that was used in a stack-create call.

Rabi Mishra (rabi)
Changed in heat:
assignee: nobody → Rabi Mishra (rabi)
Revision history for this message
James Pic (jamespic) wrote : Re: [Bug 1500452] Re: TypeError on None value for CommaDelimitedListParam

I'm still trying to isolate the bug in a minimal template, the use case
described in the bug above is incorrect - my bad. If it helps I'd like to
contribute a patch with a test case and a fix, let me know.

Le lun. 28 sept. 2015 16:30, Rabi Mishra <email address hidden> a
écrit :

> ** Changed in: heat
> Assignee: (unassigned) => Rabi Mishra (rabi)
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1500452
>
> Title:
> TypeError on None value for CommaDelimitedListParam
>
> Status in heat:
> New
>
> Bug description:
> When doing a heat stack-show, heat-api crashes because the __str__
> method isn't prepared for self.parsed to be None:
>
> 2015-09-28 14:49:08.975 14782 ERROR root
> [req-6968958a-ef92-4d27-8e14-1b161074f220 ] Exception handling resource:
> Traceback (most recent call last):
>
> File
> "/usr/lib/python2.7/site-packages/oslo/messaging/rpc/dispatcher.py", line
> 134, in _dispatch_and_reply
> incoming.message))
>
> File
> "/usr/lib/python2.7/site-packages/oslo/messaging/rpc/dispatcher.py", line
> 177, in _dispatch
> return self._do_dispatch(endpoint, method, ctxt, args)
>
> File
> "/usr/lib/python2.7/site-packages/oslo/messaging/rpc/dispatcher.py", line
> 123, in _do_dispatch
> result = getattr(endpoint, method)(ctxt, **new_args)
>
> File "/usr/lib/python2.7/site-packages/heat/engine/service.py", line
> 69, in wrapped
> return func(self, ctx, *args, **kwargs)
>
> File "/usr/lib/python2.7/site-packages/heat/engine/service.py", line
> 469, in show_stack
> return [api.format_stack(stack) for stack in stacks]
>
> File "/usr/lib/python2.7/site-packages/heat/engine/api.py", line 97,
> in format_stack
> api.STACK_PARAMETERS: stack.parameters.map(str),
>
> File "/usr/lib/python2.7/site-packages/heat/engine/parameters.py",
> line 482, in map
> for n, p in six.iteritems(self.params) if filter_func(p))
>
> File "/usr/lib/python2.7/site-packages/heat/engine/parameters.py",
> line 482, in <genexpr>
> for n, p in six.iteritems(self.params) if filter_func(p))
>
> File "/usr/lib/python2.7/site-packages/heat/engine/parameters.py",
> line 363, in __str__
> return ",".join(self.value())
>
> TypeError
>
> I noticed this seems to happen after a stack-update call was made
> without a parameter that was used in a stack-create call.
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/heat/+bug/1500452/+subscriptions
>

Revision history for this message
Rabi Mishra (rabi) wrote :

sure. please assign it to yourself, I you plan to work on it,

Changed in heat:
assignee: Rabi Mishra (rabi) → nobody
James Pic (jamespic)
Changed in heat:
assignee: nobody → James Pic (jamespic)
Changed in heat:
milestone: none → mitaka-1
importance: Undecided → Medium
status: New → Triaged
Revision history for this message
Sergey Kraynev (skraynev) wrote :

@James: As I see, you still work on this, but did not upload fix. So I move it to M2 milestone.

Changed in heat:
milestone: mitaka-1 → mitaka-2
Revision history for this message
James Pic (jamespic) wrote :

Thanks for the notification, I couldn't find the link anymore, so here's my problem: I just can't reproduce it anymore ! Unassigning

Changed in heat:
assignee: James Pic (jamespic) → nobody
Changed in heat:
milestone: mitaka-2 → mitaka-3
Changed in heat:
milestone: mitaka-3 → mitaka-rc1
Changed in heat:
assignee: nobody → Peter Razumovsky (prazumovsky)
Revision history for this message
Peter Razumovsky (prazumovsky) wrote :

Looks like patch https://review.openstack.org/#/c/234055/ fix this issue, because now self.parsed updated with default value correctly. This patch also backported to L and K releases.

Changed in heat:
status: Triaged → Fix Released
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.