neutron-netns-cleanup does not work in Ubuntu

Bug #1881852 reported by Frode Nordahl
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron (Ubuntu)
High
Frode Nordahl
Focal
High
Unassigned

Bug Description

When running the ``neutron-netns-cleanup`` command on Ubuntu it is currently failing with:

    neutron-netns-cleanup --config-file /etc/neutron/neutron.conf \
        --config-file /etc/neutron/l3_agent.ini \
        --force

[ ... ]

2020-06-03 05:34:20.772 374480 ERROR neutron.cmd.netns_cleanup [-] Error unable to destroy namespace: fip-b69f74f3-c394-4b44-b57e-be98110a6011: neutron_lib.exceptions.ProcessExecutionError: Exit code: 99; Stdin: ; Stdout: ; Stderr: /usr/bin/neutron-rootwrap: Unauthorized command: ip netns exec fip-b69f74f3-c394-4b44-b57e-be98110a6011 netstat -nlp (no filter matched)
2020-06-03 05:34:20.772 374480 ERROR neutron.cmd.netns_cleanup Traceback (most recent call last):
2020-06-03 05:34:20.772 374480 ERROR neutron.cmd.netns_cleanup File "/usr/lib/python3/dist-packages/neutron/cmd/netns_cleanup.py", line 239, in destroy_namespace
2020-06-03 05:34:20.772 374480 ERROR neutron.cmd.netns_cleanup kill_listen_processes(namespace)
2020-06-03 05:34:20.772 374480 ERROR neutron.cmd.netns_cleanup File "/usr/lib/python3/dist-packages/neutron/cmd/netns_cleanup.py", line 214, in kill_listen_processes
2020-06-03 05:34:20.772 374480 ERROR neutron.cmd.netns_cleanup if _kill_listen_processes(namespace, force=False):
2020-06-03 05:34:20.772 374480 ERROR neutron.cmd.netns_cleanup File "/usr/lib/python3/dist-packages/neutron/cmd/netns_cleanup.py", line 182, in _kill_listen_processes
2020-06-03 05:34:20.772 374480 ERROR neutron.cmd.netns_cleanup pids = find_listen_pids_namespace(namespace)
2020-06-03 05:34:20.772 374480 ERROR neutron.cmd.netns_cleanup File "/usr/lib/python3/dist-packages/neutron/cmd/netns_cleanup.py", line 145, in find_listen_pids_namespace
2020-06-03 05:34:20.772 374480 ERROR neutron.cmd.netns_cleanup output = ip.netns.execute(cmd, run_as_root=True)
2020-06-03 05:34:20.772 374480 ERROR neutron.cmd.netns_cleanup File "/usr/lib/python3/dist-packages/neutron/agent/linux/ip_lib.py", line 722, in execute
2020-06-03 05:34:20.772 374480 ERROR neutron.cmd.netns_cleanup return utils.execute(cmd, check_exit_code=check_exit_code,
2020-06-03 05:34:20.772 374480 ERROR neutron.cmd.netns_cleanup File "/usr/lib/python3/dist-packages/neutron/agent/linux/utils.py", line 146, in execute
2020-06-03 05:34:20.772 374480 ERROR neutron.cmd.netns_cleanup raise exceptions.ProcessExecutionError(msg,
2020-06-03 05:34:20.772 374480 ERROR neutron.cmd.netns_cleanup neutron_lib.exceptions.ProcessExecutionError: Exit code: 99; Stdin: ; Stdout: ; Stderr: /usr/bin/neutron-rootwrap: Unauthorized command: ip netns exec fip-b69f74f3-c394-4b44-b57e-be98110a6011 netstat -nlp (no filter matched)
2020-06-03 05:34:20.772 374480 ERROR neutron.cmd.netns_cleanup
2020-06-03 05:34:20.772 374480 ERROR neutron.cmd.netns_cleanup
2020-06-03 05:34:21.025 374480 ERROR neutron.agent.linux.utils [-] Exit code: 99; Stdin: ; Stdout: ; Stderr: /usr/bin/neutron-rootwrap: Unauthorized command: ip netns exec qrouter-326e9e7a-780c-4e7f-9af1-d2ac9b2ebf11 netstat -nlp (no filter matched)

It appears the ``neutron-common`` package is missing the '/etc/neuton/rootwrap.d/netns-cleanup.filters' file [0].

On Focal, once the filter is in place the command will still fail due to the net-tools package not being installed (for netstat). Perhaps we need a dependency or at least a soft-dependency on net-tools for ``python3-neutron``?

0: https://opendev.org/openstack/neutron/src/branch/master/etc/neutron/rootwrap.d/netns-cleanup.filters

Related branches

Changed in neutron (Ubuntu):
status: New → Triaged
importance: Undecided → High
assignee: nobody → Frode Nordahl (fnordahl)
Changed in neutron (Ubuntu Focal):
status: New → Triaged
importance: Undecided → High
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package neutron - 2:16.0.0-0ubuntu2

---------------
neutron (2:16.0.0-0ubuntu2) groovy; urgency=medium

  * d/control: Add net-tools dependency to python3-neutron for netstat
    (LP: #1881852).
  * d/neutron-common.install: Add rootwrap.d/netns-cleanup.filters
    (LP: #1881852).
  * d/p/fix-neutron-ipset-cleanup-tool.patch: Fix Traceback (LP: #1881771).

 -- Frode Nordahl <email address hidden> Wed, 3 Jun 2020 10:19:56 +0200

Changed in neutron (Ubuntu):
status: Triaged → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers