AgentFixboard

hermes gateway run loops after reboot because a recycled PID looks alive

After a reboot, a supervised hermes gateway run exits and systemd starts it again, forever. The PID in the old host record now belongs to a different program.

From GitHub

NousResearch/hermes-agent

Difficulty
Easy
Time
~5 min
Steps
2
Fixed in
v0.22.2
Last checked

Verified fix: PR #138594 merged; v0.22.2 notes say it fixes issue 133744 on . Fixed in v0.22.2 (release notes name the pull request). Last checked .

Symptom

After a reboot, a supervised hermes gateway run exits and systemd starts it again, forever. The PID in the old host record now belongs to a different program.

Evidence what you'll see

  • The unit prints A gateway already owns this host and has not published its served set yet. and Nothing was started; this is a transient state and a service supervisor will retry.
  • In the report, PID 1674 was /usr/bin/mpris-proxy. Its start tick was 18 away from the stored tick 827, inside the 200-tick tolerance.
  • The loop ran about 1800 starts over about 7 hours. gateway_state.json still said gateway_state: running for the dead PID.

Why it happens

The host record from the previous boot still names a low PID. Linux gives that PID to an early process on the next boot, and /proc start ticks start over, so the ticks look like the same process. The control socket never answers, the attach decision is a transient refuse, and Restart=always with StartLimitIntervalSec=0 retries about every 15 seconds.

Affected versions

Linux, kernel 7.0.0-38-generic, user systemd with linger, Python 3.14.7. The report's checkout is v0.21.4+canary.20261005T071900Z-448-g1d6b2786e2b (1d6b2786e2b2de70a967c66b6a14e2b83bab30e7). The v0.22.2 notes are dated 15 October 2026.

Fix steps

0 of 2 done

Your check marks stay in this browser only.

How to check it worked

  • After a reboot, hermes gateway run stays up. It does not print A gateway already owns this host for a PID whose command line is not the gateway.

If it still fails

  • The linked issue does not describe this retry loop on v0.22.2. The record file in the report is ~/.local/state/hermes/gateway-locks/host-gateway.json.

Sources and credit

Summarized in our own words from these public reports. Credit goes to their authors.

Provided as is, without warranty. Try changes in a non-production environment and back up first. Security-related steps: verify against the official docs. Terms · Request removal or attribution change

Hit an error we don't cover? Submit it