新手求助:
systemctl自动启动总是有一些组件错误,错误提示为 Network is unreachable,手动启动就没有问题
其中一次的错误日志:
2019-08-22 12:09:59 ERROR (MainThread) [homeassistant.components.notify] Error setting up platform smtp
Traceback (most recent call last):
File "/usr/local/lib/python3.7/dist-packages/homeassistant/components/notify/__init__.py", line 73, in async_setup_platform
platform.get_service, hass, p_config, discovery_info
File "/usr/lib/python3.7/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/local/lib/python3.7/dist-packages/homeassistant/components/smtp/notify.py", line 84, in get_service
if mail_service.connection_is_valid():
File "/usr/local/lib/python3.7/dist-packages/homeassistant/components/smtp/notify.py", line 138, in connection_is_valid
server = self.connect()
File "/usr/local/lib/python3.7/dist-packages/homeassistant/components/smtp/notify.py", line 122, in connect
mail = smtplib.SMTP_SSL(self._server, self._port, timeout=self._timeout)
File "/usr/lib/python3.7/smtplib.py", line 1031, in __init__
source_address)
File "/usr/lib/python3.7/smtplib.py", line 251, in __init__
(code, msg) = self.connect(host, port)
File "/usr/lib/python3.7/smtplib.py", line 336, in connect
self.sock = self._get_socket(host, port, self.timeout)
File "/usr/lib/python3.7/smtplib.py", line 1037, in _get_socket
self.source_address)
File "/usr/lib/python3.7/socket.py", line 727, in create_connection
raise err
File "/usr/lib/python3.7/socket.py", line 716, in create_connection
sock.connect(sa)
OSError: [Errno 101] Network is unreachable
已经解决:启动systemd-networkd-wait-online.service这个服务就好了,新手对linux不太了解,不知道是什么原理