Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Home assistant initial startup fails #28787

Closed
johnseekins opened this issue Nov 15, 2019 · 2 comments
Closed

Home assistant initial startup fails #28787

johnseekins opened this issue Nov 15, 2019 · 2 comments

Comments

@johnseekins
Copy link

Home Assistant release with the issue:

(venv) hass@hassbian:~ $ hass --version
0.101.3

Last working Home Assistant release (if known):
None

Operating environment (Hass.io/Docker/Windows/etc.):
Python 3.7.3/Debian 10/venv

Description of problem:
On initial startup, I get messages like the following:

2019-11-15 00:52:12 INFO (MainThread) [homeassistant.setup] Setting up lovelace
2019-11-15 00:52:12 ERROR (MainThread) [homeassistant.setup] Error during setup of component lovelace
Traceback (most recent call last):
  File "/opt/hassio/venv/lib/python3.7/site-packages/homeassistant/setup.py", line 172, in _async_setup_component
    hass, processed_config
  File "/opt/hassio/venv/lib/python3.7/site-packages/homeassistant/components/lovelace/__init__.py", line 66, in async_setup
    hass.components.frontend.async_register_built_in_panel(
  File "/opt/hassio/venv/lib/python3.7/site-packages/homeassistant/loader.py", line 421, in __getattr__
    component: Optional[ModuleType] = integration.get_component()
  File "/opt/hassio/venv/lib/python3.7/site-packages/homeassistant/loader.py", line 223, in get_component
    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 "/opt/hassio/venv/lib/python3.7/site-packages/homeassistant/components/frontend/__init__.py", line 10, in <module>
    import hass_frontend
ModuleNotFoundError: No module named 'hass_frontend'
2019-11-15 00:52:13 INFO (MainThread) [homeassistant.setup] Setting up sun
2019-11-15 00:52:13 INFO (MainThread) [homeassistant.setup] Setup of domain sun took 0.1 seconds.
2019-11-15 00:52:13 INFO (MainThread) [homeassistant.setup] Setting up script
2019-11-15 00:52:13 INFO (MainThread) [homeassistant.setup] Setup of domain script took 0.0 seconds.
2019-11-15 00:52:13 INFO (MainThread) [homeassistant.setup] Setting up history
2019-11-15 00:52:13 ERROR (MainThread) [homeassistant.setup] Error during setup of component history
Traceback (most recent call last):
  File "/opt/hassio/venv/lib/python3.7/site-packages/homeassistant/setup.py", line 172, in _async_setup_component
    hass, processed_config
  File "/opt/hassio/venv/lib/python3.7/site-packages/homeassistant/components/history/__init__.py", line 283, in async_setup
    hass.components.frontend.async_register_built_in_panel(
  File "/opt/hassio/venv/lib/python3.7/site-packages/homeassistant/loader.py", line 421, in __getattr__
    component: Optional[ModuleType] = integration.get_component()
  File "/opt/hassio/venv/lib/python3.7/site-packages/homeassistant/loader.py", line 223, in get_component
    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 "/opt/hassio/venv/lib/python3.7/site-packages/homeassistant/components/frontend/__init__.py", line 10, in <module>
    import hass_frontend
ModuleNotFoundError: No module named 'hass_frontend'
2019-11-15 00:52:13 INFO (MainThread) [homeassistant.setup] Setting up config
2019-11-15 00:52:13 ERROR (MainThread) [homeassistant.setup] Error during setup of component config
Traceback (most recent call last):
  File "/opt/hassio/venv/lib/python3.7/site-packages/homeassistant/setup.py", line 172, in _async_setup_component
    hass, processed_config
  File "/opt/hassio/venv/lib/python3.7/site-packages/homeassistant/components/config/__init__.py", line 34, in async_setup
    hass.components.frontend.async_register_built_in_panel(
  File "/opt/hassio/venv/lib/python3.7/site-packages/homeassistant/loader.py", line 421, in __getattr__
    component: Optional[ModuleType] = integration.get_component()
  File "/opt/hassio/venv/lib/python3.7/site-packages/homeassistant/loader.py", line 223, in get_component
    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 "/opt/hassio/venv/lib/python3.7/site-packages/homeassistant/components/frontend/__init__.py", line 10, in <module>
    import hass_frontend
ModuleNotFoundError: No module named 'hass_frontend'

Additional information:
This is with a completely clean install of Debian and an initial setup of a venv (python3 -m venv)

It seems that the hass_frontend component simply isn't installed with python3 -m pip install homeassistant or during the initial setup.

@johnseekins
Copy link
Author

I tried simply commenting out the import hass_frontend line, but this function:

def _frontend_root(dev_repo_path):
    """Return root path to the frontend files."""
    if dev_repo_path is not None:
        return pathlib.Path(dev_repo_path) / "hass_frontend"

    return hass_frontend.where()

is used frequently in the code and fails instead.

@johnseekins
Copy link
Author

Whelp! I didn't search hard enough. #28361 points at https://github.com/home-assistant/home-assistant/pull/28203/files which solves it for me.

As noted in the other issues, though...why is this still broken? It seems like a fairly easy pull request to resolve.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant