Error while installing home assistant

Hi @Jappe. Thank you for the welcome and the suggestion.
Unfortunately, I get the same info:

dietpi@DietPi:~$ sudo journalctl -u home-assistant
-- Journal begins at Fri 2022-08-12 17:05:32 -03, ends at Sat 2022-08-13 11:25:44 -03. --
Aug 12 17:32:10 DietPi systemd[1]: Started Home Assistant (DietPi).
Aug 12 17:32:20 DietPi systemd[1]: home-assistant.service: Main process exited, code=exited, status=1/FAILURE
Aug 12 17:32:20 DietPi systemd[1]: home-assistant.service: Failed with result 'exit-code'.
Aug 12 17:32:20 DietPi systemd[1]: home-assistant.service: Consumed 9.857s CPU time.
Aug 12 17:33:07 DietPi systemd[1]: Started Home Assistant (DietPi).
Aug 12 17:33:17 DietPi systemd[1]: home-assistant.service: Main process exited, code=exited, status=1/FAILURE
Aug 12 17:33:17 DietPi systemd[1]: home-assistant.service: Failed with result 'exit-code'.
Aug 12 17:33:17 DietPi systemd[1]: home-assistant.service: Consumed 10.318s CPU time.

Maybe you can runthe startscript manually on CLI and see if it throws some errors.

/home/homeassistant/homeassistant-start.sh 

I tried that, but I guess I need to change to the homeassistant user? Do you know the password for this user?

dietpi@DietPi:~$ /home/homeassistant/homeassistant-start.sh 
[FAILED] This pyenv must be activated as user "homeassistant". Aborting...

If you don’t set any password at the intsalltion my guess is it’s either your global software password or the user password. But I’m not sure since I never uses home assistant.

Ok, I got into the user and ran the startup script, but it just fails silently. :confused:
I checked and the homeassistant service is not running.

This is the problem, the service can not be started because the start script fails, but we don’t know why.
We need help by an actual home assistant user or somebody with more knowledge then myself. I checked the home assistant docs for how to enable logging but their logging system is a bit overkill for my taste and I’m not sure how this works together with the dietpi ram logs.

1 Like

Ok, thanks. I am stuck here because I don’t know if this is a problem with home assistant, dietpi, or the install script.
Let’s see if a home assistant user has some insight.

Did you actually tried to reinstall?

dietpi-software reinstall 157

Yep. I did. I uninstalled using the dietpi-software TUI and installed again. No difference.
I will try again with the command you suggested, though.

Can you post the entire install log pls

Here is the full log:

 DietPi-Software
─────────────────────────────────────────────────────
 Step: Checking for conflicts and missing inputs


 DietPi-Software
─────────────────────────────────────────────────────
 Step: Checking for prerequisite software

[  OK  ] DietPi-Software | Checking IPv4 network connectivity
[  OK  ] DietPi-Software | Checking DNS resolver
[  OK  ] DietPi-Software | mkdir -p /mnt/dietpi_userdata/Music /mnt/dietpi_userdata/Pictures /mnt/dietpi_userdata/Video /mnt/dietpi_userdata/downloads /var/www /opt /usr/local/bin
[  OK  ] DietPi-Software | chown dietpi:dietpi /mnt/dietpi_userdata/Music /mnt/dietpi_userdata/Pictures /mnt/dietpi_userdata/Video /mnt/dietpi_userdata/downloads
[  OK  ] DietPi-Software | chmod 0775 /mnt/dietpi_userdata/Music /mnt/dietpi_userdata/Pictures /mnt/dietpi_userdata/Video /mnt/dietpi_userdata/downloads
[ SUB1 ] DietPi-Services > unmask 
[  OK  ] DietPi-Services | unmask : avahi-daemon
[  OK  ] DietPi-Services | unmask : proftpd
[  OK  ] DietPi-Services | unmask : transmission-daemon
[  OK  ] DietPi-Services | unmask : cups
[  OK  ] DietPi-Services | unmask : home-assistant
[  OK  ] DietPi-Services | unmask : cron
[ SUB1 ] DietPi-Services > stop 
[  OK  ] DietPi-Services | stop : cron
[  OK  ] DietPi-Services | stop : home-assistant
[  OK  ] DietPi-Services | stop : cups
[  OK  ] DietPi-Services | stop : transmission-daemon
[  OK  ] DietPi-Services | stop : proftpd
[  OK  ] DietPi-Services | stop : avahi-daemon
[ INFO ] DietPi-Software | APT update, please wait...
Hit:1 https://deb.debian.org/debian bullseye InRelease
Get:2 https://deb.debian.org/debian bullseye-updates InRelease [44.1 kB]
Hit:3 https://deb.debian.org/debian-security bullseye-security InRelease
Get:4 https://deb.debian.org/debian bullseye-backports InRelease [49.0 kB]
Hit:5 https://archive.raspberrypi.org/debian bullseye InRelease
Fetched 93.0 kB in 5s (17.7 kB/s)
Reading package lists...
[  OK  ] DietPi-Software | APT update

 DietPi-Software
─────────────────────────────────────────────────────
 Step: Installing Home Assistant: Open source home automation platform

[ INFO ] DietPi-Software | Home Assistant user:  homeassistant
[ INFO ] DietPi-Software | Home Assistant home:  /home/homeassistant
[ INFO ] DietPi-Software | pyenv activation:     ". /home/homeassistant/pyenv-activate.sh"
[ INFO ] DietPi-Software | pyenv Python version: 3.9.13
[  OK  ] DietPi-Software | Verifying user "homeassistant" to run Home Assistant
[  OK  ] DietPi-Software | usermod -aG dialout,gpio,i2c -d /home/homeassistant -s /usr/sbin/nologin homeassistant
[  OK  ] DietPi-Software | rm -R /home/homeassistant/.pyenv
[  OK  ] DietPi-Software | mkdir -p /home/homeassistant
[  OK  ] DietPi-Software | chown homeassistant:homeassistant /home/homeassistant
[  OK  ] DietPi-Software | mkdir -p /home/homeassistant/.pip
[  OK  ] DietPi-Software | eval echo -e '[global]\nextra-index-url=https://www.piwheels.org/simple/' > /home/homeassistant/.pip/pip.conf
[  OK  ] DietPi-Software | cd /tmp/DietPi-Software
[  OK  ] DietPi-Software | Checking URL: https://github.com/pyenv/pyenv/archive/master.tar.gz
[ INFO ] DietPi-Software | G_THREAD_START_0 | curl -sSfL https://github.com/pyenv/pyenv/archive/master.tar.gz -o master.tar.gz
[ INFO ] DietPi-Software | APT install for: gcc libc6-dev make libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev libffi-dev libopenjp2-7 libtiff5 libxcb1, please wait...
Reading package lists...
Building dependency tree...
Reading state information...
libbz2-dev is already the newest version (1.0.8-4).
gcc is already the newest version (4:10.2.1-1).
libffi-dev is already the newest version (3.3-6).
libxcb1 is already the newest version (1.14-3).
make is already the newest version (4.3-4.1).
libopenjp2-7 is already the newest version (2.4.0-3).
libreadline-dev is already the newest version (8.1-1).
libsqlite3-dev is already the newest version (3.34.1-3).
libtiff5 is already the newest version (4.2.0-1+deb11u1).
zlib1g-dev is already the newest version (1:1.2.11.dfsg-2+deb11u1).
libc6-dev is already the newest version (2.31-13+rpt2+rpi1+deb11u3).
libssl-dev is already the newest version (1.1.1n-0+deb11u3+rpt1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
[  OK  ] DietPi-Software | APT install for: gcc libc6-dev make libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev libffi-dev libopenjp2-7 libtiff5 libxcb1
[  OK  ] DietPi-Software | G_THREAD: All threads finished
[  OK  ] DietPi-Software | tar xf master.tar.gz
[  OK  ] DietPi-Software | rm master.tar.gz
[  OK  ] DietPi-Software | mv pyenv-master /home/homeassistant/.pyenv
[  OK  ] DietPi-Software | chown -R homeassistant:homeassistant /home/homeassistant/.pyenv
[ INFO ] DietPi-Software | Installing Python with Home Assistant module into pyenv, please wait...
Downloading Python-3.9.13.tar.xz...
-> https://www.python.org/ftp/python/3.9.13/Python-3.9.13.tar.xz
Installing Python-3.9.13...
WARNING: The Python lzma extension was not compiled. Missing the lzma lib?
Installed Python-3.9.13 to /home/homeassistant/.pyenv/versions/3.9.13

Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple/
Requirement already satisfied: pip in ./.pyenv/versions/3.9.13/lib/python3.9/site-packages (22.0.4)
Collecting pip
  Downloading https://www.piwheels.org/simple/pip/pip-22.2.2-py3-none-any.whl (2.0 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.0/2.0 MB 1.1 MB/s eta 0:00:00
Requirement already satisfied: setuptools in ./.pyenv/versions/3.9.13/lib/python3.9/site-packages (58.1.0)
Collecting setuptools
  Downloading https://www.piwheels.org/simple/setuptools/setuptools-64.0.3-py3-none-any.whl (1.2 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.2/1.2 MB 758.8 kB/s eta 0:00:00
Collecting wheel
  Downloading https://www.piwheels.org/simple/wheel/wheel-0.37.1-py2.py3-none-any.whl (35 kB)
Installing collected packages: wheel, setuptools, pip
  Attempting uninstall: setuptools
    Found existing installation: setuptools 58.1.0
    Uninstalling setuptools-58.1.0:
      Successfully uninstalled setuptools-58.1.0
  Attempting uninstall: pip
    Found existing installation: pip 22.0.4
    Uninstalling pip-22.0.4:
      Successfully uninstalled pip-22.0.4
Successfully installed pip-22.2.2 setuptools-64.0.3 wheel-0.37.1
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple/
Collecting homeassistant
  Downloading https://www.piwheels.org/simple/homeassistant/homeassistant-2022.8.4-py3-none-any.whl (18.5 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 18.5/18.5 MB 2.4 MB/s eta 0:00:00
Collecting bcrypt==3.1.7
  Downloading https://www.piwheels.org/simple/bcrypt/bcrypt-3.1.7-cp39-cp39-linux_armv7l.whl (53 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 53.3/53.3 kB 167.1 kB/s eta 0:00:00
Collecting cryptography==36.0.2
  Downloading https://www.piwheels.org/simple/cryptography/cryptography-36.0.2-cp39-cp39-linux_armv7l.whl (2.7 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.7/2.7 MB 1.3 MB/s eta 0:00:00
Collecting aiohttp==3.8.1
  Downloading https://www.piwheels.org/simple/aiohttp/aiohttp-3.8.1-cp39-cp39-linux_armv7l.whl (1.1 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.1/1.1 MB 639.0 kB/s eta 0:00:00
Collecting certifi>=2021.5.30
  Downloading https://www.piwheels.org/simple/certifi/certifi-2022.6.15-py3-none-any.whl (160 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 160.2/160.2 kB 617.7 kB/s eta 0:00:00
Collecting attrs==21.2.0
  Downloading https://www.piwheels.org/simple/attrs/attrs-21.2.0-py2.py3-none-any.whl (53 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 53.7/53.7 kB 5.2 MB/s eta 0:00:00
Collecting voluptuous-serialize==2.5.0
  Downloading https://www.piwheels.org/simple/voluptuous-serialize/voluptuous_serialize-2.5.0-py3-none-any.whl (3.4 kB)
Collecting yarl==1.7.2
  Downloading https://www.piwheels.org/simple/yarl/yarl-1.7.2-cp39-cp39-linux_armv7l.whl (264 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 264.8/264.8 kB 338.5 kB/s eta 0:00:00
Collecting atomicwrites-homeassistant==1.4.1
  Downloading https://www.piwheels.org/simple/atomicwrites-homeassistant/atomicwrites_homeassistant-1.4.1-py2.py3-none-any.whl (7.1 kB)
Collecting voluptuous==0.13.1
  Downloading https://www.piwheels.org/simple/voluptuous/voluptuous-0.13.1-py3-none-any.whl (35 kB)
Collecting orjson==3.7.8
  Downloading orjson-3.7.8-cp39-cp39-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (277 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 277.0/277.0 kB 648.5 kB/s eta 0:00:00
Collecting httpx==0.23.0
  Downloading https://www.piwheels.org/simple/httpx/httpx-0.23.0-py3-none-any.whl (84 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 84.8/84.8 kB 293.1 kB/s eta 0:00:00
Collecting jinja2==3.1.2
  Downloading https://www.piwheels.org/simple/jinja2/Jinja2-3.1.2-py3-none-any.whl (133 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 133.1/133.1 kB 252.9 kB/s eta 0:00:00
Collecting async-timeout==4.0.2
  Downloading https://www.piwheels.org/simple/async-timeout/async_timeout-4.0.2-py3-none-any.whl (5.8 kB)
Collecting lru-dict==1.1.8
  Downloading https://www.piwheels.org/simple/lru-dict/lru_dict-1.1.8-cp39-cp39-linux_armv7l.whl (24 kB)
Collecting astral==2.2
  Downloading https://www.piwheels.org/simple/astral/astral-2.2-py2.py3-none-any.whl (30 kB)
Collecting typing-extensions<5.0,>=3.10.0.2
  Downloading https://www.piwheels.org/simple/typing-extensions/typing_extensions-4.3.0-py3-none-any.whl (25 kB)
Collecting ifaddr==0.1.7
  Downloading https://www.piwheels.org/simple/ifaddr/ifaddr-0.1.7-py2.py3-none-any.whl (10 kB)
Collecting ciso8601==2.2.0
  Downloading https://www.piwheels.org/simple/ciso8601/ciso8601-2.2.0-cp39-cp39-linux_armv7l.whl (29 kB)
Collecting home-assistant-bluetooth==1.3.0
  Downloading https://www.piwheels.org/simple/home-assistant-bluetooth/home_assistant_bluetooth-1.3.0-py3-none-any.whl (8.8 kB)
Collecting python-slugify==4.0.1
  Downloading https://www.piwheels.org/simple/python-slugify/python_slugify-4.0.1-py2.py3-none-any.whl (7.0 kB)
Collecting pyyaml==6.0
  Downloading https://www.piwheels.org/simple/pyyaml/PyYAML-6.0-cp39-cp39-linux_armv7l.whl (45 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 45.3/45.3 kB 145.4 kB/s eta 0:00:00
Collecting awesomeversion==22.6.0
  Downloading awesomeversion-22.6.0-py3-none-any.whl (11 kB)
Requirement already satisfied: pip<22.3,>=21.0 in ./.pyenv/versions/3.9.13/lib/python3.9/site-packages (from homeassistant) (22.2.2)
Collecting PyJWT==2.4.0
  Downloading https://www.piwheels.org/simple/pyjwt/PyJWT-2.4.0-py3-none-any.whl (18 kB)
Collecting requests==2.28.1
  Downloading https://www.piwheels.org/simple/requests/requests-2.28.1-py3-none-any.whl (62 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 62.8/62.8 kB 214.1 kB/s eta 0:00:00
Collecting frozenlist>=1.1.1
  Downloading https://www.piwheels.org/simple/frozenlist/frozenlist-1.3.1-cp39-cp39-linux_armv7l.whl (136 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 136.6/136.6 kB 257.4 kB/s eta 0:00:00
Collecting multidict<7.0,>=4.5
  Downloading https://www.piwheels.org/simple/multidict/multidict-6.0.2-cp39-cp39-linux_armv7l.whl (109 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 109.1/109.1 kB 205.2 kB/s eta 0:00:00
Collecting aiosignal>=1.1.2
  Downloading https://www.piwheels.org/simple/aiosignal/aiosignal-1.2.0-py3-none-any.whl (8.2 kB)
Collecting charset-normalizer<3.0,>=2.0
  Downloading https://www.piwheels.org/simple/charset-normalizer/charset_normalizer-2.1.0-py3-none-any.whl (39 kB)
Collecting pytz
  Downloading https://www.piwheels.org/simple/pytz/pytz-2022.2.1-py3-none-any.whl (500 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 500.6/500.6 kB 501.2 kB/s eta 0:00:00
Collecting six>=1.4.1
  Downloading https://www.piwheels.org/simple/six/six-1.16.0-py2.py3-none-any.whl (11 kB)
Collecting cffi>=1.1
  Downloading https://www.piwheels.org/simple/cffi/cffi-1.15.1-cp39-cp39-linux_armv7l.whl (364 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 364.7/364.7 kB 461.3 kB/s eta 0:00:00
Collecting bleak>=0.14.3
  Downloading https://www.piwheels.org/simple/bleak/bleak-0.15.1-py2.py3-none-any.whl (123 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 124.0/124.0 kB 238.1 kB/s eta 0:00:00
Collecting httpcore<0.16.0,>=0.15.0
  Downloading https://www.piwheels.org/simple/httpcore/httpcore-0.15.0-py3-none-any.whl (68 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 68.5/68.5 kB 122.8 kB/s eta 0:00:00
Collecting sniffio
  Downloading https://www.piwheels.org/simple/sniffio/sniffio-1.2.0-py3-none-any.whl (10 kB)
Collecting rfc3986[idna2008]<2,>=1.3
  Downloading https://www.piwheels.org/simple/rfc3986/rfc3986-1.5.0-py2.py3-none-any.whl (31 kB)
Collecting MarkupSafe>=2.0
  Downloading https://www.piwheels.org/simple/markupsafe/MarkupSafe-2.1.1-cp39-cp39-linux_armv7l.whl (23 kB)
Collecting text-unidecode>=1.3
  Downloading https://www.piwheels.org/simple/text-unidecode/text_unidecode-1.3-py2.py3-none-any.whl (78 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 78.2/78.2 kB 141.2 kB/s eta 0:00:00
Collecting idna<4,>=2.5
  Downloading https://www.piwheels.org/simple/idna/idna-3.3-py3-none-any.whl (64 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 64.5/64.5 kB 228.9 kB/s eta 0:00:00
Collecting urllib3<1.27,>=1.21.1
  Downloading https://www.piwheels.org/simple/urllib3/urllib3-1.26.11-py2.py3-none-any.whl (139 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 139.9/139.9 kB 253.9 kB/s eta 0:00:00
Collecting dbus-next
  Downloading https://www.piwheels.org/simple/dbus-next/dbus_next-0.2.3-py3-none-any.whl (57 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 57.9/57.9 kB 198.1 kB/s eta 0:00:00
Collecting pycparser
  Downloading https://www.piwheels.org/simple/pycparser/pycparser-2.21-py2.py3-none-any.whl (119 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 119.7/119.7 kB 425.1 kB/s eta 0:00:00
Collecting anyio==3.*
  Downloading https://www.piwheels.org/simple/anyio/anyio-3.6.1-py3-none-any.whl (80 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 80.6/80.6 kB 149.1 kB/s eta 0:00:00
Collecting h11<0.13,>=0.11
  Downloading https://www.piwheels.org/simple/h11/h11-0.12.0-py3-none-any.whl (54 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 54.9/54.9 kB 196.9 kB/s eta 0:00:00
Installing collected packages: voluptuous, text-unidecode, rfc3986, pytz, lru-dict, ifaddr, ciso8601, voluptuous-serialize, urllib3, typing-extensions, sniffio, six, pyyaml, python-slugify, PyJWT, pycparser, orjson, multidict, MarkupSafe, idna, h11, frozenlist, dbus-next, charset-normalizer, certifi, awesomeversion, attrs, atomicwrites-homeassistant, async-timeout, astral, yarl, requests, jinja2, cffi, bleak, anyio, aiosignal, httpcore, home-assistant-bluetooth, cryptography, bcrypt, aiohttp, httpx, homeassistant
Successfully installed MarkupSafe-2.1.1 PyJWT-2.4.0 aiohttp-3.8.1 aiosignal-1.2.0 anyio-3.6.1 astral-2.2 async-timeout-4.0.2 atomicwrites-homeassistant-1.4.1 attrs-21.2.0 awesomeversion-22.6.0 bcrypt-3.1.7 bleak-0.15.1 certifi-2022.6.15 cffi-1.15.1 charset-normalizer-2.1.0 ciso8601-2.2.0 cryptography-36.0.2 dbus-next-0.2.3 frozenlist-1.3.1 h11-0.12.0 home-assistant-bluetooth-1.3.0 homeassistant-2022.8.4 httpcore-0.15.0 httpx-0.23.0 idna-3.3 ifaddr-0.1.7 jinja2-3.1.2 lru-dict-1.1.8 multidict-6.0.2 orjson-3.7.8 pycparser-2.21 python-slugify-4.0.1 pytz-2022.2.1 pyyaml-6.0 requests-2.28.1 rfc3986-1.5.0 six-1.16.0 sniffio-1.2.0 text-unidecode-1.3 typing-extensions-4.3.0 urllib3-1.26.11 voluptuous-0.13.1 voluptuous-serialize-2.5.0 yarl-1.7.2
[  OK  ] DietPi-Software | Installing Python with Home Assistant module into pyenv
[  OK  ] DietPi-Software | chmod +x /home/homeassistant/homeassistant-start.sh
[  OK  ] DietPi-Software | chmod +x /home/homeassistant/homeassistant-update.sh
[  OK  ] DietPi-Software | rm -Rf /home/homeassistant/.homeassistant
[  OK  ] DietPi-Software | ln -s /mnt/dietpi_userdata/homeassistant /home/homeassistant/.homeassistant
[  OK  ] DietPi-Software | chown -R homeassistant:homeassistant /mnt/dietpi_userdata/homeassistant

 DietPi-Software
─────────────────────────────────────────────────────
 Step: Finalising install

[  OK  ] DietPi-Software | systemctl daemon-reload
2022-08-13 13:00:41 [ INFO ] DietPi-RAMlog | Storing /var/log to /var/tmp/dietpi/logs/dietpi-ramlog_store...
2022-08-13 13:00:41 [  OK  ] DietPi-RAMlog | Stored /var/log to /var/tmp/dietpi/logs/dietpi-ramlog_store.
[ SUB1 ] DietPi-Services > dietpi_controlled 
[  OK  ] DietPi-Services | dietpi_controlled : avahi-daemon
[  OK  ] DietPi-Services | dietpi_controlled : proftpd
[  OK  ] DietPi-Services | dietpi_controlled : transmission-daemon
[  OK  ] DietPi-Services | dietpi_controlled : cups
[  OK  ] DietPi-Services | dietpi_controlled : home-assistant
[  OK  ] DietPi-Services | dietpi_controlled : cron

 DietPi-Software
─────────────────────────────────────────────────────
 Step: Install completed

[  OK  ] DietPi-Survey | Sending survey data
[ SUB1 ] DietPi-Services > restart 
[  OK  ] DietPi-Services | restart : avahi-daemon
[  OK  ] DietPi-Services | restart : proftpd
[  OK  ] DietPi-Services | restart : transmission-daemon
[  OK  ] DietPi-Services | restart : cups
[  OK  ] DietPi-Services | restart : home-assistant
[  OK  ] DietPi-Services | restart : cron

After the install, the first run complains of missing sqlalchemy. It is installed and appears to be a common issue. Subsequent runs should work fine. But they don’t here…

dietpi@DietPi:~$ sudo systemctl status home-assistant.service
● home-assistant.service - Home Assistant (DietPi)
     Loaded: loaded (/etc/systemd/system/home-assistant.service; disabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Sat 2022-08-13 13:01:21 -03; 1min 10s ago
    Process: 2096 ExecStart=/home/homeassistant/homeassistant-start.sh (code=exited, status=1/FAILURE)
   Main PID: 2096 (code=exited, status=1/FAILURE)
        CPU: 10.104s

Aug 13 13:01:20 DietPi Home Assistant[2096]:   File "/home/homeassistant/.pyenv/versions/3.9.13/lib/python3.9/site-packages/homeassistant/helpers/recorder.py", line 22, in async_initialize_recorder
Aug 13 13:01:20 DietPi Home Assistant[2096]:     from homeassistant.components.recorder import const, models
Aug 13 13:01:20 DietPi Home Assistant[2096]:   File "/home/homeassistant/.pyenv/versions/3.9.13/lib/python3.9/site-packages/homeassistant/components/recorder/__init__.py", line 23, in <module>
Aug 13 13:01:20 DietPi Home Assistant[2096]:     from . import statistics, websocket_api
Aug 13 13:01:20 DietPi Home Assistant[2096]:   File "/home/homeassistant/.pyenv/versions/3.9.13/lib/python3.9/site-packages/homeassistant/components/recorder/statistics.py", line 17, in <module>
Aug 13 13:01:20 DietPi Home Assistant[2096]:     from sqlalchemy import bindparam, func, lambda_stmt, select
Aug 13 13:01:20 DietPi Home Assistant[2096]: ModuleNotFoundError: No module named 'sqlalchemy'
Aug 13 13:01:21 DietPi systemd[1]: home-assistant.service: Main process exited, code=exited, status=1/FAILURE
Aug 13 13:01:21 DietPi systemd[1]: home-assistant.service: Failed with result 'exit-code'.
Aug 13 13:01:21 DietPi systemd[1]: home-assistant.service: Consumed 10.104s CPU time.
dietpi@DietPi:~$ sudo systemctl restart home-assistant.service
dietpi@DietPi:~$ sudo systemctl status home-assistant.service
● home-assistant.service - Home Assistant (DietPi)
     Loaded: loaded (/etc/systemd/system/home-assistant.service; disabled; vendor preset: enabled)
     Active: active (running) since Sat 2022-08-13 13:02:41 -03; 1s ago
   Main PID: 2317 (bash)
      Tasks: 2 (limit: 2179)
        CPU: 1.820s
     CGroup: /system.slice/home-assistant.service
             ├─2317 bash /home/homeassistant/.pyenv/libexec/pyenv-exec hass -c /mnt/dietpi_userdata/homeassistant
             └─2503 bash /home/homeassistant/.pyenv/libexec/pyenv-hooks exec

Aug 13 13:02:41 DietPi systemd[1]: Started Home Assistant (DietPi).
dietpi@DietPi:~$ sudo systemctl status home-assistant.service
● home-assistant.service - Home Assistant (DietPi)
     Loaded: loaded (/etc/systemd/system/home-assistant.service; disabled; vendor preset: enabled)
     Active: active (running) since Sat 2022-08-13 13:02:41 -03; 3s ago
   Main PID: 2317 (hass)
      Tasks: 1 (limit: 2179)
        CPU: 3.761s
     CGroup: /system.slice/home-assistant.service
             └─2317 /home/homeassistant/.pyenv/versions/3.9.13/bin/python3.9 /home/homeassistant/.pyenv/versions/3.9.13/bin/hass -c /mnt/dietpi_userdata/homeassistant

Aug 13 13:02:41 DietPi systemd[1]: Started Home Assistant (DietPi).
dietpi@DietPi:~$ sudo systemctl status home-assistant.service
● home-assistant.service - Home Assistant (DietPi)
     Loaded: loaded (/etc/systemd/system/home-assistant.service; disabled; vendor preset: enabled)
     Active: active (running) since Sat 2022-08-13 13:02:41 -03; 5s ago
   Main PID: 2317 (hass)
      Tasks: 1 (limit: 2179)
        CPU: 5.899s
     CGroup: /system.slice/home-assistant.service
             └─2317 /home/homeassistant/.pyenv/versions/3.9.13/bin/python3.9 /home/homeassistant/.pyenv/versions/3.9.13/bin/hass -c /mnt/dietpi_userdata/homeassistant

Aug 13 13:02:41 DietPi systemd[1]: Started Home Assistant (DietPi).
dietpi@DietPi:~$ sudo systemctl status home-assistant.service
● home-assistant.service - Home Assistant (DietPi)
     Loaded: loaded (/etc/systemd/system/home-assistant.service; disabled; vendor preset: enabled)
     Active: active (running) since Sat 2022-08-13 13:02:41 -03; 7s ago
   Main PID: 2317 (hass)
      Tasks: 2 (limit: 2179)
        CPU: 7.440s
     CGroup: /system.slice/home-assistant.service
             └─2317 /home/homeassistant/.pyenv/versions/3.9.13/bin/python3.9 /home/homeassistant/.pyenv/versions/3.9.13/bin/hass -c /mnt/dietpi_userdata/homeassistant

Aug 13 13:02:41 DietPi systemd[1]: Started Home Assistant (DietPi).
dietpi@DietPi:~$ sudo systemctl status home-assistant.service
● home-assistant.service - Home Assistant (DietPi)
     Loaded: loaded (/etc/systemd/system/home-assistant.service; disabled; vendor preset: enabled)
     Active: active (running) since Sat 2022-08-13 13:02:41 -03; 8s ago
   Main PID: 2317 (hass)
      Tasks: 1 (limit: 2179)
        CPU: 8.360s
     CGroup: /system.slice/home-assistant.service
             └─2317 /home/homeassistant/.pyenv/versions/3.9.13/bin/python3.9 /home/homeassistant/.pyenv/versions/3.9.13/bin/hass -c /mnt/dietpi_userdata/homeassistant

Aug 13 13:02:41 DietPi systemd[1]: Started Home Assistant (DietPi).
dietpi@DietPi:~$ sudo systemctl status home-assistant.service
● home-assistant.service - Home Assistant (DietPi)
     Loaded: loaded (/etc/systemd/system/home-assistant.service; disabled; vendor preset: enabled)
     Active: active (running) since Sat 2022-08-13 13:02:41 -03; 9s ago
   Main PID: 2317 (hass)
      Tasks: 4 (limit: 2179)
        CPU: 9.288s
     CGroup: /system.slice/home-assistant.service
             └─2317 /home/homeassistant/.pyenv/versions/3.9.13/bin/python3.9 /home/homeassistant/.pyenv/versions/3.9.13/bin/hass -c /mnt/dietpi_userdata/homeassistant

Aug 13 13:02:41 DietPi systemd[1]: Started Home Assistant (DietPi).
dietpi@DietPi:~$ sudo systemctl status home-assistant.service
● home-assistant.service - Home Assistant (DietPi)
     Loaded: loaded (/etc/systemd/system/home-assistant.service; disabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Sat 2022-08-13 13:02:51 -03; 1s ago
    Process: 2317 ExecStart=/home/homeassistant/homeassistant-start.sh (code=exited, status=1/FAILURE)
   Main PID: 2317 (code=exited, status=1/FAILURE)
        CPU: 10.412s

Aug 13 13:02:41 DietPi systemd[1]: Started Home Assistant (DietPi).
Aug 13 13:02:51 DietPi systemd[1]: home-assistant.service: Main process exited, code=exited, status=1/FAILURE
Aug 13 13:02:51 DietPi systemd[1]: home-assistant.service: Failed with result 'exit-code'.
Aug 13 13:02:51 DietPi systemd[1]: home-assistant.service: Consumed 10.412s CPU time.

Can you restart your system and wait for 10-20 minutes. Afterwads share following

journalctl -u home-assistant

Here is the output:

dietpi@DietPi:~$ uptime
 18:42:33 up 29 min,  1 user,  load average: 0.00, 0.00, 0.00
dietpi@DietPi:~$ sudo journalctl -u home-assistant
-- Journal begins at Sat 2022-08-13 18:12:39 -03, ends at Sat 2022-08-13 18:42:52 -03. --
Aug 13 18:12:48 DietPi systemd[1]: Started Home Assistant (DietPi).
Aug 13 18:13:00 DietPi Home Assistant[511]: 2022-08-13 18:13:00.277 ERROR (MainThread) [root] Uncaught exception
Aug 13 18:13:00 DietPi Home Assistant[511]: Traceback (most recent call last):
Aug 13 18:13:00 DietPi Home Assistant[511]:   File "/home/homeassistant/.pyenv/versions/3.9.13/bin/hass", line 8, in <module>
Aug 13 18:13:00 DietPi Home Assistant[511]:     sys.exit(main())
Aug 13 18:13:00 DietPi Home Assistant[511]:   File "/home/homeassistant/.pyenv/versions/3.9.13/lib/python3.9/site-packages/homeassistant/__main__.py", line 191, in main
Aug 13 18:13:00 DietPi Home Assistant[511]:     exit_code = runner.run(runtime_conf)
Aug 13 18:13:00 DietPi Home Assistant[511]:   File "/home/homeassistant/.pyenv/versions/3.9.13/lib/python3.9/site-packages/homeassistant/runner.py", line 119, in run
Aug 13 18:13:00 DietPi Home Assistant[511]:     return loop.run_until_complete(setup_and_run_hass(runtime_config))
Aug 13 18:13:00 DietPi Home Assistant[511]:   File "/home/homeassistant/.pyenv/versions/3.9.13/lib/python3.9/asyncio/base_events.py", line 647, in run_until_complete
Aug 13 18:13:00 DietPi Home Assistant[511]:     return future.result()
Aug 13 18:13:00 DietPi Home Assistant[511]:   File "/home/homeassistant/.pyenv/versions/3.9.13/lib/python3.9/site-packages/homeassistant/runner.py", line 101, in setup_and_run_hass
Aug 13 18:13:00 DietPi Home Assistant[511]:     hass = await bootstrap.async_setup_hass(runtime_config)
Aug 13 18:13:00 DietPi Home Assistant[511]:   File "/home/homeassistant/.pyenv/versions/3.9.13/lib/python3.9/site-packages/homeassistant/bootstrap.py", line 143, in async_setup_hass
Aug 13 18:13:00 DietPi Home Assistant[511]:     await async_from_config_dict(config_dict, hass) is not None
Aug 13 18:13:00 DietPi Home Assistant[511]:   File "/home/homeassistant/.pyenv/versions/3.9.13/lib/python3.9/site-packages/homeassistant/bootstrap.py", line 256, in async_from_config_dict
Aug 13 18:13:00 DietPi Home Assistant[511]:     await _async_set_up_integrations(hass, config)
Aug 13 18:13:00 DietPi Home Assistant[511]:   File "/home/homeassistant/.pyenv/versions/3.9.13/lib/python3.9/site-packages/homeassistant/bootstrap.py", line 532, in _async_set_up_integrations
Aug 13 18:13:00 DietPi Home Assistant[511]:     recorder.async_initialize_recorder(hass)
Aug 13 18:13:00 DietPi Home Assistant[511]:   File "/home/homeassistant/.pyenv/versions/3.9.13/lib/python3.9/site-packages/homeassistant/helpers/recorder.py", line 22, in async_initialize_recorder
Aug 13 18:13:00 DietPi Home Assistant[511]:     from homeassistant.components.recorder import const, models
Aug 13 18:13:00 DietPi Home Assistant[511]:   File "/home/homeassistant/.pyenv/versions/3.9.13/lib/python3.9/site-packages/homeassistant/components/recorder/__init__.py", line 23, in <module>
Aug 13 18:13:00 DietPi Home Assistant[511]:     from . import statistics, websocket_api
Aug 13 18:13:00 DietPi Home Assistant[511]:   File "/home/homeassistant/.pyenv/versions/3.9.13/lib/python3.9/site-packages/homeassistant/components/recorder/statistics.py", line 17, in <module>
Aug 13 18:13:00 DietPi Home Assistant[511]:     from sqlalchemy import bindparam, func, lambda_stmt, select
Aug 13 18:13:00 DietPi Home Assistant[511]: ModuleNotFoundError: No module named 'sqlalchemy'
Aug 13 18:13:00 DietPi systemd[1]: home-assistant.service: Main process exited, code=exited, status=1/FAILURE
Aug 13 18:13:00 DietPi systemd[1]: home-assistant.service: Failed with result 'exit-code'.
Aug 13 18:13:00 DietPi systemd[1]: home-assistant.service: Consumed 10.501s CPU time.

It still complains about sqlalchemy, but AFAIK it is installed:

homeassistant@DietPi:/home/dietpi$ pip3 install sqlalchemy
Defaulting to user installation because normal site-packages is not writeable
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple/
Requirement already satisfied: sqlalchemy in /usr/local/lib/python3.9/dist-packages (1.4.40)

did you tried following already?

sudo -u homeassistant bash
. /home/homeassistant/pyenv-activate.sh
pip3 install sqlalchemy
1 Like

I think you got it! :slight_smile:
The key I was missing was to run the pyenv script. I also had to install fnvhash, but it seems to be progressing.

Does your HA instance is running now?

Reported multiple times upstream, e.g.: Home Assistant crashes at startup (sqlalchemy maybe the cause) · Issue #76296 · home-assistant/core · GitHub

Ah here a solution is discussed/being worked on: Add sqlalchemy and fnvhash to requirements by furlongm · Pull Request #76597 · home-assistant/core · GitHub

1 Like

Yes. Sorry, I couldn’t work on it for the last couple of days.

Your suggestion worked. Thanks!

Is this a bug of installer script? It probably should install sqlalchemy and fnvhash. If so, is there anywhere I could report it=

@MichaIng already linked two issues at HA GitHub. Probably you could connect to them.