Skip to content

bug(deploy): start.sh --hosted upgrade checks the PROXY listener before the new web container answers, so Caddy stays on the plain listener and every visitor shares one address #4541

Closed

Description

@obasilakis

Build: v1.0.5-rc2 (af465288a) · Row: B15 of abilityai/trinity-enterprise#1189 · Env: DigitalOcean droplet made by trinity-do-create.sh at v1.0.0, untouched Caddyfile, upgraded with start.sh --hosted (driven by the public ops agent's scripts/update.sh, which runs start.sh --hosted --unattended)

What happens

On the upgrade run, Caddy is re-rendered on the ordinary listener (127.0.0.1:8081) and the run prints:

⚠️  Caddy: the web container's PROXY-protocol listener (127.0.0.1:18082) is not
    answering, so Caddy uses the ordinary listener (127.0.0.1:8081). ... visitors' addresses are NOT yet passed through ...
    On first boot this is expected — start.sh switches over once the stack is up.

The web image is rc2 and the listener exists. Seconds after the run, probe-proxy-listener.sh 18082 exits 0, and a plain re-run of start.sh --hosted --unattended switches Caddy to 18082 with proxy_protocol v2. So the check lost a race against the freshly recreated frontend container: the 5 × 2 s grace in start.sh before provision_caddyfile is too short.

Until someone re-runs start.sh, every visitor reaches Trinity as the proxy's address. The per-client sign-in limits and audit addresses from trinity-enterprise#873 then put the whole internet in one bucket: one wrong-code flood locks out everyone.

The update reports success (✓ hosted stack up; update.sh would also pass --verify, which checks HTML + asset + API, not client-address pass-through).

Repro

  1. DO droplet at v1.0.0 (untouched).
  2. Set TRINITY_IMAGE_TAG=v1.0.5-rc2 in .env, check out the tag, sudo ./scripts/deploy/start.sh --hosted --unattended.
  3. grep reverse_proxy /etc/caddy/Caddyfile gives 127.0.0.1:8081; the warning above is in the output.
  4. Re-run step 2's start.sh: 127.0.0.1:18082.

Seen 1 of 1 untouched v1.0.0 upgrade. A fresh rc2 install came up on 18082 directly.

Expected

The upgrade run waits for the listener the way it waits for FRONTEND_PORT (up to 90 s), so a single run ends on the PROXY listener. Optionally update.sh --verify flags a Caddy still on the ordinary listener when the running web image has the PROXY one.

Activity

  1. added
    priority-p2
    type-bug
    theme-infrastructure
    status-in-progress
    on Nov 13, 2026
  2. self-assigned this
    on Nov 13, 2026
  3. added
    status-in-dev
    and removed
    status-in-progress
    on Nov 13, 2026
  4. removed
    status-in-dev
    on Nov 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

priority-p2theme-infrastructuretype-bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions