Avoid raising NetworkInterfaceNotFound exception in DHCP agent logs

Bug #1854723 reported by Rodolfo Alonso on 2019-12-02
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Undecided
Rodolfo Alonso

Bug Description

In normal operation, when the DHCP agent checks the namespace interfaces used by the DHCP process, if this interface does not exist, an exception is written in the log.

Because not having this interface is something that can usually happen in normal operation, we should avoid raising and writing this exception.

LOG EXAMPLE:
Dec 01 23:47:07.061850 ubuntu-bionic-ovh-bhs1-0013157001 neutron-dhcp-agent[20147]: DEBUG oslo.privsep.daemon [-] privsep: Exception during request[139719361762872]: Network interface tap88ffe0d6-f0 not found in namespace qdhcp-da607b3b-d956-4468-837f-ffbfbc69d852. {{(pid=21921) _process_cmd /usr/local/lib/python3.6/dist-packages/oslo_privsep/daemon.py:454}}
Dec 01 23:47:07.061850 ubuntu-bionic-ovh-bhs1-0013157001 neutron-dhcp-agent[20147]: Traceback (most recent call last):
Dec 01 23:47:07.061850 ubuntu-bionic-ovh-bhs1-0013157001 neutron-dhcp-agent[20147]: File "/opt/stack/old/neutron/neutron/privileged/agent/linux/ip_lib.py", line 246, in get_link_id
Dec 01 23:47:07.061850 ubuntu-bionic-ovh-bhs1-0013157001 neutron-dhcp-agent[20147]: return ip.link_lookup(ifname=device)[0]
Dec 01 23:47:07.061850 ubuntu-bionic-ovh-bhs1-0013157001 neutron-dhcp-agent[20147]: IndexError: list index out of range
Dec 01 23:47:07.061850 ubuntu-bionic-ovh-bhs1-0013157001 neutron-dhcp-agent[20147]: During handling of the above exception, another exception occurred:
Dec 01 23:47:07.061850 ubuntu-bionic-ovh-bhs1-0013157001 neutron-dhcp-agent[20147]: Traceback (most recent call last):
Dec 01 23:47:07.061850 ubuntu-bionic-ovh-bhs1-0013157001 neutron-dhcp-agent[20147]: File "/usr/local/lib/python3.6/dist-packages/oslo_privsep/daemon.py", line 449, in _process_cmd
Dec 01 23:47:07.061850 ubuntu-bionic-ovh-bhs1-0013157001 neutron-dhcp-agent[20147]: ret = func(*f_args, **f_kwargs)
Dec 01 23:47:07.061850 ubuntu-bionic-ovh-bhs1-0013157001 neutron-dhcp-agent[20147]: File "/opt/stack/old/neutron/neutron/privileged/agent/linux/ip_lib.py", line 53, in sync_inner
Dec 01 23:47:07.061850 ubuntu-bionic-ovh-bhs1-0013157001 neutron-dhcp-agent[20147]: return input_func(*args, **kwargs)
Dec 01 23:47:07.061850 ubuntu-bionic-ovh-bhs1-0013157001 neutron-dhcp-agent[20147]: File "/usr/local/lib/python3.6/dist-packages/oslo_privsep/priv_context.py", line 247, in _wrap
Dec 01 23:47:07.061850 ubuntu-bionic-ovh-bhs1-0013157001 neutron-dhcp-agent[20147]: return func(*args, **kwargs)
Dec 01 23:47:07.061850 ubuntu-bionic-ovh-bhs1-0013157001 neutron-dhcp-agent[20147]: File "/opt/stack/old/neutron/neutron/privileged/agent/linux/ip_lib.py", line 406, in get_link_attributes
Dec 01 23:47:07.061850 ubuntu-bionic-ovh-bhs1-0013157001 neutron-dhcp-agent[20147]: link = _run_iproute_link("get", device, namespace)[0]
Dec 01 23:47:07.061850 ubuntu-bionic-ovh-bhs1-0013157001 neutron-dhcp-agent[20147]: File "/opt/stack/old/neutron/neutron/privileged/agent/linux/ip_lib.py", line 254, in _run_iproute_link
Dec 01 23:47:07.061850 ubuntu-bionic-ovh-bhs1-0013157001 neutron-dhcp-agent[20147]: idx = get_link_id(device, namespace)
Dec 01 23:47:07.061850 ubuntu-bionic-ovh-bhs1-0013157001 neutron-dhcp-agent[20147]: File "/opt/stack/old/neutron/neutron/privileged/agent/linux/ip_lib.py", line 248, in get_link_id
Dec 01 23:47:07.061850 ubuntu-bionic-ovh-bhs1-0013157001 neutron-dhcp-agent[20147]: raise NetworkInterfaceNotFound(device=device, namespace=namespace)
Dec 01 23:47:07.061850 ubuntu-bionic-ovh-bhs1-0013157001 neutron-dhcp-agent[20147]: neutron.privileged.agent.linux.ip_lib.NetworkInterfaceNotFound: Network interface tap88ffe0d6-f0 not found in namespace qdhcp-da607b3b-d956-4468-837f-ffbfbc69d852.

IMO, importance = wishlist.

Changed in neutron:
assignee: nobody → Rodolfo Alonso (rodolfo-alonso-hernandez)
summary: - Avoid NetworkInterfaceNotFound exception in DHCP agent logs
+ Avoid raisin NetworkInterfaceNotFound exception in DHCP agent logs
summary: - Avoid raisin NetworkInterfaceNotFound exception in DHCP agent logs
+ Avoid raising NetworkInterfaceNotFound exception in DHCP agent logs

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

Changed in neutron:
status: New → In Progress

Reviewed: https://review.opendev.org/696940
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=8cc2765b5fdd229c9f6f19b83ad9e1ba030040ae
Submitter: Zuul
Branch: master

commit 8cc2765b5fdd229c9f6f19b83ad9e1ba030040ae
Author: Rodolfo Alonso Hernandez <email address hidden>
Date: Mon Dec 2 11:48:28 2019 +0000

    Avoid raising NetworkInterfaceNotFound exception in DHCP agent logs

    In "ip_lib.ensure_device_is_ready", before retrieving the interface
    attributes, a check is done to know if the interface exists. In case
    it does not exist, the exception "NetworkInterfaceNotFound" will not
    be raised and written in the logs.

    Change-Id: I4b9fd0885d850601717274a5058e042871211bbb
    Closes-Bug: #1854723

Changed in neutron:
status: In Progress → Fix Released

This issue was fixed in the openstack/neutron 16.0.0.0b1 development milestone.

tags: added: neutron-proactive-backport-potential

Reviewed: https://review.opendev.org/722386
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=afd6b2f5aed86da2cc4b2e4b41a69d1197600089
Submitter: Zuul
Branch: stable/train

commit afd6b2f5aed86da2cc4b2e4b41a69d1197600089
Author: Rodolfo Alonso Hernandez <email address hidden>
Date: Mon Dec 2 11:48:28 2019 +0000

    Avoid raising NetworkInterfaceNotFound exception in DHCP agent logs

    In "ip_lib.ensure_device_is_ready", before retrieving the interface
    attributes, a check is done to know if the interface exists. In case
    it does not exist, the exception "NetworkInterfaceNotFound" will not
    be raised and written in the logs.

    Conflicts:
        neutron/privileged/agent/linux/ip_lib.py

    Change-Id: I4b9fd0885d850601717274a5058e042871211bbb
    Closes-Bug: #1854723
    (cherry picked from commit 8cc2765b5fdd229c9f6f19b83ad9e1ba030040ae)

tags: added: in-stable-train

Reviewed: https://review.opendev.org/722387
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=3e64388bb605d67b14f9f127bf395befbf48a581
Submitter: Zuul
Branch: stable/stein

commit 3e64388bb605d67b14f9f127bf395befbf48a581
Author: Rodolfo Alonso Hernandez <email address hidden>
Date: Mon Dec 2 11:48:28 2019 +0000

    Avoid raising NetworkInterfaceNotFound exception in DHCP agent logs

    In "ip_lib.ensure_device_is_ready", before retrieving the interface
    attributes, a check is done to know if the interface exists. In case
    it does not exist, the exception "NetworkInterfaceNotFound" will not
    be raised and written in the logs.

    Conflicts:
        neutron/privileged/agent/linux/ip_lib.py

    Change-Id: I4b9fd0885d850601717274a5058e042871211bbb
    Closes-Bug: #1854723
    (cherry picked from commit 8cc2765b5fdd229c9f6f19b83ad9e1ba030040ae)
    (cherry picked from commit afd6b2f5aed86da2cc4b2e4b41a69d1197600089)

tags: added: in-stable-stein

Reviewed: https://review.opendev.org/752669
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=fa3fa17ef0bfcb2b0f3c6087e2e18f9c29f98980
Submitter: Zuul
Branch: stable/rocky

commit fa3fa17ef0bfcb2b0f3c6087e2e18f9c29f98980
Author: Rodolfo Alonso Hernandez <email address hidden>
Date: Mon Dec 2 11:48:28 2019 +0000

    Avoid raising NetworkInterfaceNotFound exception in DHCP agent logs

    In "ip_lib.ensure_device_is_ready", before retrieving the interface
    attributes, a check is done to know if the interface exists. In case
    it does not exist, the exception "NetworkInterfaceNotFound" will not
    be raised and written in the logs.

    Conflicts:
        neutron/privileged/agent/linux/ip_lib.py

    Change-Id: I4b9fd0885d850601717274a5058e042871211bbb
    Closes-Bug: #1854723
    (cherry picked from commit 8cc2765b5fdd229c9f6f19b83ad9e1ba030040ae)
    (cherry picked from commit afd6b2f5aed86da2cc4b2e4b41a69d1197600089)

tags: added: in-stable-rocky
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers