Webhook call causees an error: AttributeError: 'NoneType' object has no attribute 'update'

Bug #1808988 reported by Pavel
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
senlin
Fix Released
Undecided
Unassigned

Bug Description

2018-12-14 12:45:36.551 22 ERROR senlin.api.common.wsgi [req-9841eaae-c5e1-4bd3-a77d-dc84e43cbbd8 b1a1a75ef1ac478aaf11a9c8486dd4d4 d4f1a92de00e4509b4923f9bacc2a1f6 - - -] Unexpected error occurred serving API: 'NoneType' object has no att
ribute 'update'
2018-12-14 12:45:36.551 22 ERROR senlin.api.common.wsgi Traceback (most recent call last):
2018-12-14 12:45:36.551 22 ERROR senlin.api.common.wsgi File "/var/lib/kolla/venv/local/lib/python2.7/site-packages/senlin/api/common/wsgi.py", line 626, in __call__
2018-12-14 12:45:36.551 22 ERROR senlin.api.common.wsgi request, **action_args)
2018-12-14 12:45:36.551 22 ERROR senlin.api.common.wsgi File "/var/lib/kolla/venv/local/lib/python2.7/site-packages/senlin/api/common/wsgi.py", line 702, in dispatch
2018-12-14 12:45:36.551 22 ERROR senlin.api.common.wsgi return method(*args, **kwargs)
2018-12-14 12:45:36.551 22 ERROR senlin.api.common.wsgi File "/var/lib/kolla/venv/local/lib/python2.7/site-packages/senlin/api/common/wsgi.py", line 773, in version_select
2018-12-14 12:45:36.551 22 ERROR senlin.api.common.wsgi return func.func(self, *args, **kwargs)
2018-12-14 12:45:36.551 22 ERROR senlin.api.common.wsgi File "/var/lib/kolla/venv/local/lib/python2.7/site-packages/senlin/api/common/util.py", line 42, in policy_checker
2018-12-14 12:45:36.551 22 ERROR senlin.api.common.wsgi return handler(controller, req, **kwargs)
2018-12-14 12:45:36.551 22 ERROR senlin.api.common.wsgi File "/var/lib/kolla/venv/local/lib/python2.7/site-packages/senlin/api/openstack/v1/webhooks.py", line 51, in trigger
2018-12-14 12:45:36.551 22 ERROR senlin.api.common.wsgi res = self.rpc_client.call(req.context, 'webhook_trigger', obj)
2018-12-14 12:45:36.551 22 ERROR senlin.api.common.wsgi File "/var/lib/kolla/venv/local/lib/python2.7/site-packages/senlin/rpc/client.py", line 56, in call
2018-12-14 12:45:36.551 22 ERROR senlin.api.common.wsgi return client.call(ctxt, method, req=req)
2018-12-14 12:45:36.551 22 ERROR senlin.api.common.wsgi File "/var/lib/kolla/venv/local/lib/python2.7/site-packages/oslo_messaging/rpc/client.py", line 505, in call
2018-12-14 12:45:36.551 22 ERROR senlin.api.common.wsgi return self.prepare().call(ctxt, method, **kwargs)
2018-12-14 12:45:36.551 22 ERROR senlin.api.common.wsgi File "/var/lib/kolla/venv/local/lib/python2.7/site-packages/oslo_messaging/rpc/client.py", line 179, in call
2018-12-14 12:45:36.551 22 ERROR senlin.api.common.wsgi retry=self.retry)
2018-12-14 12:45:36.551 22 ERROR senlin.api.common.wsgi File "/var/lib/kolla/venv/local/lib/python2.7/site-packages/oslo_messaging/transport.py", line 133, in _send
2018-12-14 12:45:36.551 22 ERROR senlin.api.common.wsgi retry=retry)
2018-12-14 12:45:36.551 22 ERROR senlin.api.common.wsgi File "/var/lib/kolla/venv/local/lib/python2.7/site-packages/oslo_messaging/_drivers/amqpdriver.py", line 584, in send
2018-12-14 12:45:36.551 22 ERROR senlin.api.common.wsgi call_monitor_timeout, retry=retry)
2018-12-14 12:45:36.551 22 ERROR senlin.api.common.wsgi File "/var/lib/kolla/venv/local/lib/python2.7/site-packages/oslo_messaging/_drivers/amqpdriver.py", line 575, in _send
2018-12-14 12:45:36.551 22 ERROR senlin.api.common.wsgi raise result
2018-12-14 12:45:36.551 22 ERROR senlin.api.common.wsgi AttributeError: 'NoneType' object has no attribute 'update'
2018-12-14 12:45:36.551 22 ERROR senlin.api.common.wsgi Traceback (most recent call last):
2018-12-14 12:45:36.551 22 ERROR senlin.api.common.wsgi
2018-12-14 12:45:36.551 22 ERROR senlin.api.common.wsgi File "/var/lib/kolla/venv/local/lib/python2.7/site-packages/oslo_messaging/rpc/server.py", line 163, in _process_incoming
2018-12-14 12:45:36.551 22 ERROR senlin.api.common.wsgi res = self.dispatcher.dispatch(message)
2018-12-14 12:45:36.551 22 ERROR senlin.api.common.wsgi
2018-12-14 12:45:36.551 22 ERROR senlin.api.common.wsgi File "/var/lib/kolla/venv/local/lib/python2.7/site-packages/oslo_messaging/rpc/dispatcher.py", line 265, in dispatch
2018-12-14 12:45:36.551 22 ERROR senlin.api.common.wsgi return self._do_dispatch(endpoint, method, ctxt, args)
2018-12-14 12:45:36.551 22 ERROR senlin.api.common.wsgi
2018-12-14 12:45:36.551 22 ERROR senlin.api.common.wsgi File "/var/lib/kolla/venv/local/lib/python2.7/site-packages/oslo_messaging/rpc/dispatcher.py", line 194, in _do_dispatch
2018-12-14 12:45:36.551 22 ERROR senlin.api.common.wsgi result = func(ctxt, **new_args)
2018-12-14 12:45:36.551 22 ERROR senlin.api.common.wsgi
2018-12-14 12:45:36.551 22 ERROR senlin.api.common.wsgi File "/var/lib/kolla/venv/local/lib/python2.7/site-packages/osprofiler/profiler.py", line 159, in wrapper
2018-12-14 12:45:36.551 22 ERROR senlin.api.common.wsgi result = f(*args, **kwargs)
2018-12-14 12:45:36.551 22 ERROR senlin.api.common.wsgi
2018-12-14 12:45:36.551 22 ERROR senlin.api.common.wsgi File "/var/lib/kolla/venv/local/lib/python2.7/site-packages/senlin/engine/service.py", line 72, in wrapped
2018-12-14 12:45:36.551 22 ERROR senlin.api.common.wsgi return func(self, ctx, req_obj)
2018-12-14 12:45:36.551 22 ERROR senlin.api.common.wsgi
2018-12-14 12:45:36.551 22 ERROR senlin.api.common.wsgi File "/var/lib/kolla/venv/local/lib/python2.7/site-packages/senlin/engine/service.py", line 2521, in webhook_trigger
2018-12-14 12:45:36.551 22 ERROR senlin.api.common.wsgi data.update(params)
2018-12-14 12:45:36.551 22 ERROR senlin.api.common.wsgi
2018-12-14 12:45:36.551 22 ERROR senlin.api.common.wsgi AttributeError: 'NoneType' object has no attribute 'update'
2018-12-14 12:45:36.551 22 ERROR senlin.api.common.wsgi
2018-12-14 12:45:36.551 22 ERROR senlin.api.common.wsgi
2018-12-14 12:45:36.565 22 INFO eventlet.wsgi.server [req-9841eaae-c5e1-4bd3-a77d-dc84e43cbbd8 b1a1a75ef1ac478aaf11a9c8486dd4d4 d4f1a92de00e4509b4923f9bacc2a1f6 - - -] 192.168.2.12,10.0.0.16 - - [14/Dec/2018 12:45:36] "POST /v1/webhooks/1035e373-fbd7-45b5-9579-a057015608e7/trigger?V=1 HTTP/1.1" 500 450 13.907207

I've created a receiver via heat template:
  receiver_scale_in:
    type: OS::Senlin::Receiver
    properties:
      cluster: {get_resource: cluster}
      action: CLUSTER_SCALE_IN
      type: webhook

It doesn't have any parameters defined. But Aodh sends request with parameters. It causes the error because receiver.params is None:
https://github.com/openstack/senlin/blob/master/senlin/engine/service.py#L2531
https://github.com/openstack/senlin/blob/master/senlin/engine/service.py#L2539

I already have a hotfix. Will push it shortly.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to senlin (master)

Reviewed: https://review.openstack.org/625932
Committed: https://git.openstack.org/cgit/openstack/senlin/commit/?id=c220ce07138a33cd55e32afee8d6d97481df4f99
Submitter: Zuul
Branch: master

commit c220ce07138a33cd55e32afee8d6d97481df4f99
Author: Pavel Sinkevych <email address hidden>
Date: Fri Dec 14 17:19:29 2018 +0300

    Fix `'NoneType' object has no attribute 'update'` when receiver params are not defined but a request contains data

    When receiver doesn't have defined params, receiver.params gets None from the DB.
    After getting the receiver, senlin is trying to apply params for the request when they are defined.
    But `update` method doesn't work for None type.
    The solution is to set emtpy dictionary for receiver.params when they are not defined.

    Change-Id: Ib0fa9ca7c8bde8d6f6d15434ecacd80df4e91157
    Closes-Bug: #1808988

Changed in senlin:
status: New → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/senlin 7.0.0.0b1

This issue was fixed in the openstack/senlin 7.0.0.0b1 development milestone.

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.