dhcp release fails when client_id is specified

Bug #1896850 reported by Steve Baker
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Fix Released
Medium
Steve Baker

Bug Description

Since dhcp_release was migrated to oslo.privsep[1], specifying a client_id results in the command failing because the client_id string is appended to a list, exploding each character into a list item[2].

Here is the error in a CI log[3]:
Sep 23 16:15:03.221252 ubuntu-bionic-rax-ord-0019993612 neutron-dhcp-agent[11285]: Stderr: 'usage: dhcp_release <interface> <addr> <mac> [<client_id>]\n' {{(pid=25342) _process_cmd /usr/local/lib/python3.6/dist-packages/oslo_privsep/daemon.py:490}}

Sep 23 16:15:03.221252 ubuntu-bionic-rax-ord-0019993612 neutron-dhcp-agent[11285]: Traceback (most recent call last):

Sep 23 16:15:03.221252 ubuntu-bionic-rax-ord-0019993612 neutron-dhcp-agent[11285]: File "/usr/local/lib/python3.6/dist-packages/oslo_privsep/daemon.py", line 485, in _process_cmd

Sep 23 16:15:03.221252 ubuntu-bionic-rax-ord-0019993612 neutron-dhcp-agent[11285]: ret = func(*f_args, **f_kwargs)

Sep 23 16:15:03.221252 ubuntu-bionic-rax-ord-0019993612 neutron-dhcp-agent[11285]: File "/usr/local/lib/python3.6/dist-packages/oslo_privsep/priv_context.py", line 249, in _wrap

Sep 23 16:15:03.221252 ubuntu-bionic-rax-ord-0019993612 neutron-dhcp-agent[11285]: return func(*args, **kwargs)

Sep 23 16:15:03.221252 ubuntu-bionic-rax-ord-0019993612 neutron-dhcp-agent[11285]: File "/opt/stack/neutron/neutron/privileged/agent/linux/dhcp.py", line 28, in dhcp_release

Sep 23 16:15:03.221252 ubuntu-bionic-rax-ord-0019993612 neutron-dhcp-agent[11285]: return processutils.execute(*cmd, log_errors=log_errors)

Sep 23 16:15:03.221252 ubuntu-bionic-rax-ord-0019993612 neutron-dhcp-agent[11285]: File "/usr/local/lib/python3.6/dist-packages/oslo_concurrency/processutils.py", line 434, in execute

Sep 23 16:15:03.221252 ubuntu-bionic-rax-ord-0019993612 neutron-dhcp-agent[11285]: cmd=sanitized_cmd)

Sep 23 16:15:03.221252 ubuntu-bionic-rax-ord-0019993612 neutron-dhcp-agent[11285]: oslo_concurrency.processutils.ProcessExecutionError: Unexpected error while running command.

Sep 23 16:15:03.221252 ubuntu-bionic-rax-ord-0019993612 neutron-dhcp-agent[11285]: Command: ip netns exec qdhcp-5885eb4e-3b5c-48e6-ae40-8a1eeb6629a1 dhcp_release tapa3753962-c7 10.1.0.27 52:54:00:f5:77:63 0 1 : 5 2 : 5 4 : 0 0 : f 5 : 7 7 : 6 3

Sep 23 16:15:03.221252 ubuntu-bionic-rax-ord-0019993612 neutron-dhcp-agent[11285]: Exit code: 1

Sep 23 16:15:03.221252 ubuntu-bionic-rax-ord-0019993612 neutron-dhcp-agent[11285]: Stdout: ''

Sep 23 16:15:03.221252 ubuntu-bionic-rax-ord-0019993612 neutron-dhcp-agent[11285]: Stderr: 'usage: dhcp_release <interface> <addr> <mac> [<client_id>]\n'

Sep 23 16:15:03.221252 ubuntu-bionic-rax-ord-0019993612 neutron-dhcp-agent[11285]: DEBUG oslo.privsep.daemon [-] privsep: reply[140015332807184]: (5, 'oslo_concurrency.processutils.ProcessExecutionError', ('', 'usage: dhcp_release <interface> <addr> <mac> [<client_id>]\n', 1, 'ip netns exec qdhcp-5885eb4e-3b5c-48e6-ae40-8a1eeb6629a1 dhcp_release tapa3753962-c7 10.1.0.27 52:54:00:f5:77:63 0 1 : 5 2 : 5 4 : 0 0 : f 5 : 7 7 : 6 3', None)) {{(pid=25342) _call_back /usr/local/lib/python3.6/dist-packages/oslo_privsep/daemon.py:511}}

Sep 23 16:15:03.227555 ubuntu-bionic-rax-ord-0019993612 neutron-dhcp-agent[11285]: WARNING neutron.agent.linux.dhcp [-] DHCP release failed for params {'interface_name': 'tapa3753962-c7', 'ip_address': '10.1.0.27', 'mac_address': '52:54:00:f5:77:63', 'client_id': '01:52:54:00:f5:77:63', 'namespace': 'qdhcp-5885eb4e-3b5c-48e6-ae40-8a1eeb6629a1'}. Reason: Unexpected error while running command.

Sep 23 16:15:03.227555 ubuntu-bionic-rax-ord-0019993612 neutron-dhcp-agent[11285]: Command: ip netns exec qdhcp-5885eb4e-3b5c-48e6-ae40-8a1eeb6629a1 dhcp_release tapa3753962-c7 10.1.0.27 52:54:00:f5:77:63 0 1 : 5 2 : 5 4 : 0 0 : f 5 : 7 7 : 6 3

[1] https://review.opendev.org/#/c/733864
[2] https://opendev.org/openstack/neutron/src/branch/master/neutron/privileged/agent/linux/dhcp.py#L26
[3] https://zuul.opendev.org/t/openstack/build/ee0efe9616b04dc384aa3f4d0ca62168/log/controller/logs/screen-q-dhcp.txt#4142

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

Fix proposed to branch: master
Review: https://review.opendev.org/753865

Changed in neutron:
assignee: nobody → Steve Baker (steve-stevebaker)
status: New → In Progress
Changed in neutron:
importance: Undecided → Medium
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (master)

Reviewed: https://review.opendev.org/753865
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=2864957ca53a346418f89cc945bba5cdcf204799
Submitter: Zuul
Branch: master

commit 2864957ca53a346418f89cc945bba5cdcf204799
Author: Steve Baker <email address hidden>
Date: Thu Sep 24 11:58:05 2020 +1200

    Fix dhcp_release when client_id is specified

    Appending a string to a list results in each character being appended
    as list items, this results in an invalid release command.

    This change appends the client_id string to the list instead.

    Change-Id: I71a114308e3b68f6daf6e1a202a47b6a453bb81a
    Closes-Bug: #1896850

Changed in neutron:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (stable/victoria)

Fix proposed to branch: stable/victoria
Review: https://review.opendev.org/755817

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (stable/victoria)

Reviewed: https://review.opendev.org/755817
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=0562335908f177c53f0dec307e9414f928a38892
Submitter: Zuul
Branch: stable/victoria

commit 0562335908f177c53f0dec307e9414f928a38892
Author: Steve Baker <email address hidden>
Date: Thu Sep 24 11:58:05 2020 +1200

    Fix dhcp_release when client_id is specified

    Appending a string to a list results in each character being appended
    as list items, this results in an invalid release command.

    This change appends the client_id string to the list instead.

    Change-Id: I71a114308e3b68f6daf6e1a202a47b6a453bb81a
    Closes-Bug: #1896850
    (cherry picked from commit 2864957ca53a346418f89cc945bba5cdcf204799)

tags: added: in-stable-victoria
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/neutron 18.0.0.0rc1

This issue was fixed in the openstack/neutron 18.0.0.0rc1 release candidate.

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.