Skip to content

Home Assistant's hass user cannot access /var/lib/hass after upgrade to 1:2022.6.7-1

After upgrading Home Assistant to 1:2022.6.7-1, the hass user seems to have lost read and write access to /var/lib/hass. Of course, this means that HA will not start.

If I watch /var/log/hass/home-assistant.log while the home-assistant systemd service starts up, I see entries like:

2022-07-01 16:06:47 ERROR (SyncWorker_0) [homeassistant.util.package] Unable to install package sqlalchemy==1.4.37: ERROR: Could not install packages due to an OSError: [Errno 30] Read-only file system: '/lib/python3.10/site-packages/sqlalchemy/processors.py'
2022-07-01 16:06:49 ERROR (SyncWorker_0) [homeassistant.util.package] Unable to install package sqlalchemy==1.4.37: ERROR: Could not install packages due to an OSError: [Errno 30] Read-only file system: '/lib/python3.10/site-packages/sqlalchemy/processors.py'
2022-07-01 16:06:50 ERROR (SyncWorker_0) [homeassistant.util.package] Unable to install package sqlalchemy==1.4.37: ERROR: Could not install packages due to an OSError: [Errno 30] Read-only file system: '/lib/python3.10/site-packages/sqlalchemy/processors.py'
2022-07-01 16:06:50 ERROR (MainThread) [homeassistant.config] Package mailbox setup failed. Integration sensor Requirements for recorder not found: ['sqlalchemy==1.4.37']. (See /var/lib/hass/packages/mailbox.yaml:0). 
2022-07-01 16:06:50 ERROR (MainThread) [homeassistant.config] Package mqtt setup failed. Integration sensor Requirements for recorder not found: ['sqlalchemy==1.4.37']. (See /var/lib/hass/packages/mqtt.yaml:0). 
2022-07-01 16:06:50 ERROR (MainThread) [homeassistant.config] Package snuggery setup failed. Integration sensor Requirements for recorder not found: ['sqlalchemy==1.4.37']. (See /var/lib/hass/packages/snuggery.yaml:2). 
2022-07-01 16:06:52 ERROR (MainThread) [homeassistant.config] Package zoneminder setup failed. Integration sensor Requirements for recorder not found: ['sqlalchemy==1.4.37']. (See /var/lib/hass/packages/zoneminder.yaml:0). 
2022-07-01 16:06:55 ERROR (SyncWorker_2) [homeassistant.util.package] Unable to install package PyTurboJPEG==1.6.6: ERROR: Could not install packages due to an OSError: [Errno 30] Read-only file system: '/lib/python3.10/site-packages/turbojpeg.py'
2022-07-01 16:06:56 ERROR (SyncWorker_1) [homeassistant.util.package] Unable to install package PyTurboJPEG==1.6.6: ERROR: Could not install packages due to an OSError: [Errno 30] Read-only file system: '/lib/python3.10/site-packages/turbojpeg.py'
2022-07-01 16:06:58 ERROR (SyncWorker_3) [homeassistant.util.package] Unable to install package PyTurboJPEG==1.6.6: ERROR: Could not install packages due to an OSError: [Errno 30] Read-only file system: '/lib/python3.10/site-packages/turbojpeg.py'

It's trying to update the vendored dependencies in the /var/lib/hass/deps, but cannot access the directory.

Additionally, if I log in as the hass user via sudo -u hass bash, get:

bash: /var/lib/hass/.bashrc: Permission denied

In my case, /var/lib/hass/.bashrc doesn't even exist, but it cannot read /var/lib/hass to determine that.

I found that our home-assistant.service file has DynamicUser=true set (permalink), so what's actually happening behind the scenes is systemd moving /var/lib/hass to /var/lib/private/hass, and creating a symlink to it as /var/lib/hass. /var/lib/private is owned by root:root via 700 permissions, so the hass user doesn't have access to subdirectories in /var/lib/private. There might be more about systemd that I don't know, here.

Anyway, I filed a bug for this: https://bugs.archlinux.org/task/75210

If anyone has any ideas, let me know. It's pretty annoying to not be able to turn lights on and off in my home :P

1 points1 comments
Open on Reddit
About this post
Posted
Archived
Score
1 · 67% up
Kind
Text
ID
vpduht

Author

25
posts
254
comments
14
media
View profile

1 comment

Keyboard shortcuts

Move and act

jork
Next / previous post or comment
Enteroro
Open the post
f
Open the media viewer
s
Save
h
Hide (the toast has Undo)
Tab
Right after an action: the toast's Undo
x
Collapse the comment
v
Next layout: cards, compact, grid

Go to

/
Search
gthenh
Home
gthena
All
gthens
Subreddits
gthenl
Library
?
This list
Esc
Close a menu or this list

In the viewer

←or→
Previous / next file
↑or↓
Previous / next post
korj
Previous / next post
Space
Play / pause
m
Mute
z
Zoom
s
Save
o
Open the post (on its own page: back to it)
Esc
Close

Keys do nothing while you type in a box.