FS#75210 - [home-assistant] hass user has no permissions to /var/lib/hass

Attached to Project: Community Packages
Opened by Max Pray (synthead) - Friday, 01 July 2022, 22:42 GMT
Last edited by Chih-Hsuan Yen (yan12125) - Saturday, 02 July 2022, 10:03 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To No-one
Architecture x86_64
Severity Critical
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 2
Private No

Details

Description:

Home Assistant needs to write to /var/lib/hass while it runs. After an upgrade to 1:2022.6.7-1, it appears that the hass user has lost permission to read or write to the /var/lib/hass directory.

It appears that starting the home-assistant.service systemd service moves /var/lib/hass to /var/lib/private/hass, and creates a symlink, /var/lib/hass, to point to /var/lib/private/hass. However, /var/lib/private is root:root and 700, so the hass user cannot read or write to any subdirectories under /var/lib/private, which includes hass.

Additional info:
* home-assistant 1:2022.6.7-1
* systemd 251.2-1

Steps to reproduce:
1. Install Home Assistant via pacman: pacman -S home-assistant
2. Start Home Assistant: systemctl start home-assistant
3. Observe that Home Assistant cannot access /var/lib/hass in its logs. Additionally, log in as the hass user (sudo -u hass bash) and observe that it cannot access /var/lib/hass

Setting this as critical because Home Assistant cannot run.
This task depends upon

Closed by  Chih-Hsuan Yen (yan12125)
Saturday, 02 July 2022, 10:03 GMT
Reason for closing:  Duplicate
Additional comments about closing:  https://bugs.archlinux.org/task/75204
Comment by Max Pray (synthead) - Friday, 01 July 2022, 23:45 GMT Comment by Max Pray (synthead) - Friday, 01 July 2022, 23:53 GMT
Home Assistant does start after downgrading to 2022.4.6-1.
Comment by Max Pray (synthead) - Saturday, 02 July 2022, 00:09 GMT
It looks like the problem is due to home-assistant 1:2022.6.7-1 not having the correct dependencies packaged. Upon HA startup, it sees that the required pip packages are not installed, and attempts to install them to /var/lib/private/hass/deps.

I suspect that this part of our PKGBUILD is not bundling the correct dependencies: https://github.com/archlinux/svntogit-community/blob/83d326e0d41defcc971c5f5d1486988a820b535c/trunk/PKGBUILD#L73-L79

For the record, we are installing the bundled dependencies here: https://github.com/archlinux/svntogit-community/blob/83d326e0d41defcc971c5f5d1486988a820b535c/trunk/PKGBUILD#L87

Loading...