resource-list fails on stacks that were created before needed_by column was added
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Heat |
Fix Released
|
Medium
|
Zane Bitter | ||
Newton |
Fix Committed
|
Medium
|
Zane Bitter | ||
Ocata |
Fix Committed
|
Medium
|
Zane Bitter | ||
Pike |
Fix Released
|
Medium
|
Zane Bitter |
Bug Description
We added the 'needed_by' column to the Resource table in the database back in Kilo. However, there is no data migration for that (or any other) column. Therefore, stacks that predate the point where we started setting the default to [] instead of None (in Liberty) will have null values for that column.
That's fine, but Heat is expecting that needed_by is always a list, and barfs when getting the resource list if it isn't:
Exception handling resource: argument of type 'NoneType' is not iterable
Traceback (most recent call last):
File "/usr/lib/
res = self.dispatcher
File "/usr/lib/
return self._do_
File "/usr/lib/
result = func(ctxt, **new_args)
File "/usr/lib/
return f(*args, **kwargs)
File "/usr/lib/
return func(self, ctx, *args, **kwargs)
File "/usr/lib/
for resource in rsrcs]
File "/usr/lib/
rpc_
File "/usr/lib/
if r.id in self.needed_by]
(Traceback is from Newton, but the problem still exists AFAICT.)
Note that in theory we're not supposed to hit this path except in convergence, so although it would be simple to fix I'm not 100% sure that we'd be getting at the root cause.