Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] HACS custom component can no longer install dependencies #109

Closed
1 task done
3ll3d00d opened this issue Oct 12, 2024 · 3 comments · Fixed by #110
Closed
1 task done

[BUG] HACS custom component can no longer install dependencies #109

3ll3d00d opened this issue Oct 12, 2024 · 3 comments · Fixed by #110
Assignees

Comments

@3ll3d00d
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

Using the latest image with HACS 2.0.1 installed, dependencies of custom integrations fail to install due to OS permission errors

Expected Behavior

dependency should install normally

Steps To Reproduce

  • add some new custom integration with a dependency (e.g. lghorizon, ukbincollectiondata)
  • restart
  • dependency cannot be installed due to permission errors
2024-10-12 11:45:58.655 ERROR (SyncWorker_59) [homeassistant.util.package] Unable to install package uk-bin-collection>=0.97.1: error: Failed to install: uk_bin_collection-0.97.1-py3-none-any.whl (uk-bin-collection==0.97.1)
  Caused by: failed to create directory `/usr/local/lib/python3.12/site-packages/uk_bin_collection`
  Caused by: Permission denied (os error 13)

Environment

- OS: unraid 6.10
- How docker service was installed: by unraid

CPU architecture

x86-64

Docker creation

docker run
  -d
  --name='homeassistant'
  --net='host'
  -e TZ="Europe/London"
  -e HOST_OS="Unraid"
  -e HOST_HOSTNAME="zalaga-unraid"
  -e HOST_CONTAINERNAME="homeassistant"
  -e 'TCP_PORT_8123'='8123'
  -e 'PUID'='99'
  -e 'PGID'='100'
  -e 'UMASK'='022'
  -l net.unraid.docker.managed=dockerman
  -l net.unraid.docker.webui='http://[IP]:[PORT:8123]'
  -l net.unraid.docker.icon='https://raw.githubusercontent.com/linuxserver/docker-templates/master/linuxserver.io/img/homeassistant-logo.png'
  -v '/mnt/user/backups/homeassistant':'/config/backups':'rw'
  -v '/mnt/user/homeassistant':'/config':'rw' 'lscr.io/linuxserver/homeassistant'
3314bda6b6e2acef689b64418a4443fa8553e1cffe8f4487d519574fa1d68f2c


### Container logs

```bash
the log is rather large and full of irrelevant normal startup behaviour, relevant snippets below


2024-10-12 10:05:10.460 INFO (SyncWorker_5) [homeassistant.util.package] Attempting install of lghorizon>=0.7.0
2024-10-12 10:05:11.401 ERROR (SyncWorker_5) [homeassistant.util.package] Unable to install package lghorizon>=0.7.0: error: Failed to install: lghorizon-0.7.0-py3-none-any.whl (lghorizon==0.7.0)
  Caused by: failed to create directory `/usr/local/lib/python3.12/site-packages/lghorizon`
  Caused by: Permission denied (os error 13)
2024-10-12 10:05:11.401 INFO (SyncWorker_5) [homeassistant.util.package] Attempting install of lghorizon>=0.7.0
2024-10-12 10:05:12.201 ERROR (SyncWorker_5) [homeassistant.util.package] Unable to install package lghorizon>=0.7.0: error: Failed to install: lghorizon-0.7.0-py3-none-any.whl (lghorizon==0.7.0)
  Caused by: failed to create directory `/usr/local/lib/python3.12/site-packages/lghorizon`
  Caused by: Permission denied (os error 13)
2024-10-12 10:05:12.201 INFO (SyncWorker_5) [homeassistant.util.package] Attempting install of lghorizon>=0.7.0
2024-10-12 10:05:13.088 ERROR (SyncWorker_5) [homeassistant.util.package] Unable to install package lghorizon>=0.7.0: error: Failed to install: lghorizon-0.7.0-py3-none-any.whl (lghorizon==0.7.0)
  Caused by: failed to create directory `/usr/local/lib/python3.12/site-packages/lghorizon`
  Caused by: Permission denied (os error 13)

2024-10-12 11:45:52.069 INFO (SyncWorker_59) [homeassistant.util.package] Attempting install of uk-bin-collection>=0.97.1
2024-10-12 11:45:54.749 ERROR (SyncWorker_59) [homeassistant.util.package] Unable to install package uk-bin-collection>=0.97.1: error: Failed to install: webdriver_manager-4.0.2-py2.py3-none-any.whl (webdriver-manager==4.0.2)
  Caused by: failed to create directory `/usr/local/lib/python3.12/site-packages/webdriver_manager`
  Caused by: Permission denied (os error 13)
2024-10-12 11:45:54.749 INFO (SyncWorker_59) [homeassistant.util.package] Attempting install of uk-bin-collection>=0.97.1
2024-10-12 11:45:56.843 ERROR (SyncWorker_59) [homeassistant.util.package] Unable to install package uk-bin-collection>=0.97.1: error: Failed to install: uk_bin_collection-0.97.1-py3-none-any.whl (uk-bin-collection==0.97.1)
  Caused by: failed to create directory `/usr/local/lib/python3.12/site-packages/uk_bin_collection`
  Caused by: Permission denied (os error 13)
2024-10-12 11:45:56.843 INFO (SyncWorker_59) [homeassistant.util.package] Attempting install of uk-bin-collection>=0.97.1
2024-10-12 11:45:58.655 ERROR (SyncWorker_59) [homeassistant.util.package] Unable to install package uk-bin-collection>=0.97.1: error: Failed to install: uk_bin_collection-0.97.1-py3-none-any.whl (uk-bin-collection==0.97.1)
  Caused by: failed to create directory `/usr/local/lib/python3.12/site-packages/uk_bin_collection`
  Caused by: Permission denied (os error 13)
Copy link

Thanks for opening your first issue here! Be sure to follow the relevant issue templates, or risk having this issue marked as invalid.

@3ll3d00d
Copy link
Author

3ll3d00d commented Oct 12, 2024

I'm not sure when this started happening as it's been a while since I added a new component

one obvious difference is that the above logs show packages attempting to be installed into system python (/usr/local/lib/python3.12/site-packages) whereas I can see that previous dependencies went into config/.local/lib/python3.12/site-packages

@aptalca
Copy link
Member

aptalca commented Oct 12, 2024

It's due to upstream switching to uv instead of pip.

Pip installs packages in the user's home folder when it's run by a non-root user. But uv doesn't support that behavior astral-sh/uv#2077

So we either fix the permissions of the system folders so abc user can install there, or we create a venv in the config folder. Both have their downsides and we tried both options in the past and ran into issues. I'll have to do some testing to see if some things changed.

For now, you can manually install the package via docker exec homeassistant pip install packagename==version and it should persist through reboots and recreation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging a pull request may close this issue.

2 participants