diff --git a/supervisor/core.py b/supervisor/core.py index 506512412..00a31aadb 100644 --- a/supervisor/core.py +++ b/supervisor/core.py @@ -96,6 +96,9 @@ class Core(CoreSysAttributes): """Start setting up supervisor orchestration.""" self.state = CoreState.SETUP + # Check internet on startup + await self.sys_supervisor.check_connectivity() + # Order can be important! setup_loads: List[Awaitable[None]] = [ # rest api views @@ -158,9 +161,6 @@ class Core(CoreSysAttributes): "System is running in an unhealthy state and needs manual intervention!" ) - # Check internet on startup - await self.sys_supervisor.check_connectivity() - # Mark booted partition as healthy await self.sys_hassos.mark_healthy() diff --git a/supervisor/jobs/decorator.py b/supervisor/jobs/decorator.py index 620767379..00c27bfcb 100644 --- a/supervisor/jobs/decorator.py +++ b/supervisor/jobs/decorator.py @@ -153,7 +153,6 @@ class Job(CoreSysAttributes): if ( JobCondition.INTERNET_SYSTEM in self.conditions and not self.sys_supervisor.connectivity - and self.sys_core.state in (CoreState.SETUP, CoreState.RUNNING) ): raise JobConditionException( f"'{self._method.__qualname__}' blocked from execution, no supervisor internet connection" @@ -163,7 +162,6 @@ class Job(CoreSysAttributes): JobCondition.INTERNET_HOST in self.conditions and self.sys_host.network.connectivity is not None and not self.sys_host.network.connectivity - and self.sys_core.state in (CoreState.SETUP, CoreState.RUNNING) ): raise JobConditionException( f"'{self._method.__qualname__}' blocked from execution, no host internet connection" diff --git a/supervisor/plugins/dns.py b/supervisor/plugins/dns.py index dbf398e1f..7f606aa4f 100644 --- a/supervisor/plugins/dns.py +++ b/supervisor/plugins/dns.py @@ -143,6 +143,7 @@ class PluginDns(PluginBase): # Update supervisor self._write_resolv(HOST_RESOLV) + await self.sys_supervisor.check_connectivity() async def install(self) -> None: """Install CoreDNS.""" diff --git a/supervisor/supervisor.py b/supervisor/supervisor.py index fa93dd568..021d90976 100644 --- a/supervisor/supervisor.py +++ b/supervisor/supervisor.py @@ -241,7 +241,7 @@ class Supervisor(CoreSysAttributes): timeout = aiohttp.ClientTimeout(total=10) try: await self.sys_websession.head( - "https://version.home-assistant.io/online.txt", timeout=timeout + "http://version.home-assistant.io/online.txt", timeout=timeout ) except (ClientError, asyncio.TimeoutError): self.connectivity = False