Score:0

netplan apply and netplan try error

kr flag

My server installation Ubuntu 20.04.3 LTS has the following error when I run sudo netplan try:

An error occurred: 'NetplanApply' object has no attribute 'state'

Reverting.
Job for systemd-networkd.service failed because the control process exited with error code.
See "systemctl status systemd-networkd.service" and "journalctl -xe" for details.
Traceback (most recent call last):
  File "/usr/share/netplan/netplan/cli/commands/try_command.py", line 87, in command_try
    NetplanApply().command_apply(run_generate=True, sync=True, exit_on_error=False, state_dir=self.state)
  File "/usr/share/netplan/netplan/cli/commands/apply.py", line 199, in command_apply
    if self.state:
AttributeError: 'NetplanApply' object has no attribute 'state'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/sbin/netplan", line 23, in <module>
    netplan.main()
  File "/usr/share/netplan/netplan/cli/core.py", line 50, in main
    self.run_command()
  File "/usr/share/netplan/netplan/cli/utils.py", line 310, in run_command
    self.func()
  File "/usr/share/netplan/netplan/cli/commands/try_command.py", line 69, in run
    self.run_command()
  File "/usr/share/netplan/netplan/cli/utils.py", line 310, in run_command
    self.func()
  File "/usr/share/netplan/netplan/cli/commands/try_command.py", line 98, in command_try
    self.revert()
  File "/usr/share/netplan/netplan/cli/commands/try_command.py", line 127, in revert
    NetplanApply().command_apply(run_generate=False, sync=True, exit_on_error=False, state_dir=tempdir)
  File "/usr/share/netplan/netplan/cli/commands/apply.py", line 249, in command_apply
    utils.systemctl_networkd('start', sync=True, extra_services=netplan_wpa + netplan_ovs)
  File "/usr/share/netplan/netplan/cli/utils.py", line 177, in systemctl_networkd
    subprocess.check_call(command)
  File "/usr/lib/python3.8/subprocess.py", line 364, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['systemctl', 'start', 'systemd-networkd.service', 'netplan-ovs-cleanup.service']' returned non-zero exit status 1.

I initially thought I made a mistake when I made a small change to /etc/netplan/01-netcfg.yaml but have reverted to the original and the error is still there.

How can I solve this?

Score:0
us flag

This is a known regression in netplan 0.103 which is currently going through the SRU process and will be released soon. https://bugs.launchpad.net/ubuntu/+source/netplan.io/+bug/1949104

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.