Managed with AI assistance. Reviewed by a human.
🛠️ Real incident

Recognizing Automatic Recovery from a Telegram Network Timeout

How to tell when a Telegram network timeout in Hermes has already recovered on its own.

Recognizing Automatic Recovery from a Telegram Network Timeout

Symptoms

Evidence

Check the service, process, platform state, and heartbeat:

hermes gateway status

ps -eo pid,ppid,stat,etime,%cpu,%mem,wchan:24,cmd \
  | grep -E '[h]ermes_cli.main gateway run|[h]ermes.*gateway'

jq '{gateway_state,active_agents,platforms,updated_at}' \
  ~/.hermes/gateway_state.json

stat -c '%y %n' ~/.hermes/state/gateway.heartbeat

The process was sleeping normally rather than job-control stopped. Hermes reported a transient Telegram network error while rebuilding the adapter:

Telegram polling degraded
Telegram network error
telegram-init timed out
rebuilding the adapter

Test the VM’s current Telegram path:

getent ahostsv4 api.telegram.org

curl -4 -sS -o /dev/null \
  -w 'HTTP %{http_code}, connect=%{time_connect}s, total=%{time_total}s\n' \
  --connect-timeout 5 \
  --max-time 12 \
  https://api.telegram.org/

Root cause

The VM experienced a short network timeout while polling Telegram. The existing Telegram updater did not stop before Hermes’s recovery deadline, so Hermes discarded and rebuilt the adapter.

This differed from a frozen gateway:

Resolution

No restart was required. Hermes rebuilt its Telegram adapter and returned to:

gateway_state: running
active_agents: 0
telegram.state: connected
telegram.error_code: null

The direct connectivity test returned an HTTP response from api.telegram.org, confirming the VM’s route had recovered.

When to restart

Wait briefly and recheck state before restarting:

sleep 15
jq '{gateway_state,active_agents,platforms,updated_at}' \
  ~/.hermes/gateway_state.json

Restart only if Telegram remains in retrying or error, the heartbeat stops advancing, and direct connectivity from the VM is healthy:

hermes gateway restart

Avoid repeated restarts during an actual network outage; they do not repair the underlying route and can interrupt active agent work.