netplan try is broken
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
netplan.io (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | ||
Focal |
Fix Released
|
Undecided
|
Unassigned | ||
Hirsute |
Fix Released
|
Undecided
|
Unassigned | ||
Impish |
Fix Released
|
Undecided
|
Unassigned | ||
Jammy |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
[Impact]
The last netplan SRU (0.103-
feature, that regressed the 'netplan try' CLI command, if no such --state
argument is passed, making it fail with a error message like this:
An error occurred: 'NetplanApply' object has no attribute 'state'
This upload contains a fix to properly initialize the 'self.state' attribute in
all cases to avoid this problem.
[Test Plan]
In addition to runing & passing the full set of unit- and integration-tests
(that contains new tests to check for this regression), as described in
https:/
to make sure the 'netplan try' command is working properly:
$ netplan try
$ [Ctrl+C] # to abort the waiting
=> Make sure it does not print a "An error occurred" message
$ netplan try
$ [Enter]
=> Make sure it does not print a "An error occurred" message
autopkgtest logs:
* Impish:
https:/
https:/
https:/
https:/
https:/
* Hirsute:
https:/
https:/
https:/
https:/
https:/
* Focal:
https:/
https:/
https:/
https:/
https:/
[Where problems could occur]
This upload contains changes to the CLI of netplan, if anything goes wrong it
could impact the interactive usage of 'netplan try'/'netplan apply' by the user.
[Other Info]
The full set of autopkgtest logs will be attached after the upload is accepted
into -proposed and the tests have been run on the official autopkgtest.u.c
infrastructure.
=== Original Description ===
I hava a freshly installed Ubuntu Server 20.04 LTS.
I am using a static IP config (100% sure it is correct, also the YAML is correct)
If you then enter "netplan try" I get this:
-------
Warning: Stopping systemd-
systemd-
An error occurred: 'NetplanApply' object has no attribute 'state'
Reverting.
Warning: Stopping systemd-
systemd-
-------
"netplan generate && netplan apply" does work.
I found some other people having these issues too on freshly installed 20.04 and 21.10 and online forums.
System Infos:
lsb_release -rd:
Description: Ubuntu 20.04.3 LTS
Release: 20.04
apt-cache policy netplan.io:
netplan.io:
Installed: 0.103-0ubuntu5~
Candidate: 0.103-0ubuntu5~
Version table:
*** 0.103-0ubuntu5~
500 http://
100 /var/lib/
0.99-0ubuntu1 500
500 http://
systemd --version:
systemd 245 (245.4-4ubuntu3.13)
+PAM +AUDIT +SELINUX +IMA +APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD +IDN2 -IDN +PCRE2 default-
Thank you!
Changed in netplan.io (Ubuntu): | |
status: | Confirmed → New |
status: | New → Confirmed |
tags: | added: fr-1833 |
tags: | removed: rls-jj-incoming |
description: | updated |
Changed in netplan.io (Ubuntu Jammy): | |
status: | Triaged → Fix Committed |
description: | updated |
tags: |
added: verification-done removed: verification-needed |
No matter the netplan configuration, it always fails with 'NetplanApply' object has no attribute 'state'.
###
addresses: a2c:d230: :1/64
gateway6: fe80::1
macaddress: 96:00:00:e4:cd:cb
set- name: eth0
network:
version: 2
ethernets:
eth0:
- 2a01:5f9:
dhcp4: true
match:
# netplan try networkd. service, but it can still be activated by: networkd. socket
Warning: Stopping systemd-
systemd-
An error occurred: 'NetplanApply' object has no attribute 'state'
Reverting. networkd. service, but it can still be activated by: networkd. socket
Warning: Stopping systemd-
systemd-
### Installed packages
libnetplan0/ 0.103-0ubuntu5~ 20.04.2 amd64 io/0.103- 0ubuntu5~ 20.04.2 amd64
netplan.
### No such problem on another machine with:
libnetplan0/ 0.103-0ubuntu5~ 20.04.1 amd64 io/0.103- 0ubuntu5~ 20.04.1 amd64
netplan.