我的服务器安装 Ubuntu 20.04.3 LTS 运行时出现以下错误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.
当我做了一个小改动时,我最初以为自己犯了一个错误,/etc/netplan/01-netcfg.yaml
但是当我恢复到原来的样子时,错误仍然存在。
我该如何解决这个问题?
答案1
这是 netplan 0.103 中已知的回归问题,目前正在进行 SRU 流程并将很快发布。https://bugs.launchpad.net/ubuntu/+source/netplan.io/+bug/1949104