hermes - 💡(How to fix) Fix ensure_hermes_home() creates root-owned dirs in profile subdirectories when kanban workers are dispatched

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…

Error Message

PermissionError: [Errno 13] Permission denied: '/opt/data/profiles/charles/logs/curator'

Root Cause

Root Cause

Fix Action

Fix / Workaround

Environment

  • Deployment: Docker (nousresearch/hermes-agent:latest)
  • HERMES_UID=1000, HERMES_GID=911 set in compose
  • Profiles in use (charles profile active for kanban dispatch)
  • Version: v0.13.0

When the kanban dispatcher spawns workers for profile-namespaced tasks (e.g. hermes -p charles ... kanban task <id>), the worker process calls ensure_hermes_home() on startup (config.py:428), which creates missing subdirectories including logs/curator. These directories land as root:root on the host volume mount despite the gateway itself running as uid 1000 via gosu.

The entrypoint correctly drops privileges via gosu hermes before the main gateway process. However, kanban workers are spawned as child processes of the dispatcher — if any code path in the dispatcher forks before the privilege drop is complete, or if the dispatcher itself runs in a context where uid hasn't dropped, ensure_hermes_home() creates directories as root. These then block uid-1000 workers.

Code Example

PermissionError: [Errno 13] Permission denied: '/opt/data/profiles/charles/logs/curator'

---

Failed to initialize agent: [Errno 13] Permission denied: '/opt/data/profiles/charles/logs/agent.log'
RAW_BUFFERClick to expand / collapse

Environment

  • Deployment: Docker (nousresearch/hermes-agent:latest)
  • HERMES_UID=1000, HERMES_GID=911 set in compose
  • Profiles in use (charles profile active for kanban dispatch)
  • Version: v0.13.0

Behavior

When the kanban dispatcher spawns workers for profile-namespaced tasks (e.g. hermes -p charles ... kanban task <id>), the worker process calls ensure_hermes_home() on startup (config.py:428), which creates missing subdirectories including logs/curator. These directories land as root:root on the host volume mount despite the gateway itself running as uid 1000 via gosu.

Subsequent worker invocations running as uid 1000 fail immediately with:

PermissionError: [Errno 13] Permission denied: '/opt/data/profiles/charles/logs/curator'

and:

Failed to initialize agent: [Errno 13] Permission denied: '/opt/data/profiles/charles/logs/agent.log'

Root Cause

The entrypoint correctly drops privileges via gosu hermes before the main gateway process. However, kanban workers are spawned as child processes of the dispatcher — if any code path in the dispatcher forks before the privilege drop is complete, or if the dispatcher itself runs in a context where uid hasn't dropped, ensure_hermes_home() creates directories as root. These then block uid-1000 workers.

The needs_chown condition in the entrypoint (HERMES_UID != "10000") ensures a chown -R runs on /opt/data (the root hermes home) at startup — but this does not cover profiles/<name>/ subdirectories created at runtime after the container starts.

Reproduction

  1. Run hermes in Docker with HERMES_UID=1000 and a named profile (e.g. -p charles)
  2. Have the dispatcher claim and spawn a kanban task worker for that profile
  3. Observe logs/curator and agent.log created as root:root in the profile dir
  4. Subsequent workers for the same profile fail with Permission denied

Expected behavior

All directories created by ensure_hermes_home() for any profile should be owned by the hermes user (uid=HERMES_UID), regardless of which process triggers their creation.

Workaround

chown -R user:nasusers /root/.hermes/profiles/charles/ after each container restart. Not suitable for production.

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