Skip to content

fix(showcase): install curl in TS runtime stages — watchdog probes were silently exiting rc=127 - #4174

Merged
jpr5 merged 1 commit into
mainfrom
fix/ts-runtime-curl
Apr 22, 2026
Merged

jpr5 merged 1 commit into
mainfrom
fix/ts-runtime-curl

Conversation

@jpr5

@jpr5 jpr5 commented Apr 22, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add curl to the runtime apt-get install line in:
    • showcase/starters/template/dockerfiles/Dockerfile.typescript
    • showcase/packages/{claude-sdk-typescript,langgraph-typescript,mastra}/Dockerfile
    • 3 starter Dockerfiles (regenerated from template)

Why

Multi-stage Docker refactor (#4147) moved TS showcase services to node:22-slim runtime. That base image doesn't include curl. The watchdog's liveness probe invokes curl -sS --max-time 5 http://127.0.0.1:8124/ok — which exits rc=127 "command not found" every cycle. After 180s grace + 3×30s strikes the watchdog kills the agent. Railway auto-restarts. Loop forever.

Verified via railway ssh:

sh: 1: curl: not found
rc=127

while ss -tlnp on the same container confirmed both :8123 (langgraph-api) and :8124 (liveness.mjs) LISTEN. The agent was always healthy — the probe was broken.

Test plan

  • Local amd64 docker build for starter+package variants succeeds
  • docker run ... sh -c "which curl" prints /usr/bin/curl
  • After Railway redeploy of langgraph-typescript, steady-state: no kill-loop, /api/health green

… silently exiting rc=127

The multi-stage Docker refactor (#4147) moved TypeScript showcase services
to `node:22-slim` runtime. That base image does NOT include `curl`.

entrypoint.sh's watchdog runs `curl -sS --max-time 5 http://127.0.0.1:8124/ok`
every 5s to probe the liveness endpoint. Without curl the probe exits
rc=127 "command not found" every cycle. After 180s grace + 3x30s strikes
the watchdog kills the agent process. Railway auto-restarts. Kill-loop
forever.

Verified via `railway ssh --service showcase-langgraph-typescript`:

    sh: 1: curl: not found
    rc=127

while `ss -tlnp` on the same container confirmed BOTH 0.0.0.0:8123
(langgraph-api) and 0.0.0.0:8124 (liveness.mjs) LISTEN. The agent
servers were healthy the whole time — the probe tool was missing.

Fix: add `apt-get install -y --no-install-recommends curl` to the
runtime stage of:

  - showcase/starters/template/dockerfiles/Dockerfile.typescript (source)
  - showcase/packages/claude-sdk-typescript/Dockerfile
  - showcase/packages/langgraph-typescript/Dockerfile
  - showcase/packages/mastra/Dockerfile

3 starter Dockerfiles regenerated from the template via
`pnpm -C showcase/scripts generate-starters`.

Python/Java/.NET services already install curl (they need it for
NodeSource or similar) and are unaffected.

Smoke: local `docker build --platform linux/amd64` for both
starter + package variants succeeded; `docker run ... sh -c "which curl"`
prints /usr/bin/curl in both.
@vercel

vercel Bot commented Apr 22, 2026 •

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
chat-with-your-data Ready Ready Preview, Comment Apr 22, 2026 8:36pm
docs Ready Ready Preview, Comment Apr 22, 2026 8:36pm
form-filling Ready Ready Preview, Comment Apr 22, 2026 8:36pm
research-canvas Ready Ready Preview, Comment Apr 22, 2026 8:36pm
travel Ready Ready Preview, Comment Apr 22, 2026 8:36pm

Request Review

@github-actions

Copy link
Copy Markdown
Contributor

📣 Social Copy Generator

Generate social media copies (Twitter/X, LinkedIn, Blog Post) for this PR using Claude.

  • Generate social media copies

@jpr5
jpr5 merged commit 1b2fd1e into main Apr 22, 2026
12 checks passed
@jpr5
jpr5 deleted the fix/ts-runtime-curl branch April 22, 2026 20:38
zeekay pushed a commit to Dream-AI-4444/CopilotKit that referenced this pull request Sep 11, 2026
…re silently exiting rc=127 (CopilotKit#4174)

## Summary
- Add `curl` to the runtime `apt-get install` line in:
  - `showcase/starters/template/dockerfiles/Dockerfile.typescript`
-
`showcase/packages/{claude-sdk-typescript,langgraph-typescript,mastra}/Dockerfile`
  - 3 starter Dockerfiles (regenerated from template)

## Why
Multi-stage Docker refactor (CopilotKit#4147) moved TS showcase services to
`node:22-slim` runtime. That base image doesn't include `curl`. The
watchdog's liveness probe invokes `curl -sS --max-time 5
http://127.0.0.1:8124/ok` — which exits `rc=127 "command not found"`
every cycle. After 180s grace + 3×30s strikes the watchdog kills the
agent. Railway auto-restarts. Loop forever.

Verified via `railway ssh`:
```
sh: 1: curl: not found
rc=127
```
while `ss -tlnp` on the same container confirmed both :8123
(langgraph-api) and :8124 (liveness.mjs) LISTEN. The agent was always
healthy — the probe was broken.

## Test plan
- [ ] Local amd64 docker build for starter+package variants succeeds
- [ ] `docker run ... sh -c "which curl"` prints `/usr/bin/curl`
- [ ] After Railway redeploy of langgraph-typescript, steady-state: no
kill-loop, `/api/health` green

This branch was successfully deployed

5 active deployments
Preview – research-canvas — 575360cd Deployed Apr 22, 2026 by vercel[bot]
Preview – travel — 575360cd Deployed Apr 22, 2026 by vercel[bot]
Preview – docs — 575360cd Deployed Apr 22, 2026 by vercel[bot]
Preview – chat-with-your-data — 575360cd Deployed Apr 22, 2026 by vercel[bot]
Preview – form-filling — 575360cd Deployed Apr 22, 2026 by vercel[bot]
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