ModuleNotFoundError: No module named 'hass_frontend' #259

Closed
opened 2022-02-06 21:32:49 +01:00 by eruditas · 11 comments
Logger: homeassistant.setup
Source: components/frontend/__init__.py:314
First occurred: 10:24:24 PM (1 occurrences)
Last logged: 10:24:24 PM
Error during setup of component frontend

Traceback (most recent call last):
  File "/usr/lib/python3.9/site-packages/homeassistant/setup.py", line 227, in _async_setup_component
    result = await task
  File "/usr/lib/python3.9/site-packages/homeassistant/components/frontend/__init__.py", line 339, in async_setup
    root_path = _frontend_root(repo_path)
  File "/usr/lib/python3.9/site-packages/homeassistant/components/frontend/__init__.py", line 314, in _frontend_root
    import hass_frontend
ModuleNotFoundError: No module named 'hass_frontend'
 Logger: homeassistant.setup
Source: setup.py:135
First occurred: 10:24:24 PM (1 occurrences)
Last logged: 10:24:24 PM
Unable to set up dependencies of safe_mode. Setup failed for dependencies: frontend
 Logger: homeassistant.setup
Source: setup.py:154
First occurred: 10:24:24 PM (1 occurrences)
Last logged: 10:24:24 PM
Setup failed for safe_mode: (DependencyError(...), 'Could not setup dependencies: frontend')
sudo emerge -av1 home-assistant-frontend

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild   R    ] dev-python/home-assistant-frontend-20220203.0-r1::HomeAssistantRepository  USE="-test" PYTHON_TARGETS="python3_9 -python3_8 -python3_10" 0 KiB

Total: 1 package (1 reinstall), Size of downloads: 0 KiB
sudo emerge -av1 homeassistant-min

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild   R    ] app-misc/homeassistant-min-2022.2.2::HomeAssistantRepository  USE="caldav cli dwd_weather_warnings esphome frontend homekit http mobile_app mqtt mysql notify_events otp ping plex python_script recorder rest scrape snmp sql ssl utility_meter version wake_on_lan zwave_js -accuweather -airly -airvisual -alpha_vantage -android_ip_webcam -androidtv -axis -bluetooth_le_tracker -camera -cast -co2signal -compensation -coronavirus -darksky -enigma2 -forecast_solar -fronius -github -homekit_controller -hyperion -influxdb -knx -kodi -kraken -maxcube -mikrotik -myq -mysensors -octoprint -owntracks -ozw -ps4 -qnap -qvr_pro -ring -samsungtv -season -shelly -signal_messenger -socat -sonos -speedtestdotnet -systemd -systemmonitor -tankerkoenig -tasmota -test -tile -tplink -tradfri -wemo -whois -workday -yamaha -yamaha_musiccast -zeroconf" PYTHON_TARGETS="python3_9 -python3_8 -python3_10" 0 KiB

Total: 1 package (1 reinstall), Size of downloads: 0 KiB
```python Logger: homeassistant.setup Source: components/frontend/__init__.py:314 First occurred: 10:24:24 PM (1 occurrences) Last logged: 10:24:24 PM Error during setup of component frontend Traceback (most recent call last): File "/usr/lib/python3.9/site-packages/homeassistant/setup.py", line 227, in _async_setup_component result = await task File "/usr/lib/python3.9/site-packages/homeassistant/components/frontend/__init__.py", line 339, in async_setup root_path = _frontend_root(repo_path) File "/usr/lib/python3.9/site-packages/homeassistant/components/frontend/__init__.py", line 314, in _frontend_root import hass_frontend ModuleNotFoundError: No module named 'hass_frontend' ``` ```python Logger: homeassistant.setup Source: setup.py:135 First occurred: 10:24:24 PM (1 occurrences) Last logged: 10:24:24 PM Unable to set up dependencies of safe_mode. Setup failed for dependencies: frontend ``` ```python Logger: homeassistant.setup Source: setup.py:154 First occurred: 10:24:24 PM (1 occurrences) Last logged: 10:24:24 PM Setup failed for safe_mode: (DependencyError(...), 'Could not setup dependencies: frontend') ``` ```bash sudo emerge -av1 home-assistant-frontend These are the packages that would be merged, in order: Calculating dependencies... done! [ebuild R ] dev-python/home-assistant-frontend-20220203.0-r1::HomeAssistantRepository USE="-test" PYTHON_TARGETS="python3_9 -python3_8 -python3_10" 0 KiB Total: 1 package (1 reinstall), Size of downloads: 0 KiB ``` ```bash sudo emerge -av1 homeassistant-min These are the packages that would be merged, in order: Calculating dependencies... done! [ebuild R ] app-misc/homeassistant-min-2022.2.2::HomeAssistantRepository USE="caldav cli dwd_weather_warnings esphome frontend homekit http mobile_app mqtt mysql notify_events otp ping plex python_script recorder rest scrape snmp sql ssl utility_meter version wake_on_lan zwave_js -accuweather -airly -airvisual -alpha_vantage -android_ip_webcam -androidtv -axis -bluetooth_le_tracker -camera -cast -co2signal -compensation -coronavirus -darksky -enigma2 -forecast_solar -fronius -github -homekit_controller -hyperion -influxdb -knx -kodi -kraken -maxcube -mikrotik -myq -mysensors -octoprint -owntracks -ozw -ps4 -qnap -qvr_pro -ring -samsungtv -season -shelly -signal_messenger -socat -sonos -speedtestdotnet -systemd -systemmonitor -tankerkoenig -tasmota -test -tile -tplink -tradfri -wemo -whois -workday -yamaha -yamaha_musiccast -zeroconf" PYTHON_TARGETS="python3_9 -python3_8 -python3_10" 0 KiB Total: 1 package (1 reinstall), Size of downloads: 0 KiB ```
onkelbeh added the Bug label 2022-02-06 22:04:52 +01:00
Owner

currently known, caused by out of space problems on pypi.
should be fixed with the next release of the frontend.

currently known, caused by out of space problems on pypi. should be fixed with the next release of the frontend.
Owner

home-assistant-frontend-20220203.0-r1 should compile the node stuff itself, but is very experimental, needs network access in the sandbox and eats up >25 minutes of build time.

home-assistant-frontend-20220203.0-r1 should compile the node stuff itself, but is very experimental, needs network access in the sandbox and eats up >25 minutes of build time.
Owner
see https://git.edevau.net/onkelbeh/HomeAssistantRepository/issues/258#issuecomment-1478
Author

home-assistant-frontend-20220203.0-r1 should compile the node stuff itself, but is very experimental, needs network access in the sandbox and eats up >25 minutes of build time.

But I have dev-python/home-assistant-frontend-20220203.0-r1 installed
If I read your comment correclty, this version should work. Or did I missread?

> home-assistant-frontend-20220203.0-r1 should compile the node stuff itself, but is very experimental, needs network access in the sandbox and eats up >25 minutes of build time. But I have dev-python/home-assistant-frontend-20220203.0-r1 installed If I read your comment correclty, this version should work. Or did I missread?
Owner

it compiles on a testbox.

you should go back to the last release for now, 20220202.0 is based on the old SDIST build, which is not available anymore.

app-misc/homeassistant-min-2022.2.1 uses the "known as good" frontend.

it compiles on a testbox. you should go back to the last release for now, 20220202.0 is based on the old SDIST build, which is not available anymore. app-misc/homeassistant-min-2022.2.1 uses the "known as good" frontend.
Author

I had to install app-misc/homeassistant-min-2022.2.0 by puting >=app-misc/homeassistant-min-2022.2.1-1 in my package.mask file.
Other versions just try to install the new fronted.

I had to install `app-misc/homeassistant-min-2022.2.0` by puting `>=app-misc/homeassistant-min-2022.2.1-1` in my `package.mask` file. Other versions just try to install the new fronted.
Owner
root@g18-hasstest:/usr/portage/homeassistant/dev-python/home-assistant-frontend # emerge -1tv dev-python/home-assistant-frontend

Local copy of remote index is up-to-date and will be used.

Local copy of remote index is up-to-date and will be used.

These are the packages that would be merged, in reverse order:

Calculating dependencies... done!
[ebuild  N    ~] dev-python/home-assistant-frontend-20220203.0-r1::HomeAssistantRepository  USE="test" PYTHON_TARGETS="python3_9 -python3_8 -python3_10" 0 KiB
[ebuild  N    ~]  dev-python/user-agents-2.0-r2::HomeAssistantRepository  USE="test" PYTHON_TARGETS="python3_9 -python3_8 -python3_10" 0 KiB
[ebuild  N    ~]   dev-python/ua-parser-0.10.0::HomeAssistantRepository  USE="test" PYTHON_TARGETS="python3_9 -python3_8 -python3_10" 0 KiB
[ebuild  N     ]  sys-apps/yarn-1.22.17::gentoo  0 KiB
[binary  N     ]   net-libs/nodejs-14.17.6:0/14::gentoo  USE="icu npm snapshot ssl system-icu system-ssl -debug -doc -inspector -lto -pax-kernel -systemtap -test" CPU_FLAGS_X86="sse2" 0 KiB
[binary  N     ]    net-dns/c-ares-1.17.2:0/2::gentoo  USE="-static-libs -test" 0 KiB
[binary  N     ]    app-arch/brotli-1.0.9-r3-1:0/1::gentoo  USE="python -static-libs -test" PYTHON_TARGETS="python3_9 (-pypy3) -python3_8 -python3_10" 0 KiB

Total: 7 packages (7 new, 3 binaries), Size of downloads: 0 KiB

>>> Verifying ebuild manifests
>>> Running pre-merge checks for net-libs/nodejs-14.17.6
>>> Emerging binary (1 of 7) app-arch/brotli-1.0.9-r3::gentoo
>>> Emerging binary (2 of 7) net-dns/c-ares-1.17.2::gentoo
>>> Emerging (3 of 7) dev-python/ua-parser-0.10.0::HomeAssistantRepository
>>> Installing (1 of 7) app-arch/brotli-1.0.9-r3::gentoo
>>> Installing (2 of 7) net-dns/c-ares-1.17.2::gentoo
>>> Emerging binary (4 of 7) net-libs/nodejs-14.17.6::gentoo
>>> Installing (3 of 7) dev-python/ua-parser-0.10.0::HomeAssistantRepository
>>> Emerging (5 of 7) dev-python/user-agents-2.0-r2::HomeAssistantRepository
>>> Installing (4 of 7) net-libs/nodejs-14.17.6::gentoo
>>> Emerging (6 of 7) sys-apps/yarn-1.22.17::gentoo
>>> Installing (6 of 7) sys-apps/yarn-1.22.17::gentoo
>>> Installing (5 of 7) dev-python/user-agents-2.0-r2::HomeAssistantRepository
>>> Emerging (7 of 7) dev-python/home-assistant-frontend-20220203.0-r1::HomeAssistantRepository
>>> Installing (7 of 7) dev-python/home-assistant-frontend-20220203.0-r1::HomeAssistantRepository
>>> Jobs: 7 of 7 complete                           Load avg: 1.00, 1.04, 1.12
>>> Auto-cleaning packages...

>>> No outdated packages were found on your system.

 * GNU info directory index is up-to-date.
   [1]   root@g18-hasstest:/usr/portage/homeassistant/dev-python/home-assistant-frontend # ls -la /usr/lib/python3.9/site-packages/ | grep frontend
drwxr-xr-x   2 root root   4096 Feb  6 22:54 home_assistant_frontend-20220203.0-py3.9.egg-info

You are right, the module ids missing, it does not (always) build the node stuff correctly from this Ebuild.
2022.2.3 was just released with the affected frontend. So I will have to look into it, won't hurt to learn more about building node stuff in Ebuilds. My production box still is on 2021.12.10

``` root@g18-hasstest:/usr/portage/homeassistant/dev-python/home-assistant-frontend # emerge -1tv dev-python/home-assistant-frontend Local copy of remote index is up-to-date and will be used. Local copy of remote index is up-to-date and will be used. These are the packages that would be merged, in reverse order: Calculating dependencies... done! [ebuild N ~] dev-python/home-assistant-frontend-20220203.0-r1::HomeAssistantRepository USE="test" PYTHON_TARGETS="python3_9 -python3_8 -python3_10" 0 KiB [ebuild N ~] dev-python/user-agents-2.0-r2::HomeAssistantRepository USE="test" PYTHON_TARGETS="python3_9 -python3_8 -python3_10" 0 KiB [ebuild N ~] dev-python/ua-parser-0.10.0::HomeAssistantRepository USE="test" PYTHON_TARGETS="python3_9 -python3_8 -python3_10" 0 KiB [ebuild N ] sys-apps/yarn-1.22.17::gentoo 0 KiB [binary N ] net-libs/nodejs-14.17.6:0/14::gentoo USE="icu npm snapshot ssl system-icu system-ssl -debug -doc -inspector -lto -pax-kernel -systemtap -test" CPU_FLAGS_X86="sse2" 0 KiB [binary N ] net-dns/c-ares-1.17.2:0/2::gentoo USE="-static-libs -test" 0 KiB [binary N ] app-arch/brotli-1.0.9-r3-1:0/1::gentoo USE="python -static-libs -test" PYTHON_TARGETS="python3_9 (-pypy3) -python3_8 -python3_10" 0 KiB Total: 7 packages (7 new, 3 binaries), Size of downloads: 0 KiB >>> Verifying ebuild manifests >>> Running pre-merge checks for net-libs/nodejs-14.17.6 >>> Emerging binary (1 of 7) app-arch/brotli-1.0.9-r3::gentoo >>> Emerging binary (2 of 7) net-dns/c-ares-1.17.2::gentoo >>> Emerging (3 of 7) dev-python/ua-parser-0.10.0::HomeAssistantRepository >>> Installing (1 of 7) app-arch/brotli-1.0.9-r3::gentoo >>> Installing (2 of 7) net-dns/c-ares-1.17.2::gentoo >>> Emerging binary (4 of 7) net-libs/nodejs-14.17.6::gentoo >>> Installing (3 of 7) dev-python/ua-parser-0.10.0::HomeAssistantRepository >>> Emerging (5 of 7) dev-python/user-agents-2.0-r2::HomeAssistantRepository >>> Installing (4 of 7) net-libs/nodejs-14.17.6::gentoo >>> Emerging (6 of 7) sys-apps/yarn-1.22.17::gentoo >>> Installing (6 of 7) sys-apps/yarn-1.22.17::gentoo >>> Installing (5 of 7) dev-python/user-agents-2.0-r2::HomeAssistantRepository >>> Emerging (7 of 7) dev-python/home-assistant-frontend-20220203.0-r1::HomeAssistantRepository >>> Installing (7 of 7) dev-python/home-assistant-frontend-20220203.0-r1::HomeAssistantRepository >>> Jobs: 7 of 7 complete Load avg: 1.00, 1.04, 1.12 >>> Auto-cleaning packages... >>> No outdated packages were found on your system. * GNU info directory index is up-to-date. [1] root@g18-hasstest:/usr/portage/homeassistant/dev-python/home-assistant-frontend # ls -la /usr/lib/python3.9/site-packages/ | grep frontend drwxr-xr-x 2 root root 4096 Feb 6 22:54 home_assistant_frontend-20220203.0-py3.9.egg-info ``` You are right, the module ids missing, it does not (always) build the node stuff correctly from this Ebuild. 2022.2.3 was just released with the affected frontend. So I will have to look into it, won't hurt to learn more about building node stuff in Ebuilds. My production box still is on 2021.12.10

Hello,

I've got the same issue with my installation of home-assistant-frontend.
At my machine hass_frontend module was also missing when home-assistant-frontend was sucessfully compiled and installed.

I found out that hass_frontend is not installed to image fodler and this is caused by command python3.9 setup.py install --skip-build --root ....

when I remove --skip-build option from this command then hass_frontend is inside image folder and then is copied to /usr/lib/python3.9/site_packages and everything works fine.

--skip-build option is generated by distutils-r1.eclass which is gentoo system file. As far as I discovered missing hass_frontend is couased that list of files that should be added to package is generated during install phase which is not recommended.

P.S. I'm not python dev so i can be wrong as well :)

Hello, I've got the same issue with my installation of home-assistant-frontend. At my machine hass_frontend module was also missing when home-assistant-frontend was sucessfully compiled and installed. I found out that hass_frontend is not installed to image fodler and this is caused by command python3.9 setup.py install --skip-build --root .... when I remove --skip-build option from this command then hass_frontend is inside image folder and then is copied to /usr/lib/python3.9/site_packages and everything works fine. --skip-build option is generated by distutils-r1.eclass which is gentoo system file. As far as I discovered missing hass_frontend is couased that list of files that should be added to package is generated during install phase which is not recommended. P.S. I'm not python dev so i can be wrong as well :)
Owner

HA's frontend team is currently refusing to provide the SDIST again. Perhaps: spread some likes:
https://github.com/home-assistant/frontend/issues/11542
https://github.com/home-assistant/frontend/pull/11566

HA's frontend team is currently refusing to provide the SDIST again. Perhaps: spread some likes: https://github.com/home-assistant/frontend/issues/11542 https://github.com/home-assistant/frontend/pull/11566
Owner

grafik
Seems to work again, included the generation of the SDIST in the release process: ce2d37ebe8

Could someone else give it a try?

![grafik](/attachments/91d690b4-7a8e-4241-83ed-f41f6a27f617) Seems to work again, included the generation of the SDIST in the release process: https://git.edevau.net/onkelbeh/HomeAssistantRepository/commit/ce2d37ebe89f0d5e92430da963d0f79193481946 Could someone else give it a try?
320 KiB
Owner

Looks like the original SDIST won't be added again, so I decided to provide an own archive with the pre-built files, as suggested by @Tatsh in #258 (comment)

...gave up on the idea on building during installation, this eats up too much cpu and requires a lot of (otherwise unneeded) stuff, like yarn und node-js, this is a fat build, even on bigger machines, and won't be possible on smaller appliances.

Here's the stuff I hacked together (most is from Marc Mueller, https://github.com/cdce8p/ha-frontend/), perhaps someone has ideas to improve it, input is very welcome, I am not a nodejs expert:

#!/bin/bash

# needs internet access, sys-apps/yarn and net-libs/nodejs on build machine

set -e
version="${1}"

# download a clean release and build the node stuff
if true; then
    [ -f "${version}.tar.gz" ] && rm "${version}.tar.gz"
    wget "https://github.com/home-assistant/frontend/archive/refs/tags/${version}.tar.gz"

    [ -d "frontend-${version}" && rm -R "frontend-${version}"
    tar -xvf "${version}.tar.gz"

    cd "frontend-${version}"
    rm -rf dist home_assistant_frontend.egg-info
    yarn install
    ./script/build_frontend
    cd ..
fi

[ -d "home-assistant-frontend-${version}" ] && rm -Rf "home-assistant-frontend-${version}"

# try to do what wheel would do:
cp -av _template "home-assistant-frontend-${version}"
echo "generating home-assistant-frontend-${version}"
for item in hass_frontend README.md MANIFEST.in pyproject.toml setup.cfg setup.py; do
    echo ${item}
    cp -av "frontend-${version}/${item}" home-assistant-frontend-"${version}" > /dev/null
done
echo "packing home-assistant-frontend-${version}.tar.xz"
tar -Jcvf "home-assistant-frontend-${version}.tar.xz" "home-assistant-frontend-${version}" >/dev/null
echo "copy home-assistant-frontend-${version}.tar.xz to webserver"
scp "home-assistant-frontend-${version}.tar.xz" dmzspider:/var/www/hasf.edevau.net/htdocs/h/home-assistant-frontend/

If it survives the next release, I'll add some error catchers and include it in the 'big' release script.

Looks like the original SDIST won't be added again, so I decided to provide an own archive with the pre-built files, as suggested by @Tatsh in https://git.edevau.net/onkelbeh/HomeAssistantRepository/issues/258#issuecomment-1476 ...gave up on the idea on building during installation, this eats up too much cpu and requires a lot of (otherwise unneeded) stuff, like yarn und node-js, this is a fat build, even on bigger machines, and won't be possible on smaller appliances. Here's the stuff I hacked together (most is from Marc Mueller, https://github.com/cdce8p/ha-frontend/), perhaps someone has ideas to improve it, input is very welcome, I am not a nodejs expert: ```bash #!/bin/bash # needs internet access, sys-apps/yarn and net-libs/nodejs on build machine set -e version="${1}" # download a clean release and build the node stuff if true; then [ -f "${version}.tar.gz" ] && rm "${version}.tar.gz" wget "https://github.com/home-assistant/frontend/archive/refs/tags/${version}.tar.gz" [ -d "frontend-${version}" && rm -R "frontend-${version}" tar -xvf "${version}.tar.gz" cd "frontend-${version}" rm -rf dist home_assistant_frontend.egg-info yarn install ./script/build_frontend cd .. fi [ -d "home-assistant-frontend-${version}" ] && rm -Rf "home-assistant-frontend-${version}" # try to do what wheel would do: cp -av _template "home-assistant-frontend-${version}" echo "generating home-assistant-frontend-${version}" for item in hass_frontend README.md MANIFEST.in pyproject.toml setup.cfg setup.py; do echo ${item} cp -av "frontend-${version}/${item}" home-assistant-frontend-"${version}" > /dev/null done echo "packing home-assistant-frontend-${version}.tar.xz" tar -Jcvf "home-assistant-frontend-${version}.tar.xz" "home-assistant-frontend-${version}" >/dev/null echo "copy home-assistant-frontend-${version}.tar.xz to webserver" scp "home-assistant-frontend-${version}.tar.xz" dmzspider:/var/www/hasf.edevau.net/htdocs/h/home-assistant-frontend/ ``` If it survives the next release, I'll add some error catchers and include it in the 'big' release script.
Sign in to join this conversation.
No labels Bug
3 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: onkelbeh/HomeAssistantRepository#259