Skip to content

Gateway not auto-starting after upgrade from tini-based to s6-overlay image — missing migration for gateway_state.json #34339

@yang-zhou

Description

@yang-zhou

Description

After upgrading from the tini-based Docker image (v14.x) to the latest s6-overlay image, the gateway no longer starts automatically on container boot. The dashboard and other s6 services start fine, but the gateway remains stopped.

Root Cause

The new s6 reconciler (02-reconcile-profiles) reads gateway_state.json to decide whether to auto-start the gateway. When upgrading from the old tini image:

  1. The old image had no gateway_state.json — gateway was started directly via CMD (gateway run)
  2. The new image's reconciler sees no valid state file (or state ≠ running) and skips gateway startup
  3. Users who relied on command: gateway run in docker-compose find their gateway silently not running after the upgrade

Steps to Reproduce

  1. Run hermes-agent with the tini-based image using command: gateway run in docker-compose
  2. Pull nousresearch/hermes-agent:latest (s6-overlay version)
  3. Restart the container
  4. Gateway does not start; hermes gateway status shows stopped

Expected Behavior

On first boot after upgrade, if no gateway_state.json exists and the container CMD is gateway run, the gateway should start automatically (and persist state as running for future restarts).

Workaround

Manually start the gateway after upgrade:

docker exec <container> hermes gateway start
Or manually create the state file on the host:

echo '{"state": "running"}' > ~/.hermes/gateway_state.json
Suggested Fix
In 02-reconcile-profiles (or container_boot.py), add a migration check: if gateway_state.json does not exist AND the container CMD contains gateway run, seed the state as running so the reconciler brings it up. This preserves the behavior users had with the tini image.

Environment
Docker on UGOS (UGREEN NAS)
Upgraded from tini-based image (v14.x) to latest s6-overlay image
docker-compose with command: gateway run

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Medium — degraded but workaround existsarea/dockerDocker image, Compose, packagingcomp/gatewayGateway runner, session dispatch, deliverytype/bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions