Update 0.105-0ubuntu2~22.04.1 seems to cause regressions with snapd integration
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Netplan |
Fix Released
|
High
|
Lukas Märdian | ||
netplan.io (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | ||
Jammy |
Fix Released
|
Undecided
|
Unassigned | ||
Kinetic |
Fix Released
|
Undecided
|
Unassigned | ||
Lunar |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
[Impact]
This release contains an important bug-fix, related to the "netplan set" subcommand,
and we would like to make sure all of our supported customers have access to this improvement.
The notable changes in the package are:
* d/p/lp1997467: set only specific origin-hint if given (LP: #1997467)
* d/libnetplan0.
The issues addressed by this SRU are described below.
Some regressions were introduced on netplan.io 0.105 in the subcommand "netplan set".
Users who rely on "netplan set" as part of their workflows, such as snapd, were affected
by these issues. Snapd in particular was forced to rollback to netplan.io 0.104 to unblock
their customers.
Issue 1) Deletion of the origin-hint file on update
netplan set --origin-hint test "bridges.
The command above will create the file /etc/netplan/
The command below should update the file, but it will be deleted instead
netplan set --origin-hint test "bridges.
Issue 2) Updates being ignored when --origin-hint is used
Updates on interfaces already defined in another file are ignored.
The command below should create a new file (in this case called 90-snapd-
containing the definition specified by its last parameter:
netplan set --origin-hint 90-snapd-config bridges.
Although, if the interface br54 is already defined in another file, netplan set will not
create the file 90-snapd-
[Test Plan]
The following development and SRU process was followed:
https:/
Netplan contains an extensive integration test suite that is ran using
the SRU package for each releases. This test suite's results are available here:
http://
* Steps to reproduce the issue
This bug is easily reproducible on netplan.io 0.105-0ubuntu2, which is used by Kinetic and Jammy.
1) Launch a LXD Jammy instance (either VM or container):
lxc launch ubuntu:22.04 jammy-netplan
2) Access the new instance
lxc exec jammy-netplan bash
3) (Optional) Upgrade your packages
apt update && apt -y upgrade
4) Check the netplan.io version you have
dpkg --list | grep netplan.io
You should see "0.105-0ubuntu2", the version with this bug.
5) Create the file /etc/netplan/
cat <<EOF > /etc/netplan/
network:
version: 2
ethernets:
ens3:
addresses:
- "10.0.2.15/24"
dhcp4: false
routes:
- to: "default"
via: "10.0.2.2"
bridges:
br54:
dhcp4: true
EOF
6) Use "netplan set" to create a new file that will be used to change the bridge configuration defined in the previous file
netplan set --origin-hint 90-snapd-config network.
7) Checking the results
After running "netplan set" you should find a new file at /etc/netplan called 90-snapd-
containing only the snippet "network.
# cat /etc/netplan/
network:
version: 2
bridges:
br54:
dhcp4: false
If you are running the netplan.io version affected by this issue, you will not find the new file.
That is the main problem this SRU addresses.
8) Now add the PPA below which contains a netplan.io package with patches for this issue
sudo add-apt-repository ppa:danilogondo
apt update
apt upgrade
9) Try netplan set again
netplan set --origin-hint 90-snapd-config network.
After running "netplan set" the file /etc/netplan/
A successful run is required before the proposed netplan package
can be let into -updates.
The netplan team will be in charge of attaching the artifacts and console
output of the appropriate run to the bug. Netplan team members will not
mark ‘verification-done’ until this has happened.
[Where problems could occur]
As this patch changes a small portion of code used by the netplan generator (and the "netplan generate" command),
an issue introduced by this change would potentially affect the network configuration generated when the system boots up.
In the worst scenario it would end up removing old configuration and not generating new one or missing some parts of it
preventing the system to have a working network connection.
The new package containing the fixes is available in Lunar for many days now and no issues like the aforementioned
ones were reported.
In order to mitigate the regression potential, the results of the
aforementioned integration tests are attached to this bug.
[Other Info]
There are remaining known bugs on "netplan set" that were detected recently but we confirmed they
are not regressions caused by this patch as they were already present in netplan. They are all
documented in LP: #2003727.
The issues addressed by this SRUs are the only ones causing real impact to customers based on LP bug reports.
[Changelog]
Bug fixes:
- d/p/lp1997467: set only specific origin-hint if given (LP: #1997467)
Cherry-picked from upstream: https:/
- d/libnetplan0.
==== Original report ====
Sorry that this is a bit unspecific right now, I will try to provide more details ASAP.
We see failures in our nested core20-early-config test, e.g.
https:/
The test fails in the following place:
"""
...
+ remote.exec 'sudo snap set system system.
+ MATCH false
+ remote.exec sudo 'netplan get bridges.br54.dhcp4'
grep error: pattern not found, got:
true
"""
at this point the files look like this (sudo is now needed which was not before btw):
"""
$ sudo cat /etc/netplan/
network:
version: 2
ethernets:
ens3:
addresses:
- "10.0.2.15/24"
dhcp4: false
routes:
- to: "default"
via: "10.0.2.2"
bridges:
br54:
dhcp4: true
$ sudo cat /etc/netplan/
# This file is generated from information provided by the datasource. Changes
# to it will not persist across an instance reboot. To disable cloud-init's
# network configuration capabilities, write a file
# /etc/cloud/
# network: {config: disabled}
network:
ethernets:
enp0s2:
dhcp4: true
match:
version: 2
"""
When I manually run
$ sudo snap set system system.
inside the VM I see no error but the file 0-snapd-
new file 90-snapd-config is created. The logic inside snapd is that the gadget defaults
are stored as 0-snapd-defaults and later changes are stored in 90-sanpd-config so that
the later config values win over the earlier ones.
Fwiw, this test is also run on a core20 system with netplan 104 and there the same test works succesfully afaict.
Related branches
- Łukasz Zemczak: Approve
-
Diff: 222 lines (+194/-0)4 files modifieddebian/changelog (+13/-0)
debian/patches/lp1997467/0009-dbus-Build-the-copy-path-correctly.patch (+93/-0)
debian/patches/lp1997467/0010-tests-Add-an-integration-test-for-netplan-dbus.patch (+86/-0)
debian/patches/series (+2/-0)
- Łukasz Zemczak: Approve
-
Diff: 222 lines (+194/-0)4 files modifieddebian/changelog (+13/-0)
debian/patches/lp1997467/0009-dbus-Build-the-copy-path-correctly.patch (+93/-0)
debian/patches/lp1997467/0010-tests-Add-an-integration-test-for-netplan-dbus.patch (+86/-0)
debian/patches/series (+2/-0)
- Lukas Märdian: Approve
-
Diff: 1000 lines (+939/-0)9 files modifieddebian/changelog (+10/-0)
debian/libnetplan0.symbols (+1/-0)
debian/patches/lp1997467/0003-generate-util-fix-double-slash-root-filepath.patch (+55/-0)
debian/patches/lp1997467/0004-test-cli-set-add-regression-cases-for-LP-1997467.patch (+65/-0)
debian/patches/lp1997467/0005-parse-Allow-loading-nullable-origin-hint-overrides-n.patch (+261/-0)
debian/patches/lp1997467/0006-cli-set-fix-origin-hint-handling-LP-1997467.patch (+189/-0)
debian/patches/lp1997467/0007-src-parse-netplan-write-global-renderer-depending-on.patch (+318/-0)
debian/patches/lp1997467/0008-src-parse-plug-memory-leaks-in-nullable-handling.patch (+33/-0)
debian/patches/series (+7/-0)
- Lukas Märdian: Approve
-
Diff: 1000 lines (+939/-0)9 files modifieddebian/changelog (+10/-0)
debian/libnetplan0.symbols (+1/-0)
debian/patches/lp1997467/0003-generate-util-fix-double-slash-root-filepath.patch (+55/-0)
debian/patches/lp1997467/0004-test-cli-set-add-regression-cases-for-LP-1997467.patch (+65/-0)
debian/patches/lp1997467/0005-parse-Allow-loading-nullable-origin-hint-overrides-n.patch (+261/-0)
debian/patches/lp1997467/0006-cli-set-fix-origin-hint-handling-LP-1997467.patch (+189/-0)
debian/patches/lp1997467/0007-src-parse-netplan-write-global-renderer-depending-on.patch (+318/-0)
debian/patches/lp1997467/0008-src-parse-plug-memory-leaks-in-nullable-handling.patch (+33/-0)
debian/patches/series (+7/-0)
tags: | added: foundations-todo rls-jj-incoming |
tags: | added: patch |
tags: | removed: rls-jj-incoming |
tags: | added: fr-3087 |
Changed in netplan: | |
status: | Triaged → Fix Committed |
Changed in netplan.io (Ubuntu Lunar): | |
status: | Confirmed → In Progress |
description: | updated |
Changed in netplan.io (Ubuntu Jammy): | |
milestone: | none → ubuntu-22.04.2 |
tags: | removed: foundations-todo |
As a reproducer on 22.04: 0-snapd- defaults. yaml <<EOF Netplan/ config/ OY6LV1 io.netplan. Netplan. Config Set ss "network. bridges. br54.dhcp4= false" "90-snapd-config" Netplan/ config/ OY6LV1 io.netplan. Netplan. Config Apply
# cat > /etc/netplan/
network:
version: 2
bridges:
br54:
dhcp4: true
EOF
# busctl call io.netplan.Netplan /io/netplan/Netplan io.netplan.Netplan Config
# busctl call io.netplan.Netplan /io/netplan/
# busctl call io.netplan.Netplan /io/netplan/
# netplan get
network:
version: 2
renderer: NetworkManager
bridges:
br54:
dhcp4: true