netplan reparses wifi when bridge member is listed before definition

Bug #1809994 reported by Ryan Harper on 2018-12-28
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
netplan.io (Ubuntu)
High
Mathieu Trudel-Lapierre

Bug Description

1) # lsb_release -rd
Description: Ubuntu 18.04.1 LTS
Release: 18.04

2) # apt-cache policy netplan.io
netplan.io:
  Installed: 0.36.3
  Candidate: 0.40.1~18.04.3
  Version table:
     0.40.1~18.04.3 500
        500 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 Packages
 *** 0.36.3 100
        100 /var/lib/dpkg/status
     0.36.1 500
        500 http://archive.ubuntu.com/ubuntu bionic/main amd64 Packages

3) netplan generate creates configuration for a bridge with single member and wifi accesspoint

4) netplan generate returns error, "Duplicate access point SSID"

# netplan --debug generate
DEBUG:command generate: running ['/lib/netplan/generate']
** (generate:5321): DEBUG: 20:44:08.972: Processing input file //etc/netplan/50-cloud-init.yaml..
** (generate:5321): DEBUG: 20:44:08.972: starting new processing pass
** (generate:5321): DEBUG: 20:44:08.972: recording missing yaml_node_t enp5s0
** (generate:5321): DEBUG: 20:44:08.973: wlp6s0: adding wifi AP 'palisades-guest'
** (generate:5321): DEBUG: 20:44:08.973: starting new processing pass
** (generate:5321): DEBUG: 20:44:08.973: wlp6s0: adding wifi AP 'palisades-guest'
Error in network definition //etc/netplan/50-cloud-init.yaml line 18 column 16: wlp6s0: Duplicate access point SSID 'palisades-guest'

% cat /etc/netplan/50-cloud-init.yaml
# This file is generated from information provided by
# the datasource. Changes to it will not persist across an instance.
# To disable cloud-init's network configuration capabilities, write a file
# /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following:
# network: {config: disabled}
network:
    bridges:
        mybridge:
            interfaces: [enp5s0]
            dhcp4: true
    ethernets:
        enp5s0:
            dhcp4: no
    wifis:
        wlp6s0:
            dhcp4: true
            optional: true
            access-points:
                "mywifi":
                    password: "mypass"
    version: 2

Note, if I move the ethernet definition of enp5s0 before the bridge, netplan can parse it.

This appears to be related to parse.c:add_missing_node() which tags it is missing a definition and then reparses. This then attempts to parse wifis a second time and runs into a condition check that's meant to prevent duplicate SSIDs.

ProblemType: Bug
DistroRelease: Ubuntu 18.04
Package: netplan.io 0.36.3
ProcVersionSignature: Ubuntu 4.15.0-36.39-generic 4.15.18
Uname: Linux 4.15.0-36-generic x86_64
NonfreeKernelModules: zfs zunicode zavl icp zcommon znvpair
ApportVersion: 2.20.9-0ubuntu7.4
Architecture: amd64
Date: Fri Dec 28 20:40:57 2018
ProcEnviron:
 TERM=xterm-256color
 PATH=(custom, no user)
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: netplan.io
UpgradeStatus: No upgrade log present (probably fresh install)

Ryan Harper (raharper) wrote :
Changed in netplan.io (Ubuntu):
status: New → Triaged
importance: Undecided → High
assignee: nobody → Mathieu Trudel-Lapierre (cyphermox)
Nanzikambe (nanzikambe) wrote :

This impacts bonded interfaces on a fresh install of Ubuntu 18.04.3 LTS

# cat /etc/netplan/50-cloud-init.yaml
network:
    wifis:
        wlx00XXXXXXXXXXXX:
           access-points:
               "guest":
                   mode: ap
                   password: "lol netplan"
           addresses: [192.168.42.0/24]
           optional: true
           match:
              macaddress: xx:xx:xx:xx:xx:xx
    bonds:
        bond0:
            dhcp4: false
            dhcp6: false
            addresses: [192.168.0.2/24]
            nameservers:
               # search: [lab, home]
               addresses: [8.8.8.8, 1.1.1.1]
            interfaces:
            - enp3s0
            - enp5s0
            parameters:
                mode: broadcast
    ethernets:
        enp3s0: {}
        enp5s0: {}
    version: 2

# netplan --debug generate
DEBUG:command generate: running ['/lib/netplan/generate']
** (generate:1388): DEBUG: 17:40:48.166: Processing input file /etc/netplan/50-cloud-init.yaml..
** (generate:1388): DEBUG: 17:40:48.166: starting new processing pass
** (generate:1388): DEBUG: 17:40:48.166: wlx00XXXXXXXXXXXX: adding wifi AP 'guest'
** (generate:1388): DEBUG: 17:40:48.166: recording missing yaml_node_t enp3s0
** (generate:1388): DEBUG: 17:40:48.166: recording missing yaml_node_t enp5s0
** (generate:1388): DEBUG: 17:40:48.166: starting new processing pass
** (generate:1388): DEBUG: 17:40:48.166: wlx00XXXXXXXXXXXX: adding wifi AP 'guest'
/etc/netplan/50-cloud-init.yaml:12:16: Error in network definition: wlx00XXXXXXXXXXXX: Duplicate access point SSID 'guest'
               "guest":
               ^

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers