node update() takes exactly 4 arguments (3 given) when recovery with lb_policy

Bug #1809652 reported by sapd
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
senlin
Fix Released
Undecided
Unassigned

Bug Description

When attach load balancer policy for a cluster, when it recovery it has error

2018-12-24 17:55:18.013 1 ERROR senlin.engine.actions.base [req-c8c181a0-6430-4b34-8bdb-3cca15ad4ee9 - - - - -] Unexpected exception occurred during action NODE_RECOVER (dd44c10a-d5c7-454b-b89a-857f194d9ff2) execution: update() takes exactly 4 arguments (3 given): TypeError: update() takes exactly 4 arguments (3 given)
2018-12-24 17:55:18.013 1 ERROR senlin.engine.actions.base Traceback (most recent call last):
2018-12-24 17:55:18.013 1 ERROR senlin.engine.actions.base File "/usr/local/lib/python2.7/dist-packages/senlin/engine/actions/base.py", line 646, in ActionProc
2018-12-24 17:55:18.013 1 ERROR senlin.engine.actions.base result, reason = action.execute()
2018-12-24 17:55:18.013 1 ERROR senlin.engine.actions.base File "/usr/local/lib/python2.7/dist-packages/senlin/engine/actions/node_action.py", line 280, in execute
2018-12-24 17:55:18.013 1 ERROR senlin.engine.actions.base self.policy_check(saved_cluster_id, 'AFTER')
2018-12-24 17:55:18.013 1 ERROR senlin.engine.actions.base File "/usr/local/lib/python2.7/dist-packages/senlin/engine/actions/base.py", line 520, in policy_check
2018-12-24 17:55:18.013 1 ERROR senlin.engine.actions.base method(cluster_id, self)
2018-12-24 17:55:18.013 1 ERROR senlin.engine.actions.base File "/usr/local/lib/python2.7/dist-packages/senlin/policies/lb_policy.py", line 653, in post_op
2018-12-24 17:55:18.013 1 ERROR senlin.engine.actions.base candidates, cp, lb_driver, action)
2018-12-24 17:55:18.013 1 ERROR senlin.engine.actions.base File "/usr/local/lib/python2.7/dist-packages/senlin/policies/lb_policy.py", line 583, in _process_recovery
2018-12-24 17:55:18.013 1 ERROR senlin.engine.actions.base no.Node.update(action.context, values)
2018-12-24 17:55:18.013 1 ERROR senlin.engine.actions.base TypeError: update() takes exactly 4 arguments (3 given)
2018-12-24 17:55:18.013 1 ERROR senlin.engine.actions.base
2018-12-24 17:55:18.247 1 ERROR senlin.engine.event [req-c8c181a0-6430-4b34-8bdb-3cca15ad4ee9 - - - - -] node-SshTsU2k[b8c1683f] NODE_RECOVER[dd44c10a] error: update() takes exactly 4 arguments (3 given)

Changed in senlin:
assignee: nobody → Nguyễn Ngọc Thái (crownwin)
sapd (saphi070)
Changed in senlin:
status: New → Confirmed
assignee: Nguyễn Ngọc Thái (crownwin) → nobody
assignee: nobody → sapd (saphi070)
Revision history for this message
Thai Nguyen Ngoc (thainn2) wrote :

Hi you, I also have this error. After following source code, I detected function "_process_recovery" in senlin/senlin/policies/lb_policy.py having "no.Node.update(action.context, values)" miss a argument: node.id. Because it call update(cls, context, obj_id, values).

I tried to edit no.Node.update(action.context, node.id, values) and succeeded.

def _process_recovery(self, candidates, policy, driver, action):
        # Process node recovery action
        node = action.entity
        data = node.data
        lb_member = data.get('lb_member', None)
        recovery = data.pop('recovery', None)
        values = {}
        # lb_member is None, need to add to lb pool
        if not lb_member:
            values['data'] = data
            no.Node.update(action.context, values)
            return candidates

        # was a member of lb pool, check whether has been recreated
        if recovery is not None and recovery == consts.RECOVER_RECREATE:
            self._remove_member(action.context, candidates, policy, driver,
                                handle_err=False)
            data.pop('lb_member', None)
            values['data'] = data
            no.Node.update(action.context, node.id, values)
            return candidates

        return None

def update(cls, context, obj_id, values):
        values = cls._transpose_metadata(values)
        db_api.node_update(context, obj_id, values)

Changed in senlin:
assignee: sapd (saphi070) → Nguyễn Ngọc Thái (crownwin)
Revision history for this message
sapd (saphi070) wrote :

Yes. This patch [1] will be solved this bug.

[1] - https://review.openstack.org/#/c/627173/

Changed in senlin:
assignee: crownwin (crownwin) → nobody
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to senlin (master)

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

commit 1e5e4dd8b4c0d815d10ad8b2fb99f1965c847873
Author: sapd <email address hidden>
Date: Mon Dec 24 18:54:35 2018 +0700

    Fix parameters for update node when recovery with lb_policy

    Change-Id: Ie7318baf698ee1bcf7f78c450e57cb31dbd1281a
    Closes-Bug: #1809652

Changed in senlin:
status: Confirmed → 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.