Dispatcher failed to handle the event: 'NoneType' object has no attribute 'status_reason'

Bug #1666751 reported by XueFeng Liu
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
senlin
New
Undecided
Unassigned

Bug Description

When use command `senlin node-recover node-5707ae7a-002` we will get problem 1666245:
https://bugs.launchpad.net/senlin/+bug/1666245

And when we solve problem 1666245. We will get following problem:
2017-02-21 16:13:15.584 ERROR senlin.engine.event [req-d1a5947b-12bb-4f0b-abfc-d7ff71553102 None None] Dispatcher failed to handle the event: 'NoneType' object has no attribute 'status_reason'
2017-02-21 16:13:15.584 TRACE senlin.engine.event Traceback (most recent call last):
2017-02-21 16:13:15.584 TRACE senlin.engine.event File "/opt/stack/senlin/senlin/engine/event.py", line 73, in _dump
2017-02-21 16:13:15.584 TRACE senlin.engine.event phase=phase, reason=reason, timestamp=timestamp)
2017-02-21 16:13:15.584 TRACE senlin.engine.event File "/usr/local/lib/python2.7/dist-packages/stevedore/extension.py", line 259, in map_method
2017-02-21 16:13:15.584 TRACE senlin.engine.event method_name, *args, **kwds)
2017-02-21 16:13:15.584 TRACE senlin.engine.event File "/usr/local/lib/python2.7/dist-packages/stevedore/extension.py", line 232, in map
2017-02-21 16:13:15.584 TRACE senlin.engine.event self._invoke_one_plugin(response.append, func, e, args, kwds)
2017-02-21 16:13:15.584 TRACE senlin.engine.event File "/usr/local/lib/python2.7/dist-packages/stevedore/extension.py", line 263, in _invoke_one_plugin
2017-02-21 16:13:15.584 TRACE senlin.engine.event response_callback(func(e, *args, **kwds))
2017-02-21 16:13:15.584 TRACE senlin.engine.event File "/usr/local/lib/python2.7/dist-packages/stevedore/extension.py", line 237, in _call_extension_method
2017-02-21 16:13:15.584 TRACE senlin.engine.event return getattr(extension.obj, method_name)(*args, **kwds)
2017-02-21 16:13:15.584 TRACE senlin.engine.event File "/opt/stack/senlin/senlin/events/database.py", line 35, in dump
2017-02-21 16:13:15.584 TRACE senlin.engine.event reason = kwargs.get('reason') or entity.status_reason
2017-02-21 16:13:15.584 TRACE senlin.engine.event AttributeError: 'NoneType' object has no attribute 'status_reason'
2017-02-21 16:13:15.584 TRACE senlin.engine.event
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/eventlet/hubs/hub.py", line 457, in fire_timers
    timer()
  File "/usr/local/lib/python2.7/dist-packages/eventlet/hubs/timer.py", line 58, in __call__
    cb(*args, **kw)
  File "/usr/local/lib/python2.7/dist-packages/eventlet/greenthread.py", line 214, in main
    result = function(*args, **kwargs)
  File "/opt/stack/senlin/senlin/engine/scheduler.py", line 77, in _start_with_trace
    return func(*args, **kwargs)
  File "/opt/stack/senlin/senlin/engine/actions/base.py", line 470, in ActionProc
    EVENT.info(action, consts.PHASE_START)
  File "/opt/stack/senlin/senlin/engine/event.py", line 96, in info
    LOG.info(FMT, _event_data(action, phase, reason))
  File "/opt/stack/senlin/senlin/engine/event.py", line 47, in _event_data
    return dict(name=action.entity.name,
AttributeError: 'NoneType' object has no attribute 'name'
2017-02-21 16:13:15.587 DEBUG oslo_messaging._drivers.amqpdriver [req-884eebc4-7f17-4074-9ad3-32bd58b4fd5a None service] sending reply msg_id: 52b7dc4829194f349ad0af74179cb6dc reply queue: reply_fbf4e8b7552a415e9dbe203e555fcc25 time elapsed: 0.469329096377s from (pid=8191) _send_reply /usr/local/lib/python2.7/dist-packages/oslo_messaging/_drivers/amqpdriver.py:73
2017-02-21 16:13:15.610 DEBUG oslo_messaging._drivers.amqpdriver [-] received reply msg_id: 52b7dc4829194f349ad0af74179cb6dc from (pid=8191) __call__ /usr/local/lib/python2.7/dist-packages/oslo_messaging/_drivers/amqpdriver.py:299
2017-02-21 16:13:16.043 ERROR senlin.engine.event [req-884eebc4-7f17-4074-9ad3-32bd58b4fd5a None None] Dispatcher failed to handle the event: 'NoneType' object has no attribute 'status_reason'

Revision history for this message
XueFeng Liu (jonnary-liu) wrote :

-> status = kwargs.get('phase') or entity.status
(Pdb) l
 32 ctx = action.context
 33 entity = action.entity
 34 if entity is None:
 35 import pdb
 36 pdb.set_trace()
 37 -> status = kwargs.get('phase') or entity.status
 38 reason = kwargs.get('reason') or entity.status_reason
 39 otype = cls._check_entity(entity)
 40 cluster_id = entity.id if otype == 'CLUSTER' else entity.cluster_id
 41 # use provided timestamp if any
 42 timestamp = kwargs.get('timestamp') or timeutils.utcnow(True)
(Pdb) bt
  /usr/local/lib/python2.7/dist-packages/eventlet/greenthread.py(214)main()
-> result = function(*args, **kwargs)
  /opt/stack/senlin/senlin/engine/scheduler.py(77)_start_with_trace()
-> return func(*args, **kwargs)
  /opt/stack/senlin/senlin/engine/actions/base.py(470)ActionProc()
-> EVENT.info(action, consts.PHASE_START)
  /opt/stack/senlin/senlin/engine/event.py(95)info()
-> _dump(logging.INFO, action, phase, reason, timestamp)
  /opt/stack/senlin/senlin/engine/event.py(73)_dump()
-> phase=phase, reason=reason, timestamp=timestamp)
  /usr/local/lib/python2.7/dist-packages/stevedore/extension.py(259)map_method()
-> method_name, *args, **kwds)
  /usr/local/lib/python2.7/dist-packages/stevedore/extension.py(232)map()
-> self._invoke_one_plugin(response.append, func, e, args, kwds)
  /usr/local/lib/python2.7/dist-packages/stevedore/extension.py(263)_invoke_one_plugin()
-> response_callback(func(e, *args, **kwds))
  /usr/local/lib/python2.7/dist-packages/stevedore/extension.py(237)_call_extension_method()
-> return getattr(extension.obj, method_name)(*args, **kwds)
> /opt/stack/senlin/senlin/events/database.py(37)dump()
-> status = kwargs.get('phase') or entity.status
(Pdb) p action
<senlin.engine.actions.cluster_action.ClusterAction object at 0x7fbde66f3850>
(Pdb) p action.entity
None
(Pdb) p action.__dict__
{'domain': None, 'updated_at': None, 'entity': None, 'owner': '0d2e9936-3ec7-4733-8344-e69097980895', 'id': '75d01266-35bd-46a0-b2cf-1d83e539bac6', 'data': {}, 'cause': u'RPC Request', 'status': u'RUNNING', 'inputs': {}, 'context': <senlin.common.context.RequestContext object at 0x7fbde6b087d0>, 'outputs': {}, 'start_time': 1487743104.0, 'user': u'3c4d64baadcd437d8dd49054899e73dd', 'status_reason': u'The action is being processed.', 'target': 'fe35b2b7-1e90-4c17-8fcf-4ef1890f2ebd', 'name': u'cluster_check_fe35b2b7', 'created_at': datetime.datetime(2017, 2, 22, 5, 58, 31, tzinfo=<UTC>), 'interval': -1, 'project': u'cf7a6ae28dde4f46aa8fe55d318a608f', 'end_time': None, 'timeout': 3600, 'action': u'CLUSTER_CHECK'}
(Pdb)

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.