# NousResearch/hermes-agent · Docker venv ownership fix for non-root users

## Open now

- Nothing open on GitHub.

These issues and pull requests address a bug where the Python virtual environment has incorrect ownership, preventing non-root container users from using or modifying it. The proposed fixes involve changing the venv directory ownership to the appropriate non-root user.

## TL;DR

- 4 member(s): 0 open issue(s), 1 closed issue(s), 0 open PR(s), 1 merged PR(s), 2 PR(s) closed without merging.
- A fix was merged to main in PR #24841. Verify it addresses your case.
- **Recommended:** read PR #24841 (and any competing PRs below) before filing. Confirm the merged change covers your symptom.

## Maintainer resolution verdict

- Internal-tracker verdict over this cluster's issue members: `resolved` · deciding PR(s): `pr-24841`. This is distinct from the fix status above. Weigh it yourself.

## How this cluster was grouped

- Link evidence (`STRUCTURAL_SPANNING`): every member is connected by structural evidence: shared changed files, or a closing/superseded reference.
- Pairwise link density `0.50`: the share of member pairs that carry a link, counting a structural link in full and a relevance-only link at 0.36. `1.00` means every pair is linked.

## Closed / duplicate issues

- #21536: \[Bug\]: Python venv ownership prevents non-root container usage, breaking security best practices

## Prior & competing PRs

- **#24841: fix(docker): chown .venv to hermes so lazy_deps can install platform packages**. merged to main · fix tier `verified`
  - maintainer direction: category `merged`
  - files: `Dockerfile`, `docker/entrypoint.sh`
  - fix hunks:
  - `Dockerfile`

    ```diff
    @@ -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).
     
    ```
  - `docker/entrypoint.sh`

    ```diff
    @@ -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
    ```
- **#21543: fix(docker): chown venv to hermes user for non-root container support**. closed without merge
  - maintainer direction: category `implemented_elsewhere`; implication `superseded`
- **#21755: fix(docker): chown virtualenv for non-root runtime**. closed without merge
  - maintainer direction: category `duplicate_of`; implication `duplicate`; refs `#17674`, `#21543`

## Fix status

- Merged to main in PR #24841 (cited above). No release data is tracked. Verify downstream.
- Fix last verified (merged) `2026-05-13`.
