Skip to content

fix: System.run treated any stderr output as a fatal error - #84

Merged
frostebite merged 2 commits into
mainfrom
fix/system-run-stderr-not-error
Aug 14, 2026
Merged

fix: System.run treated any stderr output as a fatal error#84
frostebite merged 2 commits into
mainfrom
fix/system-run-stderr-not-error

Conversation

@frostebite

Copy link
Copy Markdown
Member

Fourth bug in the same chain as #79/#81/#82, found by re-running unity-activate#111's CI against v0.1.5.

The bug

System.run rejected on any non-empty stderr, regardless of exit code:

if (runResult.error !== '') {
  reject(new Error(errorMessage));
  return;
}

docker run writes Unable to find image '...' locally to stderr as pure status output when it needs to auto-pull an image — then pulls it and exits 0. The log showed exactly this: Digest: ... / Status: Downloaded newer image for ... (a successful pull) followed immediately by [ERROR] Error: Unable to find image ... locally — the run had already succeeded by the time the error was thrown.

The fix

Check the exit code instead. stderr content is still included in the thrown error message when a command genuinely fails (non-zero exit).

How I found it

v0.1.5 (with #81/#82) got unity-activate#111 past engine detection, target-platform validation, and the broken image tag — this is what showed up next. unityci/editor:ubuntu-2019.2.17f1-base-3 pulled successfully (visible in the log) right before the run was thrown as failed anyway.

Testing

  • New tests in system.test.ts: succeeds when stderr has output but exit code is 0; throws on non-zero exit even with empty stderr; throws with stderr content included when a command genuinely fails.
  • bun run test — 151 pass, 3 skip, 0 fail.

🤖 Generated with Claude Code

Fourth bug in the unity-activate#111 chain. docker run writes "Unable to
find image '...' locally" to stderr as pure informational output when
auto-pulling an uncached image, then proceeds to pull it and succeed with
exit code 0. System.run threw on that anyway, discarding an otherwise
successful run, because it treated *any* non-empty stderr as failure
regardless of exit code.

Now checks the exit code instead. stderr content is still surfaced in the
thrown error message when a command genuinely fails.
@coderabbitai

coderabbitai Bot commented Aug 14, 2026

Copy link
Copy Markdown

Important

Review available on request

  • 🔍 Trigger review

Reviews should be triggered manually for repositories with fewer than 10 stars. Select Trigger review above or comment @coderabbitai review to review the latest changes. For a full review, comment @coderabbitai full review.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: e87e93a4-3f3a-4913-9053-5c029f81b9ef


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@frostebite
frostebite merged commit 8912156 into main Aug 14, 2026
15 checks passed
@frostebite
frostebite deleted the fix/system-run-stderr-not-error branch August 14, 2026 19:50
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