Skip to content

docs: add ecosystem.config.cjs.example + cf-tunnel debug notes#31

Open
AdaInTheLab wants to merge 1 commit intomainfrom
fix/cf-tunnel-local-managed
Open

docs: add ecosystem.config.cjs.example + cf-tunnel debug notes#31
AdaInTheLab wants to merge 1 commit intomainfrom
fix/cf-tunnel-local-managed

Conversation

@AdaInTheLab
Copy link
Copy Markdown
Owner

Summary

Document the cf-tunnel topology that caused today's outage so the fix is reachable from the repo next time, not just from memory.

Background

`api.thehumanpatternlab.com` started returning Cloudflare error 1033 / HTTP 530 ("Argo Tunnel: no available origin"). `pm2 logs cf-tunnel --err` showed an infinite loop of:

`Provided Tunnel token is not valid.`

Root cause: the cf-tunnel block in production's `ecosystem.config.cjs` was using the `--token ` form, but the tunnel was created locally (`cloudflared tunnel create`) — those are mutually exclusive auth shapes. Locally-managed tunnels authenticate via the cred file at `~/.cloudflared/.json`. Fix on the box: change `args` to `["tunnel", "run", "lab-api"]`.

`ecosystem.config.cjs` itself is gitignored (deliberately — it has `SESSION_SECRET`), so this PR doesn't fix prod directly. The fix is already live there. This PR captures the knowledge.

Changes

  • `ecosystem.config.cjs.example` — canonical template with placeholder values and a header comment explaining the locally-managed vs remote-managed tunnel auth trap. Anyone setting up a new server can copy this as their starting point.
  • `CHANGELOG.md` — `Unreleased` entry with two diagnostic recipes:
    1. The token-vs-cred-file mismatch (full symptoms + fix)
    2. Half-zombie PM2 entry recovery (`pm2 delete` + `pm2 start --only` + `pm2 save`)

Testing

  • All 41 tests pass (no behavior change)

Co-authored-by: Sage sage@thehumanpatternlab.com

Document the locally-managed Cloudflare Tunnel setup so the next time
the auth wedges itself ("Provided Tunnel token is not valid" 1033/530)
the fix path is recoverable from the repo, not from memory.

Changes:
- New ecosystem.config.cjs.example: canonical shape with placeholder
  values. Header comment explains the locally-managed vs remote-managed
  tunnel auth distinction (the trap that produced the outage). Real
  ecosystem.config.cjs stays gitignored.
- CHANGELOG "Unreleased" entry with two diagnostic recipes:
  1. token-vs-cred-file mismatch
  2. half-zombie PM2 entry recovery (delete + start --only)

Co-authored-by: Sage <sage@thehumanpatternlab.com>
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 3, 2026

😼📘 Carmel Epistemic Stamp™

📘 Carmel Epistemic Stamp™
😼📘💬 "Your logic is sound… shockingly."

PR: #31docs: add ecosystem.config.cjs.example + cf-tunnel debug notes
Author: @AdaInTheLab

This automated judgment has been issued by the Chief Judgment Office (CJO).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant