hermes - 💡(How to fix) Fix [Setup]: Docker volume mounts fail on UnRAID due to USER hermes bypassing entrypoint permission fix [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
NousResearch/hermes-agent#13731Fetched 2026-04-22 08:04:27
View on GitHub
Comments
0
Participants
1
Timeline
0
Reactions
0
Author
Participants

Error Message

  1. Fallback error: Add early detection in entrypoint if $HERMES_HOME is not writable, with a clear error message directing users to the documentation.

Root Cause

The entrypoint never runs usermod or chown because the container starts as the hermes user (UID 10000), not root. The entrypoint relies on if [ "$(id -u)" = "0" ] to trigger permission fixes, but this block is bypassed when the container starts as non-root.

Fix Action

Fix / Workaround

Solution A: Runtime flag (current workaround)

Code Example

mkdir: cannot create directory '/opt/data/cron': Permission denied
mkdir: cannot create directory '/opt/data/sessions': Permission denied
mkdir: cannot create directory '/opt/data/logs': Permission denied

---

# Container starts with hardcoded UID (not root)
docker inspect hermes-agent | jq '.[0].Config.User'
# → "hermes"

# Hermes runs as UID 10000, volume owned by UID 99
docker exec hermes-agent id
# → uid=10000(hermes) gid=10000(hermes)

# Entrypoint never triggers usermod/chown
docker logs hermes-agent | grep -E "(Changing|usermod|hermes UID)"
#  (empty, block skipped because id -u != 0)

---

docker logs hermes-agent | grep -E "(Changing|Dropping)"
# → Changing hermes UID to 99
# → Changing hermes GID to 100
# → Dropping root privileges

---

# Current (problematic):
   USER hermes
   ENTRYPOINT ["bash", "/opt/hermes/docker/entrypoint.sh"]
   
   # Alternative:
   ENTRYPOINT ["bash", "/opt/hermes/docker/entrypoint.sh"]
   # (hermes user change happens inside entrypoint via gosu)
RAW_BUFFERClick to expand / collapse

What's Going Wrong?

Docker container fails to create directories on mounted volumes due to UID mismatch between container user and host volume ownership.

When running Hermes in Docker on UnRAID, volume mounts fail with Permission denied errors:

mkdir: cannot create directory '/opt/data/cron': Permission denied
mkdir: cannot create directory '/opt/data/sessions': Permission denied
mkdir: cannot create directory '/opt/data/logs': Permission denied

The entrypoint never runs usermod or chown because the container starts as the hermes user (UID 10000), not root. The entrypoint relies on if [ "$(id -u)" = "0" ] to trigger permission fixes, but this block is bypassed when the container starts as non-root.

Steps Taken

  1. Pulled Hermes Docker image
  2. Configured environment variables:
    • HERMES_UID=99
    • HERMES_GID=100
    • HERMES_HOME=/opt/data
  3. Mounted host volume: /mnt/user/appdata/hermes-agent:/opt/data
  4. Container starts but cannot write to mounted volume

Debugging findings:

# Container starts with hardcoded UID (not root)
docker inspect hermes-agent | jq '.[0].Config.User'
# → "hermes"

# Hermes runs as UID 10000, volume owned by UID 99
docker exec hermes-agent id
# → uid=10000(hermes) gid=10000(hermes)

# Entrypoint never triggers usermod/chown
docker logs hermes-agent | grep -E "(Changing|usermod|hermes UID)"
# → (empty, block skipped because id -u != 0)

Root cause: The Dockerfile ends with USER hermes, which causes Docker to start the container as UID 10000. The entrypoint's permission-fixing logic (if [ "$(id -u)" = "0" ]) is bypassed entirely.

Installation Method

Docker

Operating System

Slackware (UnraidOS 7.2.4)

What I've Already Tried

Solution A: Runtime flag (current workaround)

In UnRAID "Extra Parameters", adding --user 0:0 forces the container to start as root, allowing the entrypoint to run usermod and chown:

docker logs hermes-agent | grep -E "(Changing|Dropping)"
# → Changing hermes UID to 99
# → Changing hermes GID to 100
# → Dropping root privileges

This works but is undocumented and non-obvious.

Proposed Fix (optional)

  1. Documentation: Add a "Docker on UnRAID" section to the Docker docs explaining the --user 0:0 requirement or the need to set HERMES_UID/HERMES_GID to match the host volume owner.

  2. Alternative: Move USER hermes from the Dockerfile to after ENTRYPOINT, so the entrypoint always executes as root first:

    # Current (problematic):
    USER hermes
    ENTRYPOINT ["bash", "/opt/hermes/docker/entrypoint.sh"]
    
    # Alternative:
    ENTRYPOINT ["bash", "/opt/hermes/docker/entrypoint.sh"]
    # (hermes user change happens inside entrypoint via gosu)
  3. Fallback error: Add early detection in entrypoint if $HERMES_HOME is not writable, with a clear error message directing users to the documentation.

extent analysis

TL;DR

The most likely fix is to adjust the Dockerfile to run the entrypoint as root before switching to the hermes user, or use the --user 0:0 runtime flag to force the container to start as root.

Guidance

  • Verify the current UID and GID of the hermes user in the container using docker exec hermes-agent id to ensure it matches the host volume ownership.
  • Check the Dockerfile for the USER hermes directive and consider moving it after the ENTRYPOINT instruction to allow the entrypoint to run as root initially.
  • If using the --user 0:0 runtime flag, ensure it is properly documented and understood, as it forces the container to start as root.
  • Consider adding early detection in the entrypoint to check if $HERMES_HOME is writable and provide a clear error message if not.

Example

To adjust the Dockerfile, change the order of the USER and ENTRYPOINT instructions:

ENTRYPOINT ["bash", "/opt/hermes/docker/entrypoint.sh"]
USER hermes

This allows the entrypoint to run as root initially, fixing the permission issue.

Notes

The proposed fix assumes that the entrypoint is designed to handle the user switch correctly. Additionally, using the --user 0:0 runtime flag may have security implications and should be carefully considered.

Recommendation

Apply the workaround by adding the --user 0:0 runtime flag, as it is a straightforward solution that has been verified to work. However, it is recommended to also investigate adjusting the Dockerfile to run the entrypoint as root initially, as this may provide a more robust and secure solution.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

hermes - 💡(How to fix) Fix [Setup]: Docker volume mounts fail on UnRAID due to USER hermes bypassing entrypoint permission fix [1 participants]