FS#75379 - [home-assistant] first-run setup fails

Attached to Project: Community Packages
Opened by InFerYes (InFerYes) - Wednesday, 20 July 2022, 10:37 GMT
Last edited by Toolybird (Toolybird) - Saturday, 20 May 2023, 01:53 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To Maxime Gauduin (Alucryd)
Architecture All
Severity High
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 1
Private No

Details

Description:
Setup process of first run fails with errors

Additional info:
home-assistant 2022.7.4-2

Tested on:
Linux sarge 5.17.9-arch1-1 #1 SMP PREEMPT Wed, 18 May 2022 17:30:11 +0000 x86_64 GNU/Linux
Linux orbb 3.10.107-5-ARCH #1 SMP PREEMPT Fri Mar 26 23:32:03 UTC 2021 armv7l GNU/Linux

journalctl output of sarge 5.17.9-arch1-1 x86_64:
```
Jul 19 17:40:19 sarge systemd[1]: Started Home assistant.
Jul 19 17:41:24 sarge hass[765491]: 2022-07-19 17:41:24 ERROR (MainThread) [homeassistant.setup] Setup failed for recorder: Unable to import component: No module named 'fnvhash'
Jul 19 17:41:25 sarge hass[765491]: 2022-07-19 17:41:25 ERROR (MainThread) [homeassistant.setup] Setup failed for analytics: Unable to import component: No module named 'fnvhash'
Jul 19 17:41:46 sarge hass[765491]: 2022-07-19 17:41:46 ERROR (MainThread) [homeassistant.setup] Setup failed for dhcp: Unable to import component: No module named 'scapy'
Jul 19 17:41:54 sarge hass[765491]: 2022-07-19 17:41:54 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of onboarding. Setup failed for dependencies: analytics
Jul 19 17:41:54 sarge hass[765491]: 2022-07-19 17:41:54 ERROR (MainThread) [homeassistant.setup] Setup failed for onboarding: (DependencyError(...), 'Could not setup dependencies: analytics')
Jul 19 17:41:54 sarge hass[765491]: 2022-07-19 17:41:54 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of frontend. Setup failed for dependencies: onboarding
Jul 19 17:41:54 sarge hass[765491]: 2022-07-19 17:41:54 ERROR (MainThread) [homeassistant.setup] Setup failed for frontend: (DependencyError(...), 'Could not setup dependencies: onboarding')
Jul 19 17:42:42 sarge hass[765491]: 2022-07-19 17:42:42 ERROR (MainThread) [homeassistant.setup] Setup failed for usb: Unable to import component: No module named 'serial'
Jul 19 17:43:03 sarge hass[765491]: 2022-07-19 17:43:03 ERROR (MainThread) [homeassistant.setup] Setup failed for cloud: Unable to import component: No module named 'hass_nabucasa'
Jul 19 17:43:31 sarge hass[765491]: 2022-07-19 17:43:31 WARNING (MainThread) [homeassistant.bootstrap] Waiting on integrations to complete setup: zeroconf
Jul 19 17:43:31 sarge hass[765491]: 2022-07-19 17:43:31 ERROR (MainThread) [homeassistant.setup] Setup failed for ssdp: Unable to import component: No module named 'async_upnp_client'
Jul 19 17:43:32 sarge hass[765491]: 2022-07-19 17:43:32 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of my. Setup failed for dependencies: frontend
Jul 19 17:43:32 sarge hass[765491]: 2022-07-19 17:43:32 ERROR (MainThread) [homeassistant.setup] Setup failed for my: (DependencyError(...), 'Could not setup dependencies: frontend')
Jul 19 17:43:32 sarge hass[765491]: 2022-07-19 17:43:32 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of logbook. Setup failed for dependencies: frontend, recorder
Jul 19 17:43:32 sarge hass[765491]: 2022-07-19 17:43:32 ERROR (MainThread) [homeassistant.setup] Setup failed for logbook: (DependencyError(...), 'Could not setup dependencies: frontend, recorder')
Jul 19 17:43:32 sarge hass[765491]: 2022-07-19 17:43:32 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of history. Setup failed for dependencies: recorder
Jul 19 17:43:32 sarge hass[765491]: 2022-07-19 17:43:32 ERROR (MainThread) [homeassistant.setup] Setup failed for history: (DependencyError(...), 'Could not setup dependencies: recorder')
Jul 19 17:43:32 sarge hass[765491]: 2022-07-19 17:43:32 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of map. Setup failed for dependencies: frontend
Jul 19 17:43:32 sarge hass[765491]: 2022-07-19 17:43:32 ERROR (MainThread) [homeassistant.setup] Setup failed for map: (DependencyError(...), 'Could not setup dependencies: frontend')
Jul 19 17:43:32 sarge hass[765491]: 2022-07-19 17:43:32 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of energy. Setup failed for dependencies: history, recorder
Jul 19 17:43:32 sarge hass[765491]: 2022-07-19 17:43:32 ERROR (MainThread) [homeassistant.setup] Setup failed for energy: (DependencyError(...), 'Could not setup dependencies: history, recorder')
Jul 19 17:43:38 sarge hass[765491]: 2022-07-19 17:43:38 ERROR (MainThread) [homeassistant.config] Platform error: tts
Jul 19 17:43:38 sarge hass[765491]: Traceback (most recent call last):
Jul 19 17:43:38 sarge hass[765491]: File "/usr/lib/python3.10/site-packages/homeassistant/config.py", line 877, in async_process_component_config
Jul 19 17:43:38 sarge hass[765491]: platform = p_integration.get_platform(domain)
Jul 19 17:43:38 sarge hass[765491]: File "/usr/lib/python3.10/site-packages/homeassistant/loader.py", line 618, in get_platform
Jul 19 17:43:38 sarge hass[765491]: cache[full_name] = self._import_platform(platform_name)
Jul 19 17:43:38 sarge hass[765491]: File "/usr/lib/python3.10/site-packages/homeassistant/loader.py", line 635, in _import_platform
Jul 19 17:43:38 sarge hass[765491]: return importlib.import_module(f"{self.pkg_path}.{platform_name}")
Jul 19 17:43:38 sarge hass[765491]: File "/usr/lib/python3.10/importlib/__init__.py", line 126, in import_module
Jul 19 17:43:38 sarge hass[765491]: return _bootstrap._gcd_import(name[level:], package, level)
Jul 19 17:43:38 sarge hass[765491]: File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
Jul 19 17:43:38 sarge hass[765491]: File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
Jul 19 17:43:38 sarge hass[765491]: File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
Jul 19 17:43:38 sarge hass[765491]: File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
Jul 19 17:43:38 sarge hass[765491]: File "<frozen importlib._bootstrap_external>", line 883, in exec_module
Jul 19 17:43:38 sarge hass[765491]: File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
Jul 19 17:43:38 sarge hass[765491]: File "/usr/lib/python3.10/site-packages/homeassistant/components/google_translate/tts.py", line 5, in <module>
Jul 19 17:43:38 sarge hass[765491]: from gtts import gTTS, gTTSError
Jul 19 17:43:38 sarge hass[765491]: ModuleNotFoundError: No module named 'gtts'
Jul 19 17:43:43 sarge hass[765491]: 2022-07-19 17:43:43 ERROR (MainThread) [homeassistant.setup] Setup failed for mobile_app: Unable to import component: No module named 'hass_nabucasa'
Jul 19 17:43:43 sarge hass[765491]: 2022-07-19 17:43:43 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of default_config. Setup failed for dependencies: cloud, dhcp, energy, frontend, history, logbook, map, mobile_app, my, ssdp, usb
Jul 19 17:43:43 sarge hass[765491]: 2022-07-19 17:43:43 ERROR (MainThread) [homeassistant.setup] Setup failed for default_config: (DependencyError(...), 'Could not setup dependencies: cloud, dhcp, energy, frontend, history, logbook, map, mobile_app, my, ssdp, usb')
Jul 19 17:43:43 sarge hass[765491]: 2022-07-19 17:43:43 WARNING (MainThread) [homeassistant.bootstrap] Detected that frontend did not load. Activating safe mode
Jul 19 17:43:44 sarge hass[765491]: 2022-07-19 17:43:44 ERROR (MainThread) [homeassistant.setup] Setup failed for analytics: Unable to import component: No module named 'fnvhash'
Jul 19 17:43:44 sarge hass[765491]: 2022-07-19 17:43:44 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of onboarding. Setup failed for dependencies: analytics
Jul 19 17:43:44 sarge hass[765491]: 2022-07-19 17:43:44 ERROR (MainThread) [homeassistant.setup] Setup failed for onboarding: (DependencyError(...), 'Could not setup dependencies: analytics')
Jul 19 17:43:44 sarge hass[765491]: 2022-07-19 17:43:44 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of frontend. Setup failed for dependencies: onboarding
Jul 19 17:43:44 sarge hass[765491]: 2022-07-19 17:43:44 ERROR (MainThread) [homeassistant.setup] Setup failed for frontend: (DependencyError(...), 'Could not setup dependencies: onboarding')
Jul 19 17:43:44 sarge hass[765491]: 2022-07-19 17:43:44 ERROR (MainThread) [homeassistant.setup] Setup failed for cloud: Unable to import component: No module named 'hass_nabucasa'
Jul 19 17:43:44 sarge hass[765491]: 2022-07-19 17:43:44 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of safe_mode. Setup failed for dependencies: frontend, cloud
Jul 19 17:43:44 sarge hass[765491]: 2022-07-19 17:43:44 ERROR (MainThread) [homeassistant.setup] Setup failed for safe_mode: (DependencyError(...), 'Could not setup dependencies: frontend, cloud')
```

Steps to reproduce:
Install the home-assistant package from the official repositories (as described in https://wiki.archlinux.org/title/Home_Assistant).
Start home-assistant with systemctl.
Watch the output with journalctl -fu home-assistant
This task depends upon

Closed by  Toolybird (Toolybird)
Saturday, 20 May 2023, 01:53 GMT
Reason for closing:  Upstream
Additional comments about closing:  See PM's comments
Comment by Toolybird (Toolybird) - Monday, 25 July 2022, 06:33 GMT
I just tried a very unscientific test inside a systemd-nspawn container and got the same result. I suspect it's probably fixed in an upstream update. Though, I couldn't find anything in the upstream (very busy) GitHub repo. You could always try reporting it upstream and/or try to get some support in the forum/IRC/etc.
Comment by InFerYes (InFerYes) - Monday, 25 July 2022, 06:37 GMT
The PKGBUILD has a line that says "# lift hard dep constraints, we'll deal with breaking changes ourselves" so I don't think they'd appreciate upstream bug reports for custom installers.
Comment by Maxime Gauduin (Alucryd) - Tuesday, 09 August 2022, 08:02 GMT
This has been an issue for as long as I can remember. First run almost always fails, but it succeeds on the second try. The Home Assistant devs don't want anyone to use anything other than their official install methods, they won't bother fixing this even if we reported it. Afraid there's not much to do, please try restarting the service, it has always worked on the second try in my testing.

The line in the PKGBUILD refers to potentially updated python libs in our repos with different APIs, not fundamentally broken stuff like this.

Loading...