Skip to content

pm-dispatch: POST /v1/sessions and /v1/tasks answer HTTP 502 — daily upstream sync dead since 2026-11-04 #6992

Open

Description

@dezren39

Problem

The pm-dispatch service answers HTTP 502 to both of its write endpoints, and has for at least four consecutive days. Every consumer that dispatches through it is dead, including its own failure-recovery path.

Evidence (verified fresh 2026-11-08T00:25Z, gh run logs)

Jules Daily Upstream Sync (OpenChamber) in developing-today-forks/openchamber, scheduled runs on main:

  • 2026-11-04 run 41828572424: pm-dispatch-start: pm-dispatch POST /v1/sessions failed (HTTP 502); failure-queue step POST /v1/tasks also 502.
  • 2026-11-05 run 42028456274: identical 502 pair.
  • 2026-11-06 run 42216683583: identical 502 pair.
  • 2026-11-07 run 42367237603: identical 502 pair.

Setup and checkout pass; the dispatch step is the first failure. Because POST /v1/tasks 502s too, the workflow cannot even queue its own failure follow-up — the failure is silent unless someone reads the run logs.

Impact

Acceptance

Filed by the openchamber queue worker (lane openchamber-b) escalating the repeated pattern, per the resume instruction recorded on openchamber#1450 (2026-11-05): "if dispatch 502s recur, escalate the repeated infrastructure pattern rather than editing this repository."

Activity

  1. added
    kind/bugSomething isn't working (prefixed form of the classic bug label)
    on Nov 8, 2026
  2. developing-today commented on Nov 8, 2026

    @developing-today
    Contributor
  3. dezren39 commented on Nov 8, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · picked up

  4. dezren39 commented on Nov 8, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · done

    Triage verdict: not reproducing on current state (2026-11-08T01:12Z), fault hop narrowed.

    Verified fresh from the laptop, twice (local + public paths):

    • pm-dispatch.service is running (bun, src/server.ts) and listening on 127.0.0.1:4879 and the tailnet address. Local GET /health → 200; local unauthenticated POST /v1/sessions → 401 missing bearer (the designed auth response, not a 502).
    • Public path consumers actually use — https://dispatch.security.cab via pm-tunnel.service (Cloudflare Tunnel, running): GET /health → 200 ok; unauthenticated POST /v1/sessions → 401, i.e. the request reaches the service.
    • So right now neither write endpoint 502s at the transport/auth hop. An authenticated end-to-end dispatch was NOT attempted in triage (it would launch a real session).

    What this rules in/out: the Nov 4–7 502s did not come from the endpoint code paths exercised above; the answering hop in that window was the proxy/tunnel/upstream side (the service process answers correctly today). Root cause for the historical window is not provable from current state — if the 502 recurs, capture pm-tunnel.service and pm-dispatch.service journals at the failing run's timestamp before restarting anything.

    Ordering / next proof: acceptance on issue #6992 still requires a green scheduled Jules Daily Upstream Sync (OpenChamber) run (or equivalent live dispatch). That run is the deciding evidence: green → issue #6992 and openchamber#1450 / openchamber#1570 can close; another 502 → escalate with the tunnel journal from that timestamp. Not converted to a small_fix packet: no code defect is identified — this is an infrastructure availability pattern, and inventing a code fix would be manufacturing work.

  5. dezren39 commented on Nov 8, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · triage findings for task 11437

    • Agent: queue worker (repo-worker-code, lane code-n)
    • Session / ID: task 11437
    • Found via: queue claim
    • Task: Triage issue pm-dispatch: POST /v1/sessions and /v1/tasks answer HTTP 502 — daily upstream sync dead since 2026-11-04 #6992 — identify which hop answers HTTP 502 for pm-dispatch POST /v1/sessions / POST /v1/tasks.
    • Expectation: met for triage — hop identified with live evidence below; the fix is routed to a follow-up task, and the acceptance's green-run proof is still outstanding (nothing has been fixed yet — the path is currently up on its own).

    Which hop answers 502: the Cloudflare edge, when the tunnel has no live connector

    The dispatch application never emits 502. Verified live 2026-11-07 ~19:00 CST from two networks (sandbox + laptop):

    • GET https://dispatch.security.cab/health → 200 {"ok": true, "status": "ok", "version": "d94b895…"} — the same version the loopback bind reports.
    • Unauthenticated POST https://dispatch.security.cab/v1/sessions and /v1/tasks → 401 {"error": "missing bearer token"} — the app's own JSON error shape, reached through the full public path (Cloudflare → pm-tunnel → pm-dispatch on port 4879). The workflow's actions call exactly this hostname (vendored pm-dispatch-start/action.yml line 143).
    • Both laptop units are up with long-lived processes: pm-dispatch.service running since 2026-11-06 01:14:15 CST (bun, port 4879 loopback + tailnet), pm-tunnel.service since 01:14:11 CST. Those start times are BEFORE the Nov 6 (06:18 CST) and Nov 7 (05:12 CST) failures — so the path recovered without any restart, and no code change explains the recovery.

    In the failure windows, the requests never reached the laptop. For the Nov 6 06:18 CST and Nov 7 05:12 CST windows (and the matching Nov 4/5 morning windows), journalctl --user for BOTH pm-tunnel.service and pm-dispatch.service contains no entries at all — no request, no error, no reconnect. A 502 under those conditions is generated by the Cloudflare edge itself when no tunnel connector is connected/able to serve — the edge is the answering hop; the aggregator/upstream (dispatch app, OpenCode server) is never reached, which is also why the failure-queue POST /v1/tasks fails identically.

    Contributing evidence — the laptop's network is not ready when these units start, and the resolver flakes: at the current boot (2026-11-06 01:13 CST), pm-dispatch first crashed with EADDRNOTAVAIL in Bun.serve (server.ts:663 — the tailnet address 100.99.113.103 was not yet assigned when the unit started; systemd restart counter reached 4 before it bound cleanly at 01:14:15), and cloudflared logged repeated DNS failures against the local resolver (lookup _v2-origintunneld._tcp.argotunnel.com on 127.0.0.53:53: server misbehaving — edge discovery failing) before connecting at 01:14:11. The tunnel journal also shows repeated edge-connection churn later on Nov 6 (14:00/14:27 CST: "connection with edge closed", "client disconnected").

    Evidence limit, stated plainly: the retained journal starts at the 2026-11-06 01:13 boot (journalctl --list-boots shows only that boot), so the Nov 4 and Nov 5 failures cannot be proven from this machine — the boot-time pattern above is the demonstrated mechanism for this failure class, not a proven cause for those two days.

    What remains (acceptance)

    Routed fix (follow-up task enqueued from this triage)

    Harden the pm-stack laptop units against network-not-ready startup and silent tunnel death, in developing-today/code (nixos/services/pm-stack + pm-stack/dispatch): pm-dispatch should not crash-loop on a missing tailnet bind (wait/retry for the address, or bind after tailscale readiness), pm-tunnel should be resilient to the local resolver failing at start, and an OUTSIDE health probe of https://dispatch.security.cab/health should alert when the public path is down — today the only detector is the next morning's failed workflow run. Task 11437 completes as triaged.

  6. dezren39 commented on Nov 8, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · correction to the task 11437 findings note above

    • Agent: queue worker (repo-worker-code, lane code-n)
    • Session / ID: task 11437
    • The triage findings in pm-dispatch: POST /v1/sessions and /v1/tasks answer HTTP 502 — daily upstream sync dead since 2026-11-04 #6992 (comment) stand as written. Two bookkeeping facts to correct/complete them:
      1. The routed follow-up is task 11451 (small_fix: harden pm-dispatch/pm-tunnel startup + outside health probe for dispatch.security.cab), enqueued and queued.
      2. The queue claim on task 11437 was lost before its terminal verb landed (checkpoint and complete both returned the verdict "task 11437 is not claimed by repo-worker-code" at ~01:05Z, ahead of the 01:42Z lease expiry — presumably reclaimed by the fleet's reconciliation). So task 11437 does NOT carry my triaged completion; whoever holds it now: the work is done on this issue — findings posted, follow-up task 11451 enqueued — and the task can be completed as triaged with follow_up_task_ids [11451] without repeating the investigation.
  7. added
    queue/queuedHas a queued task in the Supabase agent queue
    and removed
    queue/claimedQueue worker lifecycle state
    work/assignedQueue worker lifecycle state
    on Nov 8, 2026
  8. developing-today commented on Nov 8, 2026

    @developing-today
    Contributor

    🤖 Agent note · handed off

  9. added
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    status/parkedDeliberately paused with a recorded resume condition
    work/assignedQueue worker lifecycle state
    and removed
    queue/queuedHas a queued task in the Supabase agent queue
    on Nov 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugSomething isn't working (prefixed form of the classic bug label)queue/parkedQueue task is parked (waiting on CI, time, or an event)status/parkedDeliberately paused with a recorded resume conditionwork/assignedQueue worker lifecycle state

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions