home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
71.73k stars 29.99k forks source link

Unable to import hass_frontend #28198

Closed Ernst79 closed 4 years ago

Ernst79 commented 4 years ago

Home Assistant release with the issue: 0.102 (dev) 0.101.0b0

Last working Home Assistant release (if known):

Operating environment (Hass.io/Docker/Windows/etc.): Raspian Lite Buster

Description of problem: I tried to setup a new development environment on a Raspian Lite (buster) image. After starting the 'hass' command, I get an Unable to import 'hass_frontend' error. Had the same issue yesterday with the beta version 0.101.0b0. Did not change anything in the configuration.yaml file, just a clean install.

Problem-relevant configuration.yaml entries and (fill out even if it seems unimportant):

Traceback (if applicable):

2019-10-25 08:06:55 INFO (MainThread) [homeassistant.setup] Setting up lovelace
2019-10-25 08:06:55 ERROR (MainThread) [homeassistant.setup] Error during setup of omponent lovelace
Traceback (most recent call last):
  File "/home/pi/home-assistant/homeassistant/setup.py", line 167, in _async_setup_omponent
    hass, processed_config
  File "/home/pi/home-assistant/homeassistant/components/lovelace/__init__.py", lin 66, in async_setup
    hass.components.frontend.async_register_built_in_panel(
  File "/home/pi/home-assistant/homeassistant/loader.py", line 421, in __getattr__
    component: Optional[ModuleType] = integration.get_component()
  File "/home/pi/home-assistant/homeassistant/loader.py", line 223, in get_componen
    cache[self.domain] = importlib.import_module(self.pkg_path)
  File "/usr/lib/python3.7/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 728, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/home/pi/home-assistant/homeassistant/components/frontend/__init__.py", lin 10, in <module>
    import hass_frontend
ModuleNotFoundError: No module named 'hass_frontend'
2019-10-25 08:06:57 INFO (MainThread) [homeassistant.setup] Setting up history
2019-10-25 08:06:57 ERROR (MainThread) [homeassistant.setup] Error during setup of omponent history
Traceback (most recent call last):
  File "/home/pi/home-assistant/homeassistant/setup.py", line 167, in _async_setup_omponent
    hass, processed_config
  File "/home/pi/home-assistant/homeassistant/components/history/__init__.py", line283, in async_setup
    hass.components.frontend.async_register_built_in_panel(
  File "/home/pi/home-assistant/homeassistant/loader.py", line 421, in __getattr__
    component: Optional[ModuleType] = integration.get_component()
  File "/home/pi/home-assistant/homeassistant/loader.py", line 223, in get_componen
    cache[self.domain] = importlib.import_module(self.pkg_path)
  File "/usr/lib/python3.7/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 728, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/home/pi/home-assistant/homeassistant/components/frontend/__init__.py", lin 10, in <module>
    import hass_frontend
ModuleNotFoundError: No module named 'hass_frontend'
2019-10-25 08:06:57 INFO (MainThread) [homeassistant.setup] Setting up api
2019-10-25 08:06:57 INFO (MainThread) [homeassistant.setup] Setting up websocket_ap
2019-10-25 08:06:57 INFO (MainThread) [homeassistant.setup] Setup of domain websockt_api took 0.0 seconds.
2019-10-25 08:06:57 INFO (MainThread) [homeassistant.setup] Setting up webhook
2019-10-25 08:06:57 INFO (MainThread) [homeassistant.setup] Setup of domain webhooktook 0.0 seconds.
2019-10-25 08:06:57 INFO (MainThread) [homeassistant.setup] Setting up system_healt
2019-10-25 08:06:57 INFO (MainThread) [homeassistant.setup] Setup of domain system_ealth took 0.0 seconds.
2019-10-25 08:06:58 INFO (MainThread) [homeassistant.setup] Setting up auth
2019-10-25 08:06:58 INFO (MainThread) [homeassistant.setup] Setup of domain auth tok 0.0 seconds.
2019-10-25 08:06:58 INFO (MainThread) [homeassistant.setup] Setting up config
2019-10-25 08:06:58 ERROR (MainThread) [homeassistant.setup] Error during setup of omponent config
Traceback (most recent call last):
  File "/home/pi/home-assistant/homeassistant/setup.py", line 167, in _async_setup_omponent
    hass, processed_config
  File "/home/pi/home-assistant/homeassistant/components/config/__init__.py", line 4, in async_setup
    hass.components.frontend.async_register_built_in_panel(
  File "/home/pi/home-assistant/homeassistant/loader.py", line 421, in __getattr__
    component: Optional[ModuleType] = integration.get_component()
  File "/home/pi/home-assistant/homeassistant/loader.py", line 223, in get_componen
    cache[self.domain] = importlib.import_module(self.pkg_path)
  File "/usr/lib/python3.7/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 728, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/home/pi/home-assistant/homeassistant/components/frontend/__init__.py", lin 10, in <module>
    import hass_frontend
ModuleNotFoundError: No module named 'hass_frontend'
2019-10-25 08:06:58 INFO (MainThread) [homeassistant.setup] Setting up script

Additional information:

probot-home-assistant[bot] commented 4 years ago

Hey there @home-assistant/frontend, mind taking a look at this issue as its been labeled with a integration (frontend) you are listed as a codeowner for? Thanks!

gngj commented 4 years ago

Broken by https://github.com/home-assistant/home-assistant/pull/27988 Hot fix is reverting it or running pip install home-assistant-frontend

Ernst79 commented 4 years ago

Thanks for the hotfix, but I think this issue should be solved in the code, as otherwise everybody with a new home assistant install will run into this issue.

I did a little further debugging. You're right about home-assistant-frontend not being installed. The manifest.json file does however have the requirement "home-assistant-frontend==20191023.0" and it is also in requirements_all.txt. This package is available on pypi.org, so that shouldn't be an issue. Nevertheless, I don't see it in the venv/lib/python3.7/site-packages folder, where it should be placed after installation. For some reason it's not being installed, I guess. I don't see any error about not being able to install this, or even that it tries to install it. Not sure where to look further.

Ernst79 commented 4 years ago

Closed my alternative PR, this was not a good solution. Moving import down is the way to go, see Balloobs reaction in my PR.