Repository navigation
Description
Bug Description
When booting the official docker container, it fails to start:
[stage2] Setup complete; starting user services
cont-init: info: /etc/cont-init.d/01-hermes-setup exited 0
cont-init: info: running /etc/cont-init.d/015-supervise-perms
[supervise-perms] chowned supervise/ trees for static s6-rc services
cont-init: info: /etc/cont-init.d/015-supervise-perms exited 0
cont-init: info: running /etc/cont-init.d/02-reconcile-profiles
reconcile: profile=default prior_state=stopped action=registered
reconcile: profile=kanban-worker prior_state=None action=registered
cont-init: info: /etc/cont-init.d/02-reconcile-profiles exited 0
s6-rc: info: service legacy-cont-init successfully started
s6-rc: info: service main-hermes: starting
s6-rc: info: service dashboard: starting
s6-rc: info: service main-hermes successfully started
s6-rc: info: service dashboard successfully started
s6-rc: info: service legacy-services: starting
s6-rc: info: service legacy-services successfully started
→ gateway is now running under s6 supervision (auto-restart on crash,
dashboard supervised alongside if HERMES_DASHBOARD is set).
This is the recommended setup for the s6 container image — the
gateway will keep running even if it crashes.
Use `--no-supervise` (or HERMES_GATEWAY_NO_SUPERVISE=1) to opt out
and get the pre-s6 foreground behavior instead.
Traceback (most recent call last):
File "/opt/hermes/.venv/bin/hermes", line 10, in <module>
sys.exit(main())
~~~~^^
File "/opt/hermes/hermes_cli/main.py", line 14303, in main
args.func(args)
~~~~~~~~~^^^^^^
File "/opt/hermes/hermes_cli/main.py", line 1853, in cmd_gateway
gateway_command(args)
~~~~~~~~~~~~~~~^^^^^^
File "/opt/hermes/hermes_cli/gateway.py", line 5135, in gateway_command
return _gateway_command_inner(args)
File "/opt/hermes/hermes_cli/gateway.py", line 5228, in _gateway_command_inner
if _maybe_redirect_run_to_s6_supervision(args):
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
File "/opt/hermes/hermes_cli/gateway.py", line 5220, in _maybe_redirect_run_to_s6_supervision
os.execvp("sleep", ["sleep", "infinity"])
~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<frozen os>", line 612, in execvp
File "<frozen os>", line 654, in _execvpe
File "<frozen os>", line 645, in _execvpe
FileNotFoundError: [Errno 2] No such file or directory
s6-rc: info: service legacy-services: stopping
s6-rc: info: service legacy-services successfully stopped
s6-rc: info: service main-hermes: stopping
s6-rc: info: service dashboard: stopping
s6-rc: info: service dashboard successfully stopped
s6-rc: info: service main-hermes successfully stopped
s6-rc: info: service legacy-cont-init: stopping
s6-rc: info: service legacy-cont-init successfully stopped
s6-rc: info: service fix-attrs: stopping
s6-rc: info: service fix-attrs successfully stopped
s6-rc: warning: service s6rc-oneshot-runner is marked as essential, not stopping it
Steps to Reproduce
- start docker container
I'm not doing anything unusual with it, though I did modify some system skills and install some python packages in the image.
Expected Behavior
hermes starts
Actual Behavior
hermes crashes
Affected Component
Gateway (Telegram/Discord/Slack/WhatsApp), Agent Core (conversation loop, context compression, memory)
Messaging Platform (if gateway-related)
N/A (CLI only)
Debug Report
when I run it within the image I just get what appears to be a default output: https://paste.rs/HD3st
this is not my configOperating System
Ubuntu 26.04
Python Version
whatever ships in the docker container
Hermes Version
2026.5.29 and up
Additional Logs / Traceback (optional)
Root Cause Analysis (optional)
courtesy of deepseek v4 flash:
The crash at os.execvp("sleep", ["sleep", "infinity"]) happens in _maybe_redirect_run_to_s6_supervision() after successfully dispatching the gateway to s6-supervise. It's supposed to keep the CMD process alive as a no-op heartbeat so /init doesn't start stage-3 shutdown.
Why does execvp("sleep", ...) fail?
The Python 3.13 _execvpe function calls get_exec_path(env) to build the search path list. get_exec_path reads the PATH environment variable from os.environ.
The most likely culprit: Under s6-overlay's environment model, the PATH that reaches Python might be affected. Here's the chain:
/initinvokes[main-wrapper.sh](http://main-wrapper.sh/)via#!/command/with-contenv sh— this loads env from/run/s6/container_environment/with-contenvruns as root, populates PATH from Dockerfile'sENV PATH=...- Script sources
.venv/bin/activatewhich prepends.venv/binto PATH s6-setuidgid hermesdrops privileges and exec'shermes gateway run- Inside Python,
os.execvp("sleep", ...)callsget_exec_path(os.environ)— but if PATH is somehow empty or truncated at this point,get_exec_pathreturns[""]or a list without/usr/bin, and the exec fails with ENOENT
I verified: get_exec_path with empty PATH "" returns [""], which makes os.path.join("", "sleep") = "sleep" — a relative path that fails. With a normal PATH, it works fine.
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
Activity
robotoole commentedon Jun 1, 2026
Hitting the same 2026.5.28 s6 regression, but a different symptom on Fly.io Machines (and any runtime that doesn't exec the image entrypoint as PID 1). Filing here since it shares the root cause; happy to split into a separate issue if you'd prefer.
Symptom
On Fly Machines the container crash-loops immediately. The s6-overlay init aborts because it isn't PID 1:
…then it reboots and repeats forever. This is upstream of the
execvp("sleep", …)traceback in the original report — here s6-overlay never gets far enough to start any service, it fatals ats6-overlay-suexecitself.Root cause / regression window (confirmed from image metadata)
The entrypoint switched from tini to s6-overlay between the date-based tags, and s6-overlay's hard PID-1 requirement is what breaks on Fly:
Entrypointv2026.5.16["/usr/bin/tini","-g","--","/opt/hermes/docker/entrypoint.sh"]v2026.5.28→latest(rebuilt 2026-06-01)["/init","/opt/hermes/docker/main-wrapper.sh"]can only run as pid 1, crash-loopThe contrast is the key point: on the tini image, not being PID 1 is just a warning and it keeps running —
— whereas s6-overlay treats it as fatal. On Fly Machines the platform's own init is PID 1 and execs the image entrypoint as a child, so
/initis never PID 1.HERMES_GATEWAY_NO_SUPERVISE=1/--no-supervisedoes not help hereThat opt-out is evaluated inside the Python gateway command (
_maybe_redirect_run_to_s6_supervisioninhermes_cli/gateway.py). Our crash is one layer earlier — at/init(s6-overlay-suexec) — which aborts before anyhermesPython runs. So there's no env-var escape hatch for non-PID-1 runtimes; the only workaround today is pinning to a pre-2026.5.28 (tini) image.Suggested fixes
main-wrapper.shdetect when it is not PID 1 and fall back to the pre-s6 foreground path (tini -- entrypoint.sh …) instead ofexec /init. A simple[ "$$" -eq 1 ]check would cover Fly/Nomad/and similar.Environment
[processes] app = "gateway run", no[http_service].nousresearch/hermes-agent(Docker Hub). Broken:latest/main(rev70e1571d, built 2026-06-01) and every tag fromv2026.5.28. Last good:v2026.5.16(reva91a57fa).v2026.5.16digest to stay up.Happy to test a patched image on Fly if that's useful.
fix(gateway): fall back to in-process heartbeat when s6 sleep is miss…
fix(gateway): fall back to in-process heartbeat when s6 sleep is miss…
Snurppa commentedon Jun 7, 2026
@robotoole I think you should file a separate issue. The PR touched only the other issue.
Fly.io deployments still going down, from both
v2026.6.5and latestmaintag (as of writing, this sha...Error
s6-overlay-suexec: fatal: can only run as pid 1, same error as reported in #38349🤷♂️
fix(gateway): fall back to in-process heartbeat when s6 sleep is miss…
fix(gateway): fall back to in-process heartbeat when s6 sleep is miss…
fix(gateway): fall back to in-process heartbeat when s6 sleep is miss…
fix(gateway): fall back to in-process heartbeat when s6 sleep is miss…
fix(gateway): fall back to in-process heartbeat when s6 sleep is miss…
fix(gateway): fall back to in-process heartbeat when s6 sleep is miss…
fix(gateway): fall back to in-process heartbeat when s6 sleep is miss…
fix(gateway): fall back to in-process heartbeat when s6 sleep is miss…
fix(gateway): fall back to in-process heartbeat when s6 sleep is miss…
fix(gateway): disarm the startup watchdog when `gateway run` hands of…
test(gateway): trim the s6 handoff watchdog tests to the two invariants
fix(memory): deliberate hindsight_retain saves coalesce into the sess…
fix(gateway): fall back to in-process heartbeat when s6 sleep is miss…