hermes - ✅(Solved) Fix [Bug]: Podman-deployed Hermes gives error [1 pull requests, 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#16550Fetched 2026-04-28 06:52:36
View on GitHub
Comments
0
Participants
1
Timeline
7
Reactions
0
Participants
Timeline (top)
labeled ×5cross-referenced ×1referenced ×1

Error Message

apr 27 14:09:51 aipc podman[95411]: 2026-04-27 14:09:51.536664004 +0200 CEST m=+0.128592785 container start 0b2239e3f29cb3192c786b3288b1a5852284688981d1c4ad490d91e5ddb9e55c (image=docker.i> apr 27 14:09:51 aipc hermes[95411]: 0b2239e3f29cb3192c786b3288b1a5852284688981d1c4ad490d91e5ddb9e55c apr 27 14:09:51 aipc hermes[95434]: Syncing bundled skills into ~/.hermes/skills/ ... apr 27 14:09:51 aipc hermes[95434]: apr 27 14:09:51 aipc hermes[95434]: Done: 0 new, 0 updated, 81 unchanged. 81 total bundled. apr 27 14:09:52 aipc hermes[95434]: ┌─────────────────────────────────────────────────────────┐ apr 27 14:09:52 aipc hermes[95434]: │ ⚕ Hermes Gateway Starting... │ apr 27 14:09:52 aipc hermes[95434]: ├─────────────────────────────────────────────────────────┤ apr 27 14:09:52 aipc hermes[95434]: │ Messaging platforms + cron scheduler │ apr 27 14:09:52 aipc hermes[95434]: │ Press Ctrl+C to stop │ apr 27 14:09:52 aipc hermes[95434]: └─────────────────────────────────────────────────────────┘ apr 27 14:09:52 aipc hermes[95434]: apr 27 14:09:53 aipc hermes[95434]: ERROR gateway.platforms.discord: [Discord] Failed to connect to Discord: [Errno 13] Permission denied: '/opt/hermes/.local' apr 27 14:09:53 aipc hermes[95434]: Traceback (most recent call last): apr 27 14:09:53 aipc hermes[95434]: File "/usr/lib/python3.13/pathlib/_local.py", line 724, in mkdir apr 27 14:09:53 aipc hermes[95434]: os.mkdir(self, mode) apr 27 14:09:53 aipc hermes[95434]: ~~~~~~~~^^^^^^^^^^^^ apr 27 14:09:53 aipc hermes[95434]: FileNotFoundError: [Errno 2] No such file or directory: '/opt/hermes/.local/state/hermes/gateway-locks' apr 27 14:09:53 aipc hermes[95434]: apr 27 14:09:53 aipc hermes[95434]: During handling of the above exception, another exception occurred: apr 27 14:09:53 aipc hermes[95434]: apr 27 14:09:53 aipc hermes[95434]: Traceback (most recent call last): apr 27 14:09:53 aipc hermes[95434]: File "/usr/lib/python3.13/pathlib/_local.py", line 724, in mkdir apr 27 14:09:53 aipc hermes[95434]: os.mkdir(self, mode) apr 27 14:09:53 aipc hermes[95434]: ~~~~~~~~^^^^^^^^^^^^ apr 27 14:09:53 aipc hermes[95434]: FileNotFoundError: [Errno 2] No such file or directory: '/opt/hermes/.local/state/hermes' apr 27 14:09:53 aipc hermes[95434]: apr 27 14:09:53 aipc hermes[95434]: During handling of the above exception, another exception occurred: apr 27 14:09:53 aipc hermes[95434]: apr 27 14:09:53 aipc hermes[95434]: Traceback (most recent call last): apr 27 14:09:53 aipc hermes[95434]: File "/usr/lib/python3.13/pathlib/_local.py", line 724, in mkdir apr 27 14:09:53 aipc hermes[95434]: os.mkdir(self, mode) apr 27 14:09:53 aipc hermes[95434]: ~~~~~~~~^^^^^^^^^^^^ apr 27 14:09:53 aipc hermes[95434]: FileNotFoundError: [Errno 2] No such file or directory: '/opt/hermes/.local/state' apr 27 14:09:53 aipc hermes[95434]: apr 27 14:09:53 aipc hermes[95434]: During handling of the above exception, another exception occurred: apr 27 14:09:53 aipc hermes[95434]: apr 27 14:09:53 aipc hermes[95434]: Traceback (most recent call last): apr 27 14:09:53 aipc hermes[95434]: File "/opt/hermes/gateway/platforms/discord.py", line 568, in connect apr 27 14:09:53 aipc hermes[95434]: if not self._acquire_platform_lock('discord-bot-token', self.config.token, 'Discord bot token'): apr 27 14:09:53 aipc hermes[95434]: ~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ apr 27 14:09:53 aipc hermes[95434]: File "/opt/hermes/gateway/platforms/base.py", line 1227, in _acquire_platform_lock apr 27 14:09:53 aipc hermes[95434]: acquired, existing = acquire_scoped_lock( apr 27 14:09:53 aipc hermes[95434]: ~~~~~~~~~~~~~~~~~~~^ apr 27 14:09:53 aipc hermes[95434]: scope, identity, metadata={'platform': self.platform.value} apr 27 14:09:53 aipc hermes[95434]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ apr 27 14:09:53 aipc hermes[95434]: ) apr 27 14:09:53 aipc hermes[95434]: ^ apr 27 14:09:53 aipc hermes[95434]: File "/opt/hermes/gateway/status.py", line 471, in acquire_scoped_lock apr 27 14:09:53 aipc hermes[95434]: lock_path.parent.mkdir(parents=True, exist_ok=True) apr 27 14:09:53 aipc hermes[95434]: ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ apr 27 14:09:53 aipc hermes[95434]: File "/usr/lib/python3.13/pathlib/_local.py", line 728, in mkdir apr 27 14:09:53 aipc hermes[95434]: self.parent.mkdir(parents=True, exist_ok=True) apr 27 14:09:53 aipc hermes[95434]: ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ apr 27 14:09:53 aipc hermes[95434]: File "/usr/lib/python3.13/pathlib/_local.py", line 728, in mkdir apr 27 14:09:53 aipc hermes[95434]: self.parent.mkdir(parents=True, exist_ok=True) apr 27 14:09:53 aipc hermes[95434]: ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ apr 27 14:09:53 aipc hermes[95434]: File "/usr/lib/python3.13/pathlib/_local.py", line 728, in mkdir apr 27 14:09:53 aipc hermes[95434]: self.parent.mkdir(parents=True, exist_ok=True) apr 27 14:09:53 aipc hermes[95434]: ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ apr 27 14:09:53 aipc hermes[95434]: File "/usr/lib/python3.13/pathlib/_local.py", line 724, in mkdir apr 27 14:09:53 aipc hermes[95434]: os.mkdir(self, mode) apr 27 14:09:53 aipc hermes[95434]: ~~~~~~~~^^^^^^^^^^^^ apr 27 14:09:53 aipc hermes[95434]: PermissionError: [Errno 13] Permission denied: '/opt/hermes/.local' apr 27 14:09:53 aipc hermes[95434]: WARNING gateway.run: ✗ discord failed to connect apr 27 14:10:23 aipc hermes[95434]: ERROR gateway.platforms.discord: [Discord] Failed to connect to Discord: [Errno 13] Permission denied: '/opt/hermes/.local' apr 27 14:10:23 aipc hermes[95434]: Traceback (most recent call last): apr 27 14:10:23 aipc hermes[95434]: File "/usr/lib/python3.13/pathlib/_local.py", line 724, in mkdir apr 27 14:10:23 aipc hermes[95434]: os.mkdir(self, mode)

Root Cause

Root Cause Analysis (optional)

Fix Action

Fixed

PR fix notes

PR #16559: fix(gateway): fall back to HERMES_HOME when ~/.local/state is unwritable

Description (problem / solution / changelog)

What does this PR do?

In containers where the runtime user is non-root and the image `WORKDIR` (typically `/opt/hermes` under the Dockerfile) is owned by root, `Path.home()` resolves to a directory the process cannot write to. The gateway lock directory then fails to materialize:

``` PermissionError: [Errno 13] Permission denied: '/opt/hermes/.local' File "/opt/hermes/gateway/status.py", line 471, in acquire_scoped_lock lock_path.parent.mkdir(parents=True, exist_ok=True) ```

The reproduction in the issue was a podman quadlet with `UserNS=keep-id` + `User=%U:%G`, where podman runs the container under the host UID without adjusting the container-side `/etc/passwd` entry, so `$HOME` ends up at the `WORKDIR` rather than the `hermes` user's home.

This PR adds a fallback step to `_get_lock_dir()`:

#SourceWhen
1`HERMES_GATEWAY_LOCK_DIR`explicit override (existing)
2`XDG_STATE_HOME/hermes/gateway-locks`XDG spec env (existing)
3`~/.local/state/hermes/gateway-locks`XDG default — probed
4`HERMES_HOME/gateway-locks`new fallback when (3) is unwritable

`HERMES_HOME` is the documented runtime data root and is always intended to be writable (that's where the container volume mounts). It's the natural backstop for state files when `$HOME` is locked down.

The probe result is memoized in `_resolve_default_lock_dir` so repeated `acquire_scoped_lock` calls don't re-issue `mkdir` syscalls.

Related Issue

Fixes #16550

Type of Change

  • 🐛 Bug fix (non-breaking change that fixes an issue)

Changes Made

  • `gateway/status.py` — split `_get_lock_dir()`: env-driven branches stay un-cached for testability; the default-path probe lives in `_resolve_default_lock_dir` with `functools.lru_cache(maxsize=1)`. Probe failures fall back to `HERMES_HOME / "gateway-locks"` and emit a warning naming both `HERMES_GATEWAY_LOCK_DIR` and `XDG_STATE_HOME` as available overrides.
  • `tests/gateway/test_status.py` — 5 new tests under `TestGetLockDir`: explicit override priority, XDG_STATE_HOME honor, default-path probe under writable HOME, fallback to HERMES_HOME under read-only HOME (the container scenario), and probe memoization.

How to Test

Reproduce the original failure (no fix):

```bash docker run --rm -u 1000:1000 -e HERMES_HOME=/opt/data -v /tmp/data:/opt/data \ ghcr.io/nousresearch/hermes-agent gateway run

→ PermissionError: '/opt/hermes/.local'

```

After this PR, the same command falls back to `/opt/data/gateway-locks` and logs a warning.

Automated: ```bash pytest tests/gateway/test_status.py

38 passed (5 new in TestGetLockDir)

```

Wider `tests/gateway/` suite: 1006 passed (4 pre-existing flaky failures in Discord / approve-deny tests unrelated to this change — verified by running them on `upstream/main` without this PR).

Notes

  • Existing deployments with `~/.local/state` writable see no behavior change — the probe succeeds and returns the same path as before.
  • Operators who want the lock directory in a specific location can still set `HERMES_GATEWAY_LOCK_DIR` or `XDG_STATE_HOME` explicitly; both short-circuit ahead of the probe.
  • A complementary one-line fix in `docker/entrypoint.sh` (`export HERMES_GATEWAY_LOCK_DIR="$HERMES_HOME/gateway-locks"`) would make the explicit-override path active in the official image. Left out of this PR to keep the change purely fixing the runtime fallback; happy to follow up.

Changed files

  • gateway/status.py (modified, +50/-3)
  • tests/gateway/test_status.py (modified, +89/-0)

Code Example

apr 27 14:09:51 aipc podman[95411]: 2026-04-27 14:09:51.536664004 +0200 CEST m=+0.128592785 container start 0b2239e3f29cb3192c786b3288b1a5852284688981d1c4ad490d91e5ddb9e55c (image=docker.i>
apr 27 14:09:51 aipc hermes[95411]: 0b2239e3f29cb3192c786b3288b1a5852284688981d1c4ad490d91e5ddb9e55c
apr 27 14:09:51 aipc hermes[95434]: Syncing bundled skills into ~/.hermes/skills/ ...
apr 27 14:09:51 aipc hermes[95434]:
apr 27 14:09:51 aipc hermes[95434]: Done: 0 new, 0 updated, 81 unchanged. 81 total bundled.
apr 27 14:09:52 aipc hermes[95434]: ┌─────────────────────────────────────────────────────────┐
apr 27 14:09:52 aipc hermes[95434]: │           ⚕ Hermes Gateway Starting...apr 27 14:09:52 aipc hermes[95434]: ├─────────────────────────────────────────────────────────┤
apr 27 14:09:52 aipc hermes[95434]:Messaging platforms + cron scheduler                    │
apr 27 14:09:52 aipc hermes[95434]:Press Ctrl+C to stop                                   │
apr 27 14:09:52 aipc hermes[95434]: └─────────────────────────────────────────────────────────┘
apr 27 14:09:52 aipc hermes[95434]:
apr 27 14:09:53 aipc hermes[95434]: ERROR gateway.platforms.discord: [Discord] Failed to connect to Discord: [Errno 13] Permission denied: '/opt/hermes/.local'
apr 27 14:09:53 aipc hermes[95434]: Traceback (most recent call last):
apr 27 14:09:53 aipc hermes[95434]:   File "/usr/lib/python3.13/pathlib/_local.py", line 724, in mkdir
apr 27 14:09:53 aipc hermes[95434]:     os.mkdir(self, mode)
apr 27 14:09:53 aipc hermes[95434]:     ~~~~~~~~^^^^^^^^^^^^
apr 27 14:09:53 aipc hermes[95434]: FileNotFoundError: [Errno 2] No such file or directory: '/opt/hermes/.local/state/hermes/gateway-locks'
apr 27 14:09:53 aipc hermes[95434]:
apr 27 14:09:53 aipc hermes[95434]: During handling of the above exception, another exception occurred:
apr 27 14:09:53 aipc hermes[95434]:
apr 27 14:09:53 aipc hermes[95434]: Traceback (most recent call last):
apr 27 14:09:53 aipc hermes[95434]:   File "/usr/lib/python3.13/pathlib/_local.py", line 724, in mkdir
apr 27 14:09:53 aipc hermes[95434]:     os.mkdir(self, mode)
apr 27 14:09:53 aipc hermes[95434]:     ~~~~~~~~^^^^^^^^^^^^
apr 27 14:09:53 aipc hermes[95434]: FileNotFoundError: [Errno 2] No such file or directory: '/opt/hermes/.local/state/hermes'
apr 27 14:09:53 aipc hermes[95434]:
apr 27 14:09:53 aipc hermes[95434]: During handling of the above exception, another exception occurred:
apr 27 14:09:53 aipc hermes[95434]:
apr 27 14:09:53 aipc hermes[95434]: Traceback (most recent call last):
apr 27 14:09:53 aipc hermes[95434]:   File "/usr/lib/python3.13/pathlib/_local.py", line 724, in mkdir
apr 27 14:09:53 aipc hermes[95434]:     os.mkdir(self, mode)
apr 27 14:09:53 aipc hermes[95434]:     ~~~~~~~~^^^^^^^^^^^^
apr 27 14:09:53 aipc hermes[95434]: FileNotFoundError: [Errno 2] No such file or directory: '/opt/hermes/.local/state'
apr 27 14:09:53 aipc hermes[95434]:
apr 27 14:09:53 aipc hermes[95434]: During handling of the above exception, another exception occurred:
apr 27 14:09:53 aipc hermes[95434]:
apr 27 14:09:53 aipc hermes[95434]: Traceback (most recent call last):
apr 27 14:09:53 aipc hermes[95434]:   File "/opt/hermes/gateway/platforms/discord.py", line 568, in connect
apr 27 14:09:53 aipc hermes[95434]:     if not self._acquire_platform_lock('discord-bot-token', self.config.token, 'Discord bot token'):
apr 27 14:09:53 aipc hermes[95434]:            ~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
apr 27 14:09:53 aipc hermes[95434]:   File "/opt/hermes/gateway/platforms/base.py", line 1227, in _acquire_platform_lock
apr 27 14:09:53 aipc hermes[95434]:     acquired, existing = acquire_scoped_lock(
apr 27 14:09:53 aipc hermes[95434]:                          ~~~~~~~~~~~~~~~~~~~^
apr 27 14:09:53 aipc hermes[95434]:         scope, identity, metadata={'platform': self.platform.value}
apr 27 14:09:53 aipc hermes[95434]:         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
apr 27 14:09:53 aipc hermes[95434]:     )
apr 27 14:09:53 aipc hermes[95434]:     ^
apr 27 14:09:53 aipc hermes[95434]:   File "/opt/hermes/gateway/status.py", line 471, in acquire_scoped_lock
apr 27 14:09:53 aipc hermes[95434]:     lock_path.parent.mkdir(parents=True, exist_ok=True)
apr 27 14:09:53 aipc hermes[95434]:     ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
apr 27 14:09:53 aipc hermes[95434]:   File "/usr/lib/python3.13/pathlib/_local.py", line 728, in mkdir
apr 27 14:09:53 aipc hermes[95434]:     self.parent.mkdir(parents=True, exist_ok=True)
apr 27 14:09:53 aipc hermes[95434]:     ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
apr 27 14:09:53 aipc hermes[95434]:   File "/usr/lib/python3.13/pathlib/_local.py", line 728, in mkdir
apr 27 14:09:53 aipc hermes[95434]:     self.parent.mkdir(parents=True, exist_ok=True)
apr 27 14:09:53 aipc hermes[95434]:     ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
apr 27 14:09:53 aipc hermes[95434]:   File "/usr/lib/python3.13/pathlib/_local.py", line 728, in mkdir
apr 27 14:09:53 aipc hermes[95434]:     self.parent.mkdir(parents=True, exist_ok=True)
apr 27 14:09:53 aipc hermes[95434]:     ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
apr 27 14:09:53 aipc hermes[95434]:   File "/usr/lib/python3.13/pathlib/_local.py", line 724, in mkdir
apr 27 14:09:53 aipc hermes[95434]:     os.mkdir(self, mode)
apr 27 14:09:53 aipc hermes[95434]:     ~~~~~~~~^^^^^^^^^^^^
apr 27 14:09:53 aipc hermes[95434]: PermissionError: [Errno 13] Permission denied: '/opt/hermes/.local'
apr 27 14:09:53 aipc hermes[95434]: WARNING gateway.run: ✗ discord failed to connect
apr 27 14:10:23 aipc hermes[95434]: ERROR gateway.platforms.discord: [Discord] Failed to connect to Discord: [Errno 13] Permission denied: '/opt/hermes/.local'
apr 27 14:10:23 aipc hermes[95434]: Traceback (most recent call last):
apr 27 14:10:23 aipc hermes[95434]:   File "/usr/lib/python3.13/pathlib/_local.py", line 724, in mkdir
apr 27 14:10:23 aipc hermes[95434]:     os.mkdir(self, mode)

---
RAW_BUFFERClick to expand / collapse

Bug Description

The hermes agent tries to create /opt/hermes/.local folder and gets a permission denied error.

Steps to Reproduce

cat hermes.container (quadlet file)

vim: ft=systemd

[Unit] Description=The Hermes Agent container After=network-online.target Requires=pgvector.service

[Service] Restart=always

[Install] WantedBy=default.target

[Container] ContainerName=%N HostName=%N

Image=docker.io/nousresearch/hermes-agent:latest AutoUpdate=registry Exec=gateway run

Network=mynet PublishPort=8642:8642

Map host UID/GID to the same UID/GID inside the container

UserNS=keep-id

Run the container process as this user (matches the host user due to keep-id)

User=%U:%G

Volume=%h/containers/%N/data:/opt/data:z

Secret=discord-bot-token,type=env,target=DISCORD_BOT_TOKEN Environment=HERMES_UID=%U Environment=HERMES_GID=%G EnvironmentFile=%h/containers/%N/%N.env

Timezone=Europe/Brussels

HealthCmd=CMD-SHELL /opt/hermes/.venv/bin/python3 -c "import requests; exit() if requests.get('http://localhost:8642/health').status_code == 200 else exit(1)" HealthInterval=10s HealthRetries=3 HealthStartPeriod=40s

Expected Behavior

It should be able to create the /opt/hermes/.local directory

Actual Behavior

: Traceback (most recent call last): hermes[95434]: File "/usr/lib/python3.13/pathlib/_local.py", line 724, in mkdir PermissionError: [Errno 13] Permission denied: '/opt/hermes/.local'

Affected Component

Setup / Installation

Messaging Platform (if gateway-related)

Discord

Debug Report

apr 27 14:09:51 aipc podman[95411]: 2026-04-27 14:09:51.536664004 +0200 CEST m=+0.128592785 container start 0b2239e3f29cb3192c786b3288b1a5852284688981d1c4ad490d91e5ddb9e55c (image=docker.i>
apr 27 14:09:51 aipc hermes[95411]: 0b2239e3f29cb3192c786b3288b1a5852284688981d1c4ad490d91e5ddb9e55c
apr 27 14:09:51 aipc hermes[95434]: Syncing bundled skills into ~/.hermes/skills/ ...
apr 27 14:09:51 aipc hermes[95434]:
apr 27 14:09:51 aipc hermes[95434]: Done: 0 new, 0 updated, 81 unchanged. 81 total bundled.
apr 27 14:09:52 aipc hermes[95434]: ┌─────────────────────────────────────────────────────────┐
apr 27 14:09:52 aipc hermes[95434]: │           ⚕ Hermes Gateway Starting...                 │
apr 27 14:09:52 aipc hermes[95434]: ├─────────────────────────────────────────────────────────┤
apr 27 14:09:52 aipc hermes[95434]: │  Messaging platforms + cron scheduler                    │
apr 27 14:09:52 aipc hermes[95434]: │  Press Ctrl+C to stop                                   │
apr 27 14:09:52 aipc hermes[95434]: └─────────────────────────────────────────────────────────┘
apr 27 14:09:52 aipc hermes[95434]:
apr 27 14:09:53 aipc hermes[95434]: ERROR gateway.platforms.discord: [Discord] Failed to connect to Discord: [Errno 13] Permission denied: '/opt/hermes/.local'
apr 27 14:09:53 aipc hermes[95434]: Traceback (most recent call last):
apr 27 14:09:53 aipc hermes[95434]:   File "/usr/lib/python3.13/pathlib/_local.py", line 724, in mkdir
apr 27 14:09:53 aipc hermes[95434]:     os.mkdir(self, mode)
apr 27 14:09:53 aipc hermes[95434]:     ~~~~~~~~^^^^^^^^^^^^
apr 27 14:09:53 aipc hermes[95434]: FileNotFoundError: [Errno 2] No such file or directory: '/opt/hermes/.local/state/hermes/gateway-locks'
apr 27 14:09:53 aipc hermes[95434]:
apr 27 14:09:53 aipc hermes[95434]: During handling of the above exception, another exception occurred:
apr 27 14:09:53 aipc hermes[95434]:
apr 27 14:09:53 aipc hermes[95434]: Traceback (most recent call last):
apr 27 14:09:53 aipc hermes[95434]:   File "/usr/lib/python3.13/pathlib/_local.py", line 724, in mkdir
apr 27 14:09:53 aipc hermes[95434]:     os.mkdir(self, mode)
apr 27 14:09:53 aipc hermes[95434]:     ~~~~~~~~^^^^^^^^^^^^
apr 27 14:09:53 aipc hermes[95434]: FileNotFoundError: [Errno 2] No such file or directory: '/opt/hermes/.local/state/hermes'
apr 27 14:09:53 aipc hermes[95434]:
apr 27 14:09:53 aipc hermes[95434]: During handling of the above exception, another exception occurred:
apr 27 14:09:53 aipc hermes[95434]:
apr 27 14:09:53 aipc hermes[95434]: Traceback (most recent call last):
apr 27 14:09:53 aipc hermes[95434]:   File "/usr/lib/python3.13/pathlib/_local.py", line 724, in mkdir
apr 27 14:09:53 aipc hermes[95434]:     os.mkdir(self, mode)
apr 27 14:09:53 aipc hermes[95434]:     ~~~~~~~~^^^^^^^^^^^^
apr 27 14:09:53 aipc hermes[95434]: FileNotFoundError: [Errno 2] No such file or directory: '/opt/hermes/.local/state'
apr 27 14:09:53 aipc hermes[95434]:
apr 27 14:09:53 aipc hermes[95434]: During handling of the above exception, another exception occurred:
apr 27 14:09:53 aipc hermes[95434]:
apr 27 14:09:53 aipc hermes[95434]: Traceback (most recent call last):
apr 27 14:09:53 aipc hermes[95434]:   File "/opt/hermes/gateway/platforms/discord.py", line 568, in connect
apr 27 14:09:53 aipc hermes[95434]:     if not self._acquire_platform_lock('discord-bot-token', self.config.token, 'Discord bot token'):
apr 27 14:09:53 aipc hermes[95434]:            ~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
apr 27 14:09:53 aipc hermes[95434]:   File "/opt/hermes/gateway/platforms/base.py", line 1227, in _acquire_platform_lock
apr 27 14:09:53 aipc hermes[95434]:     acquired, existing = acquire_scoped_lock(
apr 27 14:09:53 aipc hermes[95434]:                          ~~~~~~~~~~~~~~~~~~~^
apr 27 14:09:53 aipc hermes[95434]:         scope, identity, metadata={'platform': self.platform.value}
apr 27 14:09:53 aipc hermes[95434]:         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
apr 27 14:09:53 aipc hermes[95434]:     )
apr 27 14:09:53 aipc hermes[95434]:     ^
apr 27 14:09:53 aipc hermes[95434]:   File "/opt/hermes/gateway/status.py", line 471, in acquire_scoped_lock
apr 27 14:09:53 aipc hermes[95434]:     lock_path.parent.mkdir(parents=True, exist_ok=True)
apr 27 14:09:53 aipc hermes[95434]:     ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
apr 27 14:09:53 aipc hermes[95434]:   File "/usr/lib/python3.13/pathlib/_local.py", line 728, in mkdir
apr 27 14:09:53 aipc hermes[95434]:     self.parent.mkdir(parents=True, exist_ok=True)
apr 27 14:09:53 aipc hermes[95434]:     ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
apr 27 14:09:53 aipc hermes[95434]:   File "/usr/lib/python3.13/pathlib/_local.py", line 728, in mkdir
apr 27 14:09:53 aipc hermes[95434]:     self.parent.mkdir(parents=True, exist_ok=True)
apr 27 14:09:53 aipc hermes[95434]:     ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
apr 27 14:09:53 aipc hermes[95434]:   File "/usr/lib/python3.13/pathlib/_local.py", line 728, in mkdir
apr 27 14:09:53 aipc hermes[95434]:     self.parent.mkdir(parents=True, exist_ok=True)
apr 27 14:09:53 aipc hermes[95434]:     ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
apr 27 14:09:53 aipc hermes[95434]:   File "/usr/lib/python3.13/pathlib/_local.py", line 724, in mkdir
apr 27 14:09:53 aipc hermes[95434]:     os.mkdir(self, mode)
apr 27 14:09:53 aipc hermes[95434]:     ~~~~~~~~^^^^^^^^^^^^
apr 27 14:09:53 aipc hermes[95434]: PermissionError: [Errno 13] Permission denied: '/opt/hermes/.local'
apr 27 14:09:53 aipc hermes[95434]: WARNING gateway.run: ✗ discord failed to connect
apr 27 14:10:23 aipc hermes[95434]: ERROR gateway.platforms.discord: [Discord] Failed to connect to Discord: [Errno 13] Permission denied: '/opt/hermes/.local'
apr 27 14:10:23 aipc hermes[95434]: Traceback (most recent call last):
apr 27 14:10:23 aipc hermes[95434]:   File "/usr/lib/python3.13/pathlib/_local.py", line 724, in mkdir
apr 27 14:10:23 aipc hermes[95434]:     os.mkdir(self, mode)

Operating System

Bluefin Linux (Fedora variant)

Python Version

3.13

Hermes Version

latest docker

Additional Logs / Traceback (optional)

Root Cause Analysis (optional)

No response

Proposed Fix (optional)

No response

Are you willing to submit a PR for this?

  • I'd like to fix this myself and submit a PR

extent analysis

TL;DR

The hermes agent is unable to create the /opt/hermes/.local directory due to a permission denied error, likely caused by the container not having the necessary permissions to write to the host directory.

Guidance

  • Check the permissions of the /opt/hermes directory on the host system to ensure that the user running the container has write access.
  • Verify that the UserNS=keep-id and User=%U:%G settings in the hermes.container file are correctly configured to map the host user's UID and GID to the container.
  • Consider adding a Volume directive to the hermes.container file to mount a host directory with the correct permissions to the container's /opt/hermes directory.
  • Check the Docker container's runtime configuration to ensure that it is running with the correct user and group IDs.

Example

No code example is provided as the issue is related to container configuration and permissions.

Notes

The issue is likely related to the container's inability to write to the host directory due to permission issues. The UserNS=keep-id and User=%U:%G settings should be reviewed to ensure correct mapping of host user IDs to the container.

Recommendation

Apply a workaround by adjusting the container's configuration to use a different directory or adjusting the permissions of the /opt/hermes directory on the host system.

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 - ✅(Solved) Fix [Bug]: Podman-deployed Hermes gives error [1 pull requests, 1 participants]