我的服务器安装 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
但又恢复到原来的错误仍然存在时我犯了一个错误。
我该如何解决这个问题?