latest oslo.middleware causes: TypeError: 'NoneType' object is not iterable

Bug #1518112 reported by Dan Prince
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
oslo.middleware
Fix Released
Undecided
Dan Prince
tripleo
Fix Released
Critical
Dan Prince

Bug Description

Using the latest oslo.middleware I'm now seeing the following errors when starting services like nova-api:

2015-11-19 22:44:48.348 29177 CRITICAL nova [-] TypeError: 'NoneType' object is not iterable
2015-11-19 22:44:48.348 29177 ERROR nova Traceback (most recent call last):
2015-11-19 22:44:48.348 29177 ERROR nova File "/usr/bin/nova-api", line 10, in <module>
2015-11-19 22:44:48.348 29177 ERROR nova sys.exit(main())
2015-11-19 22:44:48.348 29177 ERROR nova File "/usr/lib/python2.7/site-packages/nova/cmd/api.py", line 55, in main
2015-11-19 22:44:48.348 29177 ERROR nova server = service.WSGIService(api, use_ssl=should_use_ssl)
2015-11-19 22:44:48.348 29177 ERROR nova File "/usr/lib/python2.7/site-packages/nova/service.py", line 353, in __init__
2015-11-19 22:44:48.348 29177 ERROR nova self.app = self.loader.load_app(name)
2015-11-19 22:44:48.348 29177 ERROR nova File "/usr/lib/python2.7/site-packages/nova/wsgi.py", line 544, in load_app
2015-11-19 22:44:48.348 29177 ERROR nova return deploy.loadapp("config:%s" % self.config_path, name=name)
2015-11-19 22:44:48.348 29177 ERROR nova File "/usr/lib/python2.7/site-packages/paste/deploy/loadwsgi.py", line 247, in loadapp
2015-11-19 22:44:48.348 29177 ERROR nova return loadobj(APP, uri, name=name, **kw)
2015-11-19 22:44:48.348 29177 ERROR nova File "/usr/lib/python2.7/site-packages/paste/deploy/loadwsgi.py", line 272, in loadobj
2015-11-19 22:44:48.348 29177 ERROR nova return context.create()
2015-11-19 22:44:48.348 29177 ERROR nova File "/usr/lib/python2.7/site-packages/paste/deploy/loadwsgi.py", line 710, in create
2015-11-19 22:44:48.348 29177 ERROR nova return self.object_type.invoke(self)
2015-11-19 22:44:48.348 29177 ERROR nova File "/usr/lib/python2.7/site-packages/paste/deploy/loadwsgi.py", line 144, in invoke
2015-11-19 22:44:48.348 29177 ERROR nova **context.local_conf)
2015-11-19 22:44:48.348 29177 ERROR nova File "/usr/lib/python2.7/site-packages/paste/deploy/util.py", line 59, in fix_call
2015-11-19 22:44:48.348 29177 ERROR nova reraise(*exc_info)
2015-11-19 22:44:48.348 29177 ERROR nova File "/usr/lib/python2.7/site-packages/paste/deploy/compat.py", line 22, in reraise
2015-11-19 22:44:48.348 29177 ERROR nova exec('raise t, e, tb', dict(t=t, e=e, tb=tb))
2015-11-19 22:44:48.348 29177 ERROR nova File "/usr/lib/python2.7/site-packages/paste/deploy/util.py", line 56, in fix_call
2015-11-19 22:44:48.348 29177 ERROR nova val = callable(*args, **kw)
2015-11-19 22:44:48.348 29177 ERROR nova File "/usr/lib/python2.7/site-packages/nova/api/openstack/urlmap.py", line 160, in urlmap_factory
2015-11-19 22:44:48.348 29177 ERROR nova app = loader.get_app(app_name, global_conf=global_conf)
2015-11-19 22:44:48.348 29177 ERROR nova File "/usr/lib/python2.7/site-packages/paste/deploy/loadwsgi.py", line 350, in get_app
2015-11-19 22:44:48.348 29177 ERROR nova name=name, global_conf=global_conf).create()
2015-11-19 22:44:48.348 29177 ERROR nova File "/usr/lib/python2.7/site-packages/paste/deploy/loadwsgi.py", line 710, in create
2015-11-19 22:44:48.348 29177 ERROR nova return self.object_type.invoke(self)
2015-11-19 22:44:48.348 29177 ERROR nova File "/usr/lib/python2.7/site-packages/paste/deploy/loadwsgi.py", line 144, in invoke
2015-11-19 22:44:48.348 29177 ERROR nova **context.local_conf)
2015-11-19 22:44:48.348 29177 ERROR nova File "/usr/lib/python2.7/site-packages/paste/deploy/util.py", line 59, in fix_call
2015-11-19 22:44:48.348 29177 ERROR nova reraise(*exc_info)
2015-11-19 22:44:48.348 29177 ERROR nova File "/usr/lib/python2.7/site-packages/paste/deploy/compat.py", line 22, in reraise
2015-11-19 22:44:48.348 29177 ERROR nova exec('raise t, e, tb', dict(t=t, e=e, tb=tb))
2015-11-19 22:44:48.348 29177 ERROR nova File "/usr/lib/python2.7/site-packages/paste/deploy/util.py", line 56, in fix_call
2015-11-19 22:44:48.348 29177 ERROR nova val = callable(*args, **kw)
2015-11-19 22:44:48.348 29177 ERROR nova File "/usr/lib/python2.7/site-packages/nova/api/auth.py", line 79, in pipeline_factory_v21
2015-11-19 22:44:48.348 29177 ERROR nova return _load_pipeline(loader, local_conf[CONF.auth_strategy].split())
2015-11-19 22:44:48.348 29177 ERROR nova File "/usr/lib/python2.7/site-packages/nova/api/auth.py", line 62, in _load_pipeline
2015-11-19 22:44:48.348 29177 ERROR nova app = filter(app)
2015-11-19 22:44:48.348 29177 ERROR nova File "/usr/lib/python2.7/site-packages/oslo_middleware/base.py", line 47, in middleware_filter
2015-11-19 22:44:48.348 29177 ERROR nova return cls(app, conf)
2015-11-19 22:44:48.348 29177 ERROR nova File "/usr/lib/python2.7/site-packages/oslo_middleware/cors.py", line 89, in __init__
2015-11-19 22:44:48.348 29177 ERROR nova self._init_conf()
2015-11-19 22:44:48.348 29177 ERROR nova File "/usr/lib/python2.7/site-packages/oslo_middleware/cors.py", line 168, in _init_conf
2015-11-19 22:44:48.348 29177 ERROR nova self.add_origin(**self.oslo_conf[section])
2015-11-19 22:44:48.348 29177 ERROR nova File "/usr/lib/python2.7/site-packages/oslo_middleware/cors.py", line 183, in add_origin
2015-11-19 22:44:48.348 29177 ERROR nova for origin in allowed_origin:
2015-11-19 22:44:48.348 29177 ERROR nova TypeError: 'NoneType' object is not iterable
2015-11-19 22:44:48.348 29177 ERROR nova

----

The issue seems to be that in c4957606cb290a639a4a02fbf648044242c5c207 we made allowed_origin a list... but not all of the oslo.middleware checks respect the default value being None.

Dan Prince (dan-prince)
Changed in tripleo:
assignee: nobody → Dan Prince (dan-prince)
importance: Undecided → Critical
status: New → In Progress
Changed in oslo.middleware:
assignee: nobody → Dan Prince (dan-prince)
status: New → In Progress
Revision history for this message
ChangBo Guo(gcb) (glongwave) wrote :

oslo.middleware Fix Proposed in https://review.openstack.org/#/c/247831/

Changed in oslo.middleware:
status: In Progress → Fix Released
Ben Nemec (bnemec)
Changed in tripleo:
status: In Progress → 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.