You are not logged in.

#1 2025-01-10 15:42:29

cdwijs
Member
Registered: 2010-04-24
Posts: 292

SOLVED home-assistant restarting: /var/lib/hass/.venv/bin/hass':

I've installed home assistant on a system that's just updated (and rebooted after the update). Home assistant keeps restarting with this error:

Jan 10 16:07:52 craptop systemd[1]: Started Home assistant.
Jan 10 16:07:52 craptop (hass)[15570]: home-assistant.service: Unable to locate executable '/var/lib/hass/.venv/bin/hass': Permission denied
Jan 10 16:07:52 craptop (hass)[15570]: home-assistant.service: Failed at step EXEC spawning /var/lib/hass/.venv/bin/hass: Permission denied
Jan 10 16:07:52 craptop systemd[1]: home-assistant.service: Main process exited, code=exited, status=203/EXEC
 

/var/lib/hass/.venv/bin/hass does exist, and is owned by nobody. After a Chmod to 777, the error doesn't change:

# ls -la /var/lib/hass/.venv/bin/
total 34212
drwxr-xr-x 1 nobody nobody      192 Jan 10 14:55 .
drwxr-xr-x 1 nobody nobody       76 Jan 10 14:53 ..
-rwxr-xr-x 1 nobody nobody      221 Jan 10 14:54 envs
-rwxrwxrwx 1 nobody nobody      235 Jan 10 14:55 hass
-rwxr-xr-x 1 nobody nobody      218 Jan 10 14:54 httpx
-rwxr-xr-x 1 nobody nobody     1709 Jan 10 14:54 jp.py
-rwxr-xr-x 1 nobody nobody      225 Jan 10 14:54 jws
-rwxr-xr-x 1 nobody nobody      240 Jan 10 14:54 normalizer
-rwxr-xr-x 1 nobody nobody      235 Jan 10 14:53 pip
-rwxr-xr-x 1 nobody nobody      235 Jan 10 14:53 pip3
-rwxr-xr-x 1 nobody nobody      235 Jan 10 14:53 pip3.13
drwxr-xr-x 1 nobody nobody       36 Jan 10 14:54 __pycache__
lrwxrwxrwx 1 nobody nobody       15 Jan 10 14:53 python -> /usr/bin/python
lrwxrwxrwx 1 nobody nobody        6 Jan 10 14:53 python3 -> python
lrwxrwxrwx 1 nobody nobody        6 Jan 10 14:53 python3.13 -> python
-rwxr-xr-x 1 nobody nobody      229 Jan 10 14:54 slugify
-rwxr-xr-x 1 nobody nobody 34608320 Jan 10 14:54 uv
-rwxr-xr-x 1 nobody nobody   362872 Jan 10 14:54 uvx
-rwxr-xr-x 1 nobody nobody      222 Jan 10 14:53 wheel

Terminals output:

 
# pacman -S  home-assistant 
resolving dependencies...
looking for conflicting packages...

Packages (3) blas-3.12.0-5  lapack-3.12.0-5  home-assistant-1:2024.12.5-1

Total Download Size:   15.53 MiB
Total Installed Size:  22.71 MiB

:: Proceed with installation? [Y/n] 
:: Retrieving packages...
 home-assistant-1...    12.7 MiB  4.58 MiB/s 00:03 [######################] 100%
 lapack-3.12.0-5-...     2.6 MiB  7.78 MiB/s 00:00 [######################] 100%
 blas-3.12.0-5-x86_64  230.1 KiB  4.78 MiB/s 00:00 [######################] 100%
 Total (3/3)            15.5 MiB  4.84 MiB/s 00:03 [######################] 100%
(3/3) checking keys in keyring                     [######################] 100%
(3/3) checking package integrity                   [######################] 100%
(3/3) loading package files                        [######################] 100%
(3/3) checking for file conflicts                  [######################] 100%
(3/3) checking available disk space                [######################] 100%
:: Processing package changes...
(1/3) installing blas                              [######################] 100%
(2/3) installing lapack                            [######################] 100%
(3/3) installing home-assistant                    [######################] 100%
:: Running post-transaction hooks...
(1/2) Reloading system manager configuration...
(2/2) Arming ConditionNeedsUpdate...
[root@craptop cedric]# systemctl start home-assistant
# journalctl -fu home-assistant
Jan 10 16:07:45 craptop systemd[1]: Starting Home assistant...
Jan 10 16:07:49 craptop python[15553]: Requirement already satisfied: wheel in /var/lib/hass/.venv/lib/python3.13/site-packages (0.45.1)
Jan 10 16:07:50 craptop python[15562]: Processing /usr/share/home-assistant/homeassistant-2024.12.5-py3-none-any.whl
Jan 10 16:07:50 craptop python[15562]: Requirement already satisfied: aiodns==3.2.0 in /var/lib/hass/.venv/lib/python3.13/site-packages (from homeassistant==2024.12.5) (3.2.0)
Jan 10 16:07:50 craptop python[15562]: Requirement already satisfied: aiohasupervisor==0.2.1 in /var/lib/hass/.venv/lib/python3.13/site-packages (from homeassistant==2024.12.5) (0.2.1)
Jan 10 16:07:50 craptop python[15562]: Requirement already satisfied: aiohttp==3.11.11 in /var/lib/hass/.venv/lib/python3.13/site-packages (from homeassistant==2024.12.5) (3.11.11)
<snip>
Jan 10 16:07:51 craptop python[15562]: Requirement already satisfied: uart-devices>=0.1.0 in /var/lib/hass/.venv/lib/python3.13/site-packages (from bluetooth-adapters>=0.16.1->habluetooth>=3.0->home-assistant-bluetooth==1.13.0->homeassistant==2024.12.5) (0.1.0)
Jan 10 16:07:51 craptop python[15562]: Requirement already satisfied: usb-devices>=0.4.5 in /var/lib/hass/.venv/lib/python3.13/site-packages (from bluetooth-adapters>=0.16.1->habluetooth>=3.0->home-assistant-bluetooth==1.13.0->homeassistant==2024.12.5) (0.4.5)
Jan 10 16:07:51 craptop python[15562]: Requirement already satisfied: PyRIC>=0.1.6.3 in /var/lib/hass/.venv/lib/python3.13/site-packages (from bluetooth-auto-recovery>=1.2.3->habluetooth>=3.0->home-assistant-bluetooth==1.13.0->homeassistant==2024.12.5) (0.1.6.3)
Jan 10 16:07:51 craptop python[15562]: Requirement already satisfied: btsocket>=0.2.0 in /var/lib/hass/.venv/lib/python3.13/site-packages (from bluetooth-auto-recovery>=1.2.3->habluetooth>=3.0->home-assistant-bluetooth==1.13.0->homeassistant==2024.12.5) (0.3.0)
Jan 10 16:07:51 craptop python[15562]: Requirement already satisfied: botocore<1.36.0,>=1.35.96 in /var/lib/hass/.venv/lib/python3.13/site-packages (from boto3>=1.10.49->pycognito==2024.5.1->hass-nabucasa==0.86.0->homeassistant==2024.12.5) (1.35.96)
Jan 10 16:07:51 craptop python[15562]: Requirement already satisfied: jmespath<2.0.0,>=0.7.1 in /var/lib/hass/.venv/lib/python3.13/site-packages (from boto3>=1.10.49->pycognito==2024.5.1->hass-nabucasa==0.86.0->homeassistant==2024.12.5) (1.0.1)
Jan 10 16:07:51 craptop python[15562]: Requirement already satisfied: s3transfer<0.11.0,>=0.10.0 in /var/lib/hass/.venv/lib/python3.13/site-packages (from boto3>=1.10.49->pycognito==2024.5.1->hass-nabucasa==0.86.0->homeassistant==2024.12.5) (0.10.4)
Jan 10 16:07:51 craptop python[15562]: Requirement already satisfied: python-dateutil<3.0.0,>=2.1 in /var/lib/hass/.venv/lib/python3.13/site-packages (from botocore<1.36.0,>=1.35.96->boto3>=1.10.49->pycognito==2024.5.1->hass-nabucasa==0.86.0->homeassistant==2024.12.5) (2.9.0.post0)
Jan 10 16:07:51 craptop python[15562]: Requirement already satisfied: six>=1.5 in /var/lib/hass/.venv/lib/python3.13/site-packages (from python-dateutil<3.0.0,>=2.1->botocore<1.36.0,>=1.35.96->boto3>=1.10.49->pycognito==2024.5.1->hass-nabucasa==0.86.0->homeassistant==2024.12.5) (1.17.0)
Jan 10 16:07:51 craptop python[15562]: homeassistant is already installed with the same version as the provided wheel. Use --force-reinstall to force an installation of the wheel.
Jan 10 16:07:52 craptop systemd[1]: Started Home assistant.
Jan 10 16:07:52 craptop (hass)[15570]: home-assistant.service: Unable to locate executable '/var/lib/hass/.venv/bin/hass': Permission denied
Jan 10 16:07:52 craptop (hass)[15570]: home-assistant.service: Failed at step EXEC spawning /var/lib/hass/.venv/bin/hass: Permission denied
Jan 10 16:07:52 craptop systemd[1]: home-assistant.service: Main process exited, code=exited, status=203/EXEC

Versions:

 
# uname -a
Linux craptop 6.12.8-arch1-1 #1 SMP PREEMPT_DYNAMIC Thu, 02 Jan 2025 22:52:26 +0000 x86_64 GNU/Linux
# pacman -Q home-assistant
home-assistant 1:2024.12.5-1

Last edited by cdwijs (2025-01-12 14:48:36)

Offline

#2 2025-01-12 02:15:31

mshelby
Member
From: Jackson, MS USA
Registered: 2025-01-12
Posts: 1

Re: SOLVED home-assistant restarting: /var/lib/hass/.venv/bin/hass':

Can confirm. Having exact same problem.

Offline

#3 2025-01-12 05:43:04

-thc
Member
Registered: 2017-03-15
Posts: 769

Re: SOLVED home-assistant restarting: /var/lib/hass/.venv/bin/hass':

Did you look at the Arch Wiki?

Offline

#4 2025-01-12 13:23:46

cdwijs
Member
Registered: 2010-04-24
Posts: 292

Re: SOLVED home-assistant restarting: /var/lib/hass/.venv/bin/hass':

-thc wrote:

Did you look at the Arch Wiki?

Thank you. Unfortunately, these steps didn't work on my machine. Here are the commands on terminal 1:

[root@craptop cedric]# useradd -U -r -s /usr/bin/nologin hass
[root@craptop cedric]#  rm -r /var/lib/hass/ /var/lib/private/hass
rm: cannot remove '/var/lib/hass/': Not a directory
[root@craptop cedric]#  rm -r /var/lib/hass/ /var/lib/private/hass
rm: cannot remove '/var/lib/hass/': Not a directory
rm: cannot remove '/var/lib/private/hass': No such file or directory
[root@craptop cedric]# systemctl start hoime-assistant
Failed to start hoime-assistant.service: Unit hoime-assistant.service not found.
[root@craptop cedric]# systemctl start home-assistant
[root@craptop cedric]# systemctl stop home-assistant
[root@craptop cedric]# 
[root@craptop cedric]# 
[root@craptop cedric]# rm -r /var/lib/hass/ /var/lib/private/hass
rm: cannot remove '/var/lib/hass/': Not a directory
[root@craptop cedric]# systemctl start home-assistant
[root@craptop cedric]# systemctl stop home-assistant

And the error on terminal 2:

Jan 12 14:17:54 craptop python[1949]: Requirement already satisfied: botocore<1.36.0,>=1.35.97 in /var/lib/hass/.venv/lib/python3.13/site-packages (from boto3>=1.10.49->pycognito==2024.5.1->hass-nabucasa==0.86.0->homeassistant==2024.12.5) (1.35.97)
Jan 12 14:17:54 craptop python[1949]: Requirement already satisfied: jmespath<2.0.0,>=0.7.1 in /var/lib/hass/.venv/lib/python3.13/site-packages (from boto3>=1.10.49->pycognito==2024.5.1->hass-nabucasa==0.86.0->homeassistant==2024.12.5) (1.0.1)
Jan 12 14:17:54 craptop python[1949]: Requirement already satisfied: s3transfer<0.11.0,>=0.10.0 in /var/lib/hass/.venv/lib/python3.13/site-packages (from boto3>=1.10.49->pycognito==2024.5.1->hass-nabucasa==0.86.0->homeassistant==2024.12.5) (0.10.4)
Jan 12 14:17:54 craptop python[1949]: Requirement already satisfied: python-dateutil<3.0.0,>=2.1 in /var/lib/hass/.venv/lib/python3.13/site-packages (from botocore<1.36.0,>=1.35.97->boto3>=1.10.49->pycognito==2024.5.1->hass-nabucasa==0.86.0->homeassistant==2024.12.5) (2.9.0.post0)
Jan 12 14:17:54 craptop python[1949]: Requirement already satisfied: six>=1.5 in /var/lib/hass/.venv/lib/python3.13/site-packages (from python-dateutil<3.0.0,>=2.1->botocore<1.36.0,>=1.35.97->boto3>=1.10.49->pycognito==2024.5.1->hass-nabucasa==0.86.0->homeassistant==2024.12.5) (1.17.0)
Jan 12 14:17:54 craptop python[1949]: homeassistant is already installed with the same version as the provided wheel. Use --force-reinstall to force an installation of the wheel.
Jan 12 14:17:54 craptop systemd[1]: Started Home assistant.
Jan 12 14:17:54 craptop (hass)[1957]: home-assistant.service: Unable to locate executable '/var/lib/hass/.venv/bin/hass': Permission denied
Jan 12 14:17:54 craptop (hass)[1957]: home-assistant.service: Failed at step EXEC spawning /var/lib/hass/.venv/bin/hass: Permission denied
Jan 12 14:17:54 craptop systemd[1]: home-assistant.service: Main process exited, code=exited, status=203/EXEC
Jan 12 14:17:54 craptop systemd[1]: home-assistant.service: Failed with result 'exit-code'.
Jan 12 14:17:54 craptop systemd[1]: home-assistant.service: Consumed 6.139s CPU time, 58.2M memory peak.

Strangely, the instructions on the arch wiki didn't result in /var/lib/hass being a directory, instead of a symlink.

[root@craptop cedric]# ls -l /var/lib/
total 12
drwxr-xr-x 1 root  root     20 Jan 20  2024 dbus
drwxr-x--- 1 root  root      0 Dec 22  2023 dhcpcd
lrwxrwxrwx 1 root  root     12 Jan 10 14:53 hass -> private/hass
drwxr-xr-x 1 root  root     16 Jan  9 23:02 krb5kdc
drwxr-xr-x 1 root  root      0 Jun  1  2024 lastlog
drwxrwsr-x 1 uuidd uuidd     0 Jun  1  2024 libuuid
drwx------ 1 lxdm  lxdm      0 Jan 20  2024 lxdm
drwx------ 1 root  root      0 Jan 20  2024 machines
drwxr-xr-x 1 root  root      0 Sep 18  2023 misc
drwxr-x--- 1 root  locate   20 Jun  9  2024 mlocate
drwx------ 1 root  root    626 Jan 12 14:03 NetworkManager
drwxr-xr-x 1 root  root      0 Sep 19  2022 os-prober
drwxr-xr-x 1 root  root     18 Jan 10 16:31 pacman
drwxr-xr-x 1 root  root     44 Jan  9 23:05 plocate
drwx------ 1 root  root      0 Jan 20  2024 portables
drwx------ 1 root  root      8 Jan 12 14:15 private
drwxr-xr-x 1 root  root     30 Jan 25  2024 samba
drwxr-xr-x 1 root  root    178 Jan  9 23:05 systemd
drwxr-xr-x 1 root  root     12 Jan 20  2024 tpm2-tss
drwxr-xr-x 1 root  root   1392 Jan 10 17:15 upower
drwxr-xr-x 1 root  root     30 Jan  9 23:04 xkb
drwxr-xr-x 1 xmms2 xmms2     0 Jan 20  2024 xmms2

This makes me wonder what commands are needed to solve this issue, so I can correct both my home assistant installation, and the arch linux wiki.

Offline

#5 2025-01-12 13:55:49

-thc
Member
Registered: 2017-03-15
Posts: 769

Re: SOLVED home-assistant restarting: /var/lib/hass/.venv/bin/hass':

What is "/var/lib/hass" ?

ls -lah /var/lib/hass

Offline

#6 2025-01-12 14:01:02

cdwijs
Member
Registered: 2010-04-24
Posts: 292

Re: SOLVED home-assistant restarting: /var/lib/hass/.venv/bin/hass':

This works:

[root@craptop ~]# systemctl stop home-assistant
[root@craptop ~]# ls -l /var/lib/
total 12
drwxr-xr-x 1 root  root     20 Jan 20  2024 dbus
drwxr-x--- 1 root  root      0 Dec 22  2023 dhcpcd
lrwxrwxrwx 1 root  root     12 Jan 12 14:34 hass -> private/hass
drwxr-xr-x 1 root  root     16 Jan  9 23:02 krb5kdc
drwxr-xr-x 1 root  root      0 Jun  1  2024 lastlog
drwxrwsr-x 1 uuidd uuidd     0 Jun  1  2024 libuuid
drwx------ 1 lxdm  lxdm      0 Jan 20  2024 lxdm
drwx------ 1 root  root      0 Jan 20  2024 machines
drwxr-xr-x 1 root  root      0 Sep 18  2023 misc
drwxr-x--- 1 root  locate   20 Jun  9  2024 mlocate
drwx------ 1 root  root    626 Jan 12 14:03 NetworkManager
drwxr-xr-x 1 root  root      0 Sep 19  2022 os-prober
drwxr-xr-x 1 root  root     18 Jan 10 16:31 pacman
drwxr-xr-x 1 root  root     44 Jan  9 23:05 plocate
drwx------ 1 root  root      0 Jan 20  2024 portables
drwx------ 1 root  root      8 Jan 12 14:34 private
drwxr-xr-x 1 root  root     30 Jan 25  2024 samba
drwxr-xr-x 1 root  root    178 Jan  9 23:05 systemd
drwxr-xr-x 1 root  root     12 Jan 20  2024 tpm2-tss
drwxr-xr-x 1 root  root   1392 Jan 10 17:15 upower
drwxr-xr-x 1 root  root     30 Jan  9 23:04 xkb
drwxr-xr-x 1 xmms2 xmms2     0 Jan 20  2024 xmms2
[root@craptop ~]# chown hass /var/lib/private/hass/
[root@craptop ~]# ls -l /var/lib/private/
total 0
drwxr-xr-x 1 hass nobody 22 Jan 12 14:34 hass
[root@craptop ~]# ls -l /var/lib/private/hass/
total 0
[root@craptop ~]# systemctl start home-assistant

home assistant now starts:

an 12 14:39:22 craptop python[2455]: Requirement already satisfied: six>=1.5 in /var/lib/hass/.venv/lib/python3.13/site-packages (from python-dateutil<3.0.0,>=2.1->botocore<1.36.0,>=1.35.97->boto3>=1.10.49->pycognito==2024.5.1->hass-nabucasa==0.86.0->homeassistant==2024.12.5) (1.17.0)
Jan 12 14:39:22 craptop python[2455]: homeassistant is already installed with the same version as the provided wheel. Use --force-reinstall to force an installation of the wheel.
Jan 12 14:39:23 craptop systemd[1]: Started Home assistant.
Jan 12 14:39:29 craptop hass[2462]: 2025-01-12 14:39:29.521 WARNING (MainThread) [aiohttp_fast_zlib] zlib_ng and isal are not available, falling back to zlib, performance will be degraded.

Offline

Board footer

Powered by FluxBB