diff --git a/Dockerfile b/Dockerfile index ee2c491c069..8655c51f34c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -94,9 +94,13 @@ RUN cd web && npm run build && \ # hermes_cli/main.py succeeds (see #18800). /opt/hermes/web is build-time # only (HERMES_WEB_DIST points at hermes_cli/web_dist) and is intentionally # not chowned here. +# The .venv MUST be hermes-writable so lazy_deps.py can install platform +# packages (discord.py, telegram, slack, etc.) at first gateway boot. +# Without this, `uv pip install` fails with EACCES and all messaging +# adapters silently fail to load. See tools/lazy_deps.py. USER root RUN chmod -R a+rX /opt/hermes && \ - chown -R hermes:hermes /opt/hermes/ui-tui /opt/hermes/node_modules + chown -R hermes:hermes /opt/hermes/.venv /opt/hermes/ui-tui /opt/hermes/node_modules # Start as root so the entrypoint can usermod/groupmod + gosu. # If HERMES_UID is unset, the entrypoint drops to the default hermes user (10000). diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh index 288ae2614bb..09e870543a2 100755 --- a/docker/entrypoint.sh +++ b/docker/entrypoint.sh @@ -39,6 +39,10 @@ if [ "$(id -u)" = "0" ]; then # by the mapped user on the host side. chown -R hermes:hermes "$HERMES_HOME" 2>/dev/null || \ echo "Warning: chown failed (rootless container?) — continuing anyway" + # The .venv must also be re-chowned when UID is remapped, otherwise + # lazy_deps.py cannot install platform packages (discord.py, etc.). + chown -R hermes:hermes "$INSTALL_DIR/.venv" 2>/dev/null || \ + echo "Warning: chown .venv failed (rootless container?) — continuing anyway" fi # Ensure config.yaml is readable by the hermes runtime user even if it was