Skip to content

[Bug]: s6-log lock collision loops endlessly in multi-container gateway + dashboard shared volume setups #34457

Closed as not planned

Description

@CMOS3

Bug Description

Running the official gateway + dashboard stack on a shared data volume (necessary to keep SQLite state databases, dynamic skills, and config in sync) triggers an endless, sub-second s6-log lock crash loop in the dashboard sidecar container under v0.15.0 and v0.15.1.

Steps to Reproduce

  1. Set up a standard multi-container Docker Compose stack containing both gateway and dashboard services.
  2. Bind-mount the same host data folder to both containers:
    - /volume1/docker/hermes/data:/opt/data
  3. Launch the stack: docker compose up -d
  4. The gateway container boots first and claims the shared logs lock.
  5. The dashboard container boots second, fails to lock the shared path, and crashes s6-log.
  6. Inspect the dashboard logs: docker logs hermes-dashboard

Expected Behavior

Both containers should boot and execute their respective services (gateway and web dashboard) peacefully while sharing the same underlying data directory without locking conflicts or crash-loops.

Actual Behavior

The dashboard container is trapped in an endless, rapid log-supervisor crash loop because it cannot acquire the lock on /opt/data/logs/gateways/default/lock (which is already held by the gateway container).

This loop creates a continuous, high-frequency stream of disk writes on the host (rattling mechanical hard drives on Btrfs/ext4 systems continuously).

Affected Component

Other

Messaging Platform (if gateway-related)

No response

Debug Report

Host Environment: Synology DS224+ (Intel Celeron J4125, 10GB RAM)
Orchestration: Docker Compose
Mount Type: Shared Btrfs host volume bind-mount

Operating System

Synology DSM 7.2+ (Linux Kernel 5.10.x)

Python Version

3.11.9

Hermes Version

0.15.1 (v2026.5.29)

Additional Logs / Traceback (optional)

s6-log: fatal: unable to lock /opt/data/logs/gateways/default/lock: Resource busy
s6-log: fatal: unable to lock /opt/data/logs/gateways/default/lock: Resource busy
s6-log: fatal: unable to lock /opt/data/logs/gateways/default/lock: Resource busy
s6-log: fatal: unable to lock /opt/data/logs/gateways/default/lock: Resource busy

Root Cause Analysis (optional)

In Hermes v0.15.0, process supervision via s6-overlay was introduced. Inside the base image, s6-log is hardcoded to acquire a file-level lock on /opt/data/logs/gateways/default/lock on startup.

Because both the gateway and dashboard containers share the /opt/data mount (to access the same SQLite database and user profiles/skills), they both execute s6-log targeting the exact same lock path. The first container locks the file successfully; the second container is immediately blocked with a Resource busy error, causing its s6-log service to crash and be continuously restarted by the container supervisor in a tight loop.

Proposed Fix (optional)

Decouple the s6-log locking path from the shared user data directory, or make the lock file path container-specific or configurable via an environment variable.

For example, s6-log could lock /opt/data/logs/gateways/default/lock-<hostname> or use a local container path like /var/log that is not bound to a shared host volume.

For end-users facing this, the immediate workaround is to map the logging directory of the sidecar container to an in-memory tmpfs volume in docker-compose.yml:

    tmpfs:
      - /opt/data/logs:uid=1026,gid=100,mode=1777

Activity

  1. added
    type/bugSomething isn't working
    P2Medium — degraded but workaround exists
    comp/gatewayGateway runner, session dispatch, delivery
    on May 29, 2026
  2. hulet commented on Jun 1, 2026

    @hulet

    Do we even want to fix this?
    https://hermes-agent.nousresearch.com/docs/user-guide/docker explicitly says "Never run two Hermes gateway containers against the same data directory simultaneously — session files and memory stores are not designed for concurrent write access." and "Running the dashboard as a separate container is not supported: its gateway-liveness detection requires a shared PID namespace with the gateway process."
    Doesn’t this issue describe an explicitly unsupported configuration?

  3. CMOS3 commented on Jun 1, 2026

    @CMOS3
    Author

    Hi @hulet ,

    Actually, this is the standard, officially documented configuration.
    If you look at the official docker-compose.yml blueprint in the repository, both the gateway (hermes) and the dashboard services are designed to map the exact same host volume (e.g., ~/.hermes) to /opt/data inside their respective containers. This shared volume is structurally necessary because the dashboard relies on direct access to /opt/data to read the active gateway's configuration, session SQLite databases, and current state.

    The issue reported here is a regression introduced in v0.15.0 with the transition to s6-overlay process supervision. The new s6-log utility attempts to acquire a hard file lock on /opt/data/logs/gateways/default/lock on startup.
    Because both containers boot simultaneously and share the volume, whichever container boots second (usually the dashboard) is blocked by the lock, crashes its logging subprocess, and is repeatedly restarted by the s6 supervisor.

    This lock collision can be resolved upstream by isolating the logger lock paths or appending unique container identifiers to the lock targets, which is what the proposed fix aims to address.

  4. hulet commented on Jun 1, 2026

    @hulet

    You're right this setup is still shown in docker-compose.yml and docker-compose.windows.yml. It looks like this should have been changed in commit 5671059f6, which updated the Docker Compose example at https://hermes-agent.nousresearch.com/docs/user-guide/docker#docker-compose-example, but failed to update the docker-compose.yml and docker-compose.windows.yml example files.

    I don't have a lot of history with this project, though, so my read on 5671059 and https://hermes-agent.nousresearch.com/docs/user-guide/docker could be wrong.

    #36235 would update docker-compose.yml and docker-compose.windows.yml to match 5671059.

    Have you tried the HERMES_DASHBOARD=1 flag?

  5. zjlariel commented on Jun 3, 2026

    @zjlariel

    I use the new docker-compose.windows.yml, it does work! thx!

  6. Jakeshadow commented on Jun 8, 2026

    @Jakeshadow

    s6-log lock collision when dashboard and gateway share a data volume. Fix: --volumes-from instead of shared bind mounts, or separate /var/log/hermes volume per container. Full multi-container guide (8 errors, verified fixes): https://hermesdocker.com

  7. hulet commented on Jun 8, 2026

    @hulet

    @Jakeshadow 5671059 deprecated the two-container setup in favor of the HERMES_DASHBOARD=1 flag, but failed to update the example docker-compose.yml (see #36235). https://hermes-agent.nousresearch.com/docs/user-guide/docker explicitly states "Running the dashboard as a separate container is not supported: its gateway-liveness detection requires a shared PID namespace with the gateway process." and "Never run two Hermes gateway containers against the same data directory simultaneously — session files and memory stores are not designed for concurrent write access.". You might update your site to describe how to use the HERMES_DASHBOARD=1 flag?

  8. teknium1 commented on Jul 13, 2026

    @teknium1
    Collaborator

    This is an automated hermes-sweeper review. Current main implements the requested fix for the shared-volume dashboard/gateway lock collision.

    • Commit aca11c227eb7e8b2f53f6e130d6e922455a573c1 (fix(docker): skip gateway reconciliation in dashboard container (autodetect), fix(docker): skip gateway reconciliation in dashboard container (autodetect) #46293) identifies this exact s6-log flock race and prevents the dashboard container from reconciling per-profile gateway services.
    • hermes_cli/container_boot.py:328-346 detects the dashboard role; hermes_cli/container_boot.py:544-560 skips reconciliation before it can create conflicting log services.
    • tests/hermes_cli/test_container_boot.py:934-962 verifies dashboard startup creates neither gateway-worker nor gateway-default service slots.
    • The fix is contained in release tag v2026.6.19.

    Thanks for the detailed reproduction and the discussion that traced the failure to the shared-volume compose setup.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Medium — degraded but workaround existsarea/install-updateInstaller, updater, packaging, wheels, doctorcomp/gatewayGateway runner, session dispatch, deliverysweeper:implemented-on-mainSweeper: behavior already present on current maintype/bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions