Skip to content

Check npm install exit code before running node scripts#192

Merged
atheurer merged 2 commits into
masterfrom
fix-npm-install-error-handling
Jun 12, 2026
Merged

Check npm install exit code before running node scripts#192
atheurer merged 2 commits into
masterfrom
fix-npm-install-error-handling

Conversation

@atheurer

Copy link
Copy Markdown
Contributor

Summary

  • All 5 cdmq shell wrappers (add-run, delete-run, get-metric-data, get-primary-periods, get-result-summary) and start-server.sh pipe npm install output through tail -1 to keep logs clean, but this silently swallows errors
  • When npm fails (e.g. missing packages, network issues inside containers), the script proceeds to node which crashes on missing modules with no diagnostic output
  • Fix: capture npm output, check exit code, show full output only on failure; on success, still show just the summary line

Context

Discovered via agentic-perf automated benchmark run (PERF-D095E672): fio benchmark completed successfully but OpenSearch indexing failed with "Cannot find module 'piscina'" — npm install had failed silently inside the crucible controller container.

Test plan

  • Run add-run.sh with valid node_modules — should show one-line summary as before
  • Remove a package from node_modules, run add-run.sh — should show full npm error and exit non-zero
  • Verify start-server.sh handles npm ci failure for both cdmq and web-ui deps

🤖 Generated with Claude Code

npm install output was piped through tail -1 to keep run logs clean,
but this silently swallowed errors. When npm fails (e.g. missing
packages, network issues inside containers), the script proceeds to
node which crashes on missing modules with no diagnostic context.

Capture npm output, check the exit code, and show full output only
on failure. On success, still show just the summary line.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

@k-rister k-rister left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Anything interesting about why it failed?

@atheurer atheurer merged commit b7bb70b into master Jun 12, 2026
37 checks passed
@github-project-automation github-project-automation Bot moved this from In Progress to Done in Crucible Tracking Jun 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants