Skip to content

dev-proxy: hardcoded 120s build timeout makes docker rebuilds report a successful build as 'Build failed' #472

Description

@debugmcpdev

Summary

dev_rebuild_and_restart hardcodes a 120 s build timeout. A cold-cache npm run docker-build routinely exceeds that (the image is ~1.5 GB), and when the timeout trips the proxy reports Build failed: followed by a truncated tail of the Docker log — even though the build itself is fine. Re-running npm run docker-build by hand immediately afterwards succeeds and produces the image.

So the tool reports a successful build as a failure, and the accompanying output is a mid-RUN Dockerfile step rather than any diagnosis.

Current behavior

// tools/dev-proxy/dev-proxy.mjs:266
result = execSync(BUILD_CMD, {
  cwd: PROJECT_ROOT,
  encoding: 'utf-8',
  stdio: ['ignore', 'pipe', 'pipe'],
  timeout: 120000,          // hardcoded
  env: { ...process.env },
});
} catch (err) {
  const output = [err.stdout, err.stderr].filter(Boolean).join('\n') || err.message || String(err);
  throw new Error(`Build failed: ${sanitizeStderrTail(output, { maxLines: 20, maxChars: 2000 })}`);
}

execSync surfaces a timeout kill as a thrown error just like a non-zero exit, and the catch treats both identically. err.killed / err.signal === 'SIGTERM' are available and unused.

Observed

dev_rebuild_and_restart  (mcp-debugger-docker)
→ { "success": false,
    "error": "Build failed: …cp -r /app/packages/adapter-rust/dist
               /app/node_modules/@debugmcp/adapter-rust/ (last 20 of 1454 lines)" }

$ npm run docker-build      # same command, run directly
… #69 naming to docker.io/library/mcp-debugger:local done
$ echo $?
0

Note the 1454-line build log truncated to its last 20 lines — for a timeout that tail is always an arbitrary mid-build step, never the reason.

Requests

  1. Make the timeout configurable, alongside the other knobs the proxy already exposes as env vars (DEV_PROXY_PORT, DEV_PROXY_BUILD_CMD, DEV_PROXY_ROOT, DEV_PROXY_BACKEND_TRANSPORT) — e.g. DEV_PROXY_BUILD_TIMEOUT_MS. A docker-group proxy could then be configured with a realistic ceiling.
  2. Raise the default, or make it depend on the configured BUILD_CMD. 120 s is comfortable for npm run build but not for an image build.
  3. Distinguish a timeout from a build failure. On err.killed/SIGTERM, say so — "Build timed out after 120000 ms (raise DEV_PROXY_BUILD_TIMEOUT_MS); the build may still have succeeded, re-run manually to confirm" — instead of Build failed:. This is the part that actually costs time: the message sends you looking for a build regression that isn't there.

Impact

Dev tooling only (tools/dev-proxy/), no effect on the shipped server. Worth fixing because the docker group is unusable through dev_rebuild_and_restart on a cold cache, and the misreport is convincing enough to derail a debugging session — it did during a /testdebugger sweep, where the docker group had to be rebuilt out-of-band and restarted with dev_restart_debugger.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingenhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions