TypeError: argument of type 'NoneType' is not iterable

Bug #1464379 reported by Jason Dunsmore
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Heat
Fix Released
High
Jason Dunsmore

Bug Description

After the db migration 056 (https://github.com/openstack/heat/blob/master/heat/db/sqlalchemy/migrate_repo/versions/056_convergence_parameter_storage.py), it's possible that the environment is stored as NULL in the database. If you have a stack like this and then list stacks, you'll get the following traceback:

2015-06-11 10:37:15.979 2333 ERROR oslo_messaging._drivers.common [req-89f5f4a9-da33-4148-8210-360a5a90d3a4] ['Traceback (most recent call last):
  File "/opt/heat/lib/python2.7/site-packages/oslo_messaging/rpc/dispatcher.py", line 142, in _dispatch_and_reply
    executor_callback))
  File "/opt/heat/lib/python2.7/site-packages/oslo_messaging/rpc/dispatcher.py", line 186, in _dispatch
    executor_callback)
  File "/opt/heat/lib/python2.7/site-packages/oslo_messaging/rpc/dispatcher.py", line 130, in _do_dispatch
    result = func(ctxt, **new_args)
  File "/opt/heat/lib/python2.7/site-packages/osprofiler/profiler.py", line 105, in wrapper
    return f(*args, **kwargs)
  File "/opt/heat/lib/python2.7/site-packages/heat/common/context.py", line 267, in wrapped
    return func(self, ctx, *args, **kwargs)
  File "/opt/heat/lib/python2.7/site-packages/heat/engine/service.py", line 511, in list_stacks
    return [api.format_stack(stack) for stack in stacks]
  File "/opt/heat/lib/python2.7/site-packages/heat/engine/stack.py", line 380, in load_all
    not_tags_any) or []
  File "/opt/heat/lib/python2.7/site-packages/heat/objects/stack.py", line 123, in get_all
    db_stacks)
  File "/opt/heat/lib/python2.7/site-packages/heat/objects/stack.py", line 122, in <lambda>
    db_stack),
  File "/opt/heat/lib/python2.7/site-packages/heat/objects/stack.py", line 70, in _from_db_object
    context, db_stack[\'raw_template_id\']))
  File "/opt/heat/lib/python2.7/site-packages/heat/objects/raw_template.py", line 69, in get_by_id
    raw_template = cls._from_db_object(context, cls(), raw_template_db)
  File "/opt/heat/lib/python2.7/site-packages/heat/objects/raw_template.py", line 50, in _from_db_object
    if env_fmt.ENCRYPTED_PARAM_NAMES in tpl.environment:
TypeError: argument of type 'NoneType' is not iterable

Changed in heat:
assignee: nobody → Jason Dunsmore (jasondunsmore)
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/190797

Changed in heat:
status: New → In Progress
Changed in heat:
importance: Undecided → High
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to heat (master)

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

commit b6f865fa0081b25a9074ef1acccf752ff39b354f
Author: Jason Dunsmore <email address hidden>
Date: Thu Jun 11 15:01:52 2015 -0500

    Check that env is not None before decrypting

    After database migration 056, it became possible to have an environment
    of None. Check that env is not None before looking inside it.

    Change-Id: Ic498e8e630608886178df83d1e7a503525834573
    Closes-Bug: #1464379

Changed in heat:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in heat:
milestone: none → liberty-1
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in heat:
milestone: liberty-1 → 5.0.0
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.