mass_queue icon indicating copy to clipboard operation
mass_queue copied to clipboard

HA 2026.9.3 Requirements for mass_queue not found: ['aiocache'].

Open lairdm opened this issue 2 months ago • 2 comments

As requested in #125 , a new issue for this aiocache issue. I restarted the container and it came back, because the manual package install didn't persist.

HA version: 2026.9.3 (also occurred on 2026.8.2) Install method: docker compose OS: CachyOS (Arch based) Python version: Container reports 3.14.6

2026-09-12 17:47:20.307 ERROR (SyncWorker_7) [homeassistant.util.package] Unable to install package aiocache: error: Failed to install: aiocache-0.12.3-py2.py3-none-any.whl (aiocache==0.12.3)
  Caused by: Failed to create directory `/usr/local/lib/python3.14/site-packages/aiocache`
  Caused by: failed to create directory `/usr/local/lib/python3.14/site-packages/aiocache`: Permission denied (os error 13)
2026-09-12 17:47:20.307 ERROR (MainThread) [homeassistant.setup] Setup failed for custom integration 'mass_queue': Requirements for mass_queue not found: ['aiocache'].

Thanks!

lairdm avatar Sep 13 '26 00:09 lairdm

I just asked my AI, it's an issue when running the container as a non-root user for security enhancement, the module can't install the package.

Root cause confirmed — and it's environmental, which is worth putting in the bug report as context:

  • The container runs as uid 1000 (id shows uid=1000 gid=1000)
  • /usr/local/lib/python3.14/site-packages is owned by root
  • So HA's automatic requirement install (pip install aiocache at integration setup) can't write → Permission denied (os error 13) → mass_queue setup fails The official HA container normally runs as root precisely so it can auto-install integration requirements. Yours running as uid 1000 suggests the compose sets user: — let me check: $ grep -n -B2 -A25 '^ homeassistant:' /data/VMs/homeassistant/docker-compose.yaml 1-version: '3' 2-services: 3: homeassistant: 4- container_name: homeassistant 5- image: "ghcr.io/home-assistant/home-assistant:2026.9.2" # 2026.8.3 6- user: "1000:1000"

lairdm avatar Sep 13 '26 00:09 lairdm

For anyone else finding this, since I don't expect this issue to be fixed because the official docker container is supposed to be run as root (I don't feel that's an acceptable security posture), here's the fix I did:

Dockerfile to make a local image of your pinned version and install the extra package

# syntax=docker/dockerfile:1
# Home Assistant + pre-installed pip requirements for custom integrations.
#
# Why: config/compose runs the container as uid 1000, so HA cannot auto-install
# integration requirements at setup time (site-packages is root-owned in the
# image). We bake them in at build time instead.
#
# To update HA:
#   1. bump HA_VERSION below (and the tag in docker-compose.yaml to match)
#   2. docker compose build --pull homeassistant
#   3. docker compose up -d homeassistant
#
# Requirements below mirror manifest.json of integrations in ./config/custom_components:
#   hacs        -> aiogithubapi>=22.10.1
#   mass_queue  -> music-assistant-client, aiocache
#   keymaster   -> (none)
# When adding a custom integration with requirements, add them here too.

ARG HA_VERSION=2026.9.2
FROM ghcr.io/home-assistant/home-assistant:${HA_VERSION}

USER root
RUN pip install --no-cache-dir \
      "aiogithubapi>=22.10.1" \
      music-assistant-client \
      aiocache

Update docker compose to use this local image

  homeassistant:
    container_name: homeassistant
    # local build on top of the official image: bakes in pip requirements for
    # custom integrations (hacs, mass_queue) — see ./Dockerfile.
    # To update: bump HA_VERSION in Dockerfile + tag here, then
    #   docker compose build --pull homeassistant && docker compose up -d homeassistant
    build:
      context: .
      args:
        HA_VERSION: "2026.9.2"
    image: homeassistant-local:2026.9.2
    user: "1000:1000"

lairdm avatar Sep 13 '26 01:09 lairdm