Activity log for bug #1809994

Date Who What changed Old value New value Message
2018-12-28 20:46:33 Ryan Harper bug added bug
2019-01-24 21:39:06 Mathieu Trudel-Lapierre netplan.io (Ubuntu): status New Triaged
2019-01-24 21:39:08 Mathieu Trudel-Lapierre netplan.io (Ubuntu): importance Undecided High
2019-01-24 21:39:10 Mathieu Trudel-Lapierre netplan.io (Ubuntu): assignee Mathieu Trudel-Lapierre (cyphermox)
2021-11-09 01:03:23 Ian Weisser bug added subscriber Ian Weisser
2023-03-27 14:22:56 Lukas Märdian tags amd64 apport-bug bionic uec-images amd64 apport-bug bionic fr-3791 uec-images
2023-10-05 16:16:22 Danilo Egea Gondolfo tags amd64 apport-bug bionic fr-3791 uec-images amd64 apport-bug bionic foundations-todo fr-3791 uec-images
2023-10-17 07:52:44 Danilo Egea Gondolfo tags amd64 apport-bug bionic foundations-todo fr-3791 uec-images amd64 apport-bug bionic fr-3791 uec-images
2023-10-17 07:52:57 Danilo Egea Gondolfo netplan.io (Ubuntu): status Triaged Fix Committed
2023-11-15 14:14:11 Launchpad Janitor merge proposal linked https://code.launchpad.net/~danilogondolfo/netplan/+git/netplan/+merge/455627
2023-11-20 13:20:31 Lukas Märdian nominated for series Ubuntu Mantic
2023-11-20 13:20:31 Lukas Märdian bug task added netplan.io (Ubuntu Mantic)
2023-11-20 13:20:31 Lukas Märdian nominated for series Ubuntu Noble
2023-11-20 13:20:31 Lukas Märdian bug task added netplan.io (Ubuntu Noble)
2023-11-20 13:21:36 Lukas Märdian netplan.io (Ubuntu Noble): assignee Mathieu Trudel-Lapierre (cyphermox)
2023-11-20 13:23:10 Danilo Egea Gondolfo 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) [ Impact ] Netplan will fail to generate network configuration if it finds the same access-point SSID more than once in the configuration. This situation will happen if the user defined the access-point more than once for the same interface in the same or different files and, worse, if the parser required a second pass through the configuration. The second scenario is particularly bad as it's hard to identify the problem without understanding how the parser works. Multiple definition of resources is common in Netplan and shouldn't lead to failures. It's important to have this fixes backported to Mantic due to the Netplan + NetworkManager integration. If the user ends up in this situation, they will not be able to use Network Manager as it will always fail parse the Netplan configuration. See https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/1412 This patch fixes the issue by gracefully handling access-point duplication. If the parser ever finds the same access-point for the same interface, the old one will be discarded and replaced by the new definition. [ Test Plan ] How to reproduce the issue: 1) Launch a LXD VM with Mantic $ lxc launch ubuntu:mantic mantic --vm $ lxc shell mantic Problem one: multipass parsing will process interfaces twice Create the following configuration cat > /etc/netplan/10-config.yaml <<EOF network: bridges: mybridge: interfaces: [enp5s0] ethernets: enp5s0: {} wifis: wlp6s0: access-points: "mywifi": password: "mypassword" EOF Run "netplan generate". You will get the error below: Error in network definition: wlp6s0: Duplicate access point SSID 'mywifi' This scenario is particularly bad because the access-point is clearly not defined twice. Although, because the parser will walk through the configuration twice, it will process it again. Problem two: similar to problem one but with real duplication Delete the previous file and create the configuration below: rm /etc/netplan/10-config.yaml cat > /etc/netplan/10-config.yaml <<EOF network: wifis: wlp6s0: access-points: "mywifi": password: "mypassword" EOF cat > /etc/netplan/20-second-config.yaml <<EOF network: wifis: wlp6s0: access-points: "mywifi": password: "mypassword" EOF Run "netplan generate". You will get the same error: Error in network definition: wlp6s0: Duplicate access point SSID 'mywifi' The configuration is duplicated, but this shouldn't be a problem to Netplan. Now update Netplan using the PPA https://launchpad.net/~danilogondolfo/+archive/ubuntu/netplan and try the steps above again. Both the scenarios should work fine. add-apt-repository ppa:danilogondolfo/netplan apt update && apt -y upgrade [ Where problems could occur ] These changes affect how the parser handles access-points only so any issues that it might introduce will manifest while parsing wifi interfaces. Although, all the unit and integration tests are passing so we don't expect any changes in behavior on scenarios that were working fine in Netplan. All NetworkManager's autopkgtests are also passing (and they contain several tests related to Wifi). [ Other Info ] Note the this issue was reported back in 2018 and is still present in Netplan. While it wasn't a priority, with the integration between Netplan and Network Manager in Mantic, it became urgent. ---- Original 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)
2023-11-20 15:25:49 Launchpad Janitor merge proposal linked https://code.launchpad.net/~danilogondolfo/netplan/+git/netplan/+merge/455887
2023-11-20 15:58:43 Lukas Märdian netplan.io (Ubuntu Mantic): status New In Progress
2023-11-20 15:58:51 Lukas Märdian bug added subscriber Ubuntu Stable Release Updates Team
2023-11-20 21:42:56 Ubuntu Archive Robot bug added subscriber Lukas Märdian
2023-11-21 10:14:30 Łukasz Zemczak netplan.io (Ubuntu Mantic): status In Progress Fix Committed
2023-11-21 10:14:32 Łukasz Zemczak bug added subscriber SRU Verification
2023-11-21 10:14:34 Łukasz Zemczak tags amd64 apport-bug bionic fr-3791 uec-images amd64 apport-bug bionic fr-3791 uec-images verification-needed verification-needed-mantic
2023-11-22 14:32:45 Launchpad Janitor netplan.io (Ubuntu Noble): status Fix Committed Fix Released
2023-11-24 11:48:42 Danilo Egea Gondolfo tags amd64 apport-bug bionic fr-3791 uec-images verification-needed verification-needed-mantic amd64 apport-bug bionic fr-3791 uec-images verification-done-mantic verification-needed
2023-11-27 10:42:06 Łukasz Zemczak removed subscriber Ubuntu Stable Release Updates Team
2023-11-27 10:42:05 Launchpad Janitor netplan.io (Ubuntu Mantic): status Fix Committed Fix Released