ekutner / home-connect-hass

Alternative (and improved) Home Connect integration for Home Assistant
MIT License
607 stars 57 forks source link

Docker HASS HACS Error 500 on deps #400

Closed voc0der closed 3 months ago

voc0der commented 3 months ago

Describe the bug

Unable to proceed, getting 500 Internal Server Error Server got itself in trouble in HASS. Under the hood, pip doesn't have permissions to install deps (see below)

Version of the custom_component

Using latest repo version.

Configuration

Using docker, amd64, ghcr.io/home-assistant/home-assistant:stable

Debug log

2024-07-16 07:16:17.981 ERROR (SyncWorker_1) [homeassistant.util.package] Unable to install package home-connect-async==0.8.0: ERROR: Could not install packages due to an OSError: [Errno 13] Permission denied: '/.local'
Check the permissions.
2024-07-16 07:16:20.205 ERROR (SyncWorker_1) [homeassistant.util.package] Unable to install package home-connect-async==0.8.0: ERROR: Could not install packages due to an OSError: [Errno 13] Permission denied: '/.local'
Check the permissions.
2024-07-16 07:16:22.405 ERROR (SyncWorker_1) [homeassistant.util.package] Unable to install package home-connect-async==0.8.0: ERROR: Could not install packages due to an OSError: [Errno 13] Permission denied: '/.local'
Check the permissions.
2024-07-16 07:16:22.406 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/aiohttp/web_protocol.py", line 452, in _handle_request
    resp = await request_handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/aiohttp/web_app.py", line 543, in _handle
    resp = await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/aiohttp/web_middlewares.py", line 114, in impl
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 92, in security_filter_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 210, in forwarded_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 26, in request_context_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 85, in ban_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 242, in auth_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/headers.py", line 32, in headers_middleware
    response = await handler(request)
               ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/http.py", line 73, in handle
    result = await handler(request, **request.match_info)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/decorators.py", line 81, in with_admin
    return await func(self, request, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 74, in wrapper
    return await method(view, request, data, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 172, in post
    return await self._post_impl(request, data)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 179, in _post_impl
    return await super()._post_impl(request, data)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 84, in _post_impl
    result = await self._flow_mgr.async_init(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 1267, in async_init
    flow, result = await self._async_init(flow_id, handler, context, data)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 1287, in _async_init
    flow = await self.async_create_flow(handler, context=context, data=data)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 1423, in async_create_flow
    handler = await _async_get_flow_handler(
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 2851, in _async_get_flow_handler
    await _load_integration(hass, domain, hass_config)
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 2828, in _load_integration
    await async_process_deps_reqs(hass, hass_config, integration)
  File "/usr/src/homeassistant/homeassistant/setup.py", line 563, in async_process_deps_reqs
    await requirements.async_get_integration_with_requirements(
  File "/usr/src/homeassistant/homeassistant/requirements.py", line 54, in async_get_integration_with_requirements
    return await manager.async_get_integration_with_requirements(domain)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/requirements.py", line 170, in async_get_integration_with_requirements
    await future
  File "/usr/src/homeassistant/homeassistant/requirements.py", line 159, in async_get_integration_with_requirements
    await self._async_process_integration(integration, done)
  File "/usr/src/homeassistant/homeassistant/requirements.py", line 182, in _async_process_integration
    await self.async_process_requirements(
  File "/usr/src/homeassistant/homeassistant/requirements.py", line 269, in async_process_requirements
    await self._async_process_requirements(name, missing)
  File "/usr/src/homeassistant/homeassistant/requirements.py", line 307, in _async_process_requirements
    raise RequirementsNotFound(name, list(failures))
homeassistant.requirements.RequirementsNotFound: Requirements for home_connect_alt not found: ['home-connect-async==0.8.0'].

It looks like pip wants to write to /.local and not ~/.local or somewhere safe, and most containers (including the official one) aren't going to let you do that nor would it be persist anyways. The expected location is probably /config/.local/

I tried going into the container and making .local, but I got permission denied for the root user, so..

docker exec -it homeassistant bash
mkdir /.local
mkdir: can't create directory '/.local': Permission denied

Any suggestions on how to get this working? Thanks

ekutner commented 3 months ago

Looks like something is messed up with your installation of HA. The easiest would probably be to reinstall it.

voc0der commented 3 months ago

Hm, I'll keep that in mind. I have other HACS repos that work just fine, so I'm not going to reconfigure all of HASS when I have tons of stuff working except this one repo (it's the official docker container that only mounts some config files, so I'm not even installing it anyways). Thanks anyways tho!

I highly doubt the effort spent reconfiguring it would yield a single different result based on the error too. Guess I'll just keep an eye on this repo for when it eventually gets fixed.