Devstack fails installation due to rights issue

Bug #1891036 reported by Ebri
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
networking-vpp
New
Undecided
Unassigned

Bug Description

While running a Devstack on Ubuntu 18.04.4 we repeatedly experience an issue when Devstack is creating the tap interface in vpp. It throws an error that permission is denied. This is while following the normal route with a new Devstack:

-clean machine
- sudo useradd -s /bin/bash -d /opt/stack -m stack
- echo "stack ALL=(ALL) NOPASSWD: ALL" | sudo tee /etc/sudoers.d/stack
- sudo su - stack
- git clone https://opendev.org/openstack/devstack -b stable/train

While following the guide on opendev, it throws this error:

++/opt/stack/networking-vpp/devstack/plugin.sh:source:132 echo_summary 'Installing networking-vpp'
++./stack.sh:echo_summary:455 [[ -t 3 ]]
++./stack.sh:echo_summary:455 [[ True != \T\r\u\e ]]
++./stack.sh:echo_summary:461 echo -e Installing networking-vpp
++/opt/stack/networking-vpp/devstack/plugin.sh:source:133 init_networking_vpp
++/opt/stack/networking-vpp/devstack/plugin.sh:init_networking_vpp:39 '[' -z physnet0:tap0 ']'
+++/opt/stack/networking-vpp/devstack/plugin.sh:init_networking_vpp:40 echo physnet0:tap0
+++/opt/stack/networking-vpp/devstack/plugin.sh:init_networking_vpp:40 cut -d : -f 2
++/opt/stack/networking-vpp/devstack/plugin.sh:init_networking_vpp:40 uplink=tap0
+++/opt/stack/networking-vpp/devstack/plugin.sh:init_networking_vpp:43 vppctl show interface
clib_socket_init: connect (fd 4, '/run/vpp/cli.sock'): Permission denied
++/opt/stack/networking-vpp/devstack/plugin.sh:init_networking_vpp:43 [[ '' =~ tap0 ]]
++/opt/stack/networking-vpp/devstack/plugin.sh:init_networking_vpp:43 [[ tap0 =~ tap0 ]]
++/opt/stack/networking-vpp/devstack/plugin.sh:init_networking_vpp:44 echo 'tap0 not found in vppctl show interface'
tap0 not found in vppctl show interface
++/opt/stack/networking-vpp/devstack/plugin.sh:init_networking_vpp:46 vppctl create tap host-if-name test
clib_socket_init: connect (fd 4, '/run/vpp/cli.sock'): Permission denied
+/opt/stack/networking-vpp/devstack/plugin.sh:init_networking_vpp:1 exit_trap
+./stack.sh:exit_trap:536 local r=1
++./stack.sh:exit_trap:537 jobs -p
+./stack.sh:exit_trap:537 jobs=
+./stack.sh:exit_trap:540 [[ -n '' ]]
+./stack.sh:exit_trap:546 '[' -f '' ']'
+./stack.sh:exit_trap:551 kill_spinner
+./stack.sh:kill_spinner:446 '[' '!' -z '' ']'
+./stack.sh:exit_trap:553 [[ 1 -ne 0 ]]
+./stack.sh:exit_trap:554 echo 'Error on exit'
Error on exit
+./stack.sh:exit_trap:556 type -p generate-subunit
+./stack.sh:exit_trap:557 generate-subunit 1597071566 1104 fail
+./stack.sh:exit_trap:559 [[ -z /opt/stack/logs ]]
+./stack.sh:exit_trap:562 /opt/stack/devstack/tools/worlddump.py -d /opt/stack/logs
+./stack.sh:exit_trap:571 exit 1

This is solved when we change the /opt/stack/networking-vpp/devstack/plugin.sh to use sudo for creating the interfaces:

function init_networking_vpp {
    # In test environments where the network topology is unknown or cannot
    # be modified, we use 'tap0' as a logical interface by default
    if ! [ -z "$MECH_VPP_PHYSNETLIST" ]; then
        uplink=$(echo $MECH_VPP_PHYSNETLIST | cut -d ':' -f 2)
        # checking specifically for tap0 to avoid problems in developer
        # test envs where other logical interfaces may be specified.
        if ! [[ `vppctl show interface` =~ "$uplink" ]] && [[ "$uplink" =~ 'tap0' ]]; then
            echo "tap0 not found in vppctl show interface"
            # by default, vpp will internally name the first tap device 'tap0'
            sudo vppctl create tap host-if-name test
            sudo vppctl set interface state tap0 up
        fi
    fi
}

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.