Repository navigation
[eas-cli] Show simulator session errors in simulator:get - #4694
Conversation
simulator:start only printed the session status when a session errored before it was ready. The reason is already on the session's job run, so fetch turtleJobRun.errors and print each message (and docs link) on its own line.
…s for unknown errors Fetch job run errors with a separate query when a session fails instead of on every poll of the shared session query. When the job run only reports an unknown error, print the failed step errors from its logs. Also show the errors when a session fails after it is ready.
Move the job run error lookup and unknown-error log fallback into simulator/jobRunErrors so simulator:start and simulator:get share it. simulator:get fetches the errors only for errored sessions, prints them in a Session errors section, and always includes an errors array in --json.
|
Subscribed to pull request
Generated by CodeMention Warning: The preamble and epilogue options in commentConfiguration are deprecated. Use template instead. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4694 +/- ##
==========================================
+ Coverage 75.33% 75.37% +0.05%
==========================================
Files 1053 1054 +1
Lines 52257 52338 +81
Branches 11383 11446 +63
==========================================
+ Hits 39362 39445 +83
+ Misses 11907 11905 -2
Partials 988 988 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Drop the job run log fallback from this change, which printed unmasked err.message lines, read logs for stopped sessions and had no timeout or size limit. The bounded, masked log fallback lands in the simulator:get follow-up.
…e and mask-safe - Print only the masked log message of error-level lines, never err.message. - Prefer the failed step's lines, with its last stderr line that names a cause. - Read logs only when every job run error is an unknown error. - Cancel the errors query on Ctrl+C or after 10s by unsubscribing from urql. - Download through the proxy-aware fetch with a 20 MiB limit and its own 10s timeout, and always close the connection.
…ail' into @brent/simulator-get-errors
Give the lookup a 10s deadline and the session's Ctrl+C signal, and cancel its request by unsubscribing from urql, so it can't hold up stopping the session. Don't retry it or print the transient-error message, since it's best-effort. Cap each error message at 500 characters.
…idn't fail - Drop the whole-log fallback, which could show an error a successful step ignored instead of the job run's own message. - List the first failed step first, with its stderr cause and the line after it; later failed steps only add their error line. - Make the errors lookup quiet and not retried, like the base branch. - Keep the signed log URL out of debug output, and cap job run messages.
…ail' into @brent/simulator-get-errors
There was a problem hiding this comment.
LGTM, nice UX improvement!
Codex found one small P2 worth fixing while here (optional): strip terminal control characters from downloaded error messages and step names before printing them, so crafted log text cannot clear the terminal or spoof output.
— Codex
…rors Job run error messages and log lines from the session are printed in the terminal, so remove escape sequences and control characters before printing them. Match the stderr cause and skip empty error lines on the stripped text, so a colored "Error:" line is still found. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
Done in 669c0eb. Job run error messages, step names and log lines now have escape sequences and control characters stripped before they're printed, with newlines collapsed so a message can't fake extra lines. That also fixed a related bug: a colored |
…errors # Conflicts: # packages/eas-cli/src/commands/simulator/__tests__/index.test.ts # packages/eas-cli/src/commands/simulator/index.ts # packages/eas-cli/src/graphql/generated.ts # packages/eas-cli/src/graphql/queries/DeviceRunSessionQuery.ts # packages/eas-cli/src/graphql/queries/__tests__/DeviceRunSessionQuery-test.ts
|
✅ Thank you for adding a changeset! |
Why
eas simulator:geton a failed session showsStatus ERROREDand nothing about why, in both human and--jsonoutput.UNKNOWN_ERROR/UNKNOWN_CUSTOM_BUILD_ERROR, "Unknown error. See logs for more information." Every failedadborsimctlcall ends up there. The real cause is only in the job run log.How
Shared lookup (
src/simulator/jobRunErrors.ts, used bysimulator:startandsimulator:get):marker: end-step,result: fail): the stderr line that names an error, exception or fatal error, the stderr line right after it, and the step's last error-level line;msg, which the worker masks, and nevererr.messageorerr.stack, which it doesn't.msg(context.ts:310). For those, the CLI keeps the job run's own message, which already names the phase.errtoo.logFileUrls.fetch, which throws on status ≥ 400;AbortControlleris aborted infinally, so the connection closes even after a size-limit rejection.simulator:get: it looks up the errors only when the session or its job run isERRORED. Human output gets a "Session errors:" section, and--jsonalways includeserrors: [{ errorCode, message, docsUrl? }].Against a real Android session that failed with
UNKNOWN_ERROR(a launch argument with a space):Before, that printed "Unknown error. See logs for more information."
Test Plan
src/commands/simulator,jobRunErrors.test.ts,DeviceRunSessionQuery-test.tsandcreateGraphqlClient.err(nothing printed);src/fetch.ts, withhttps_proxycleared. They cover a 404, an oversized log, a stalled download, Ctrl+C, and an already-aborted signal, and check that the server sees the connection close.finallyabort; removing the unsubscribe on abort; restoring the whole-log fallback; logging the full download error.yarn typecheck,oxlintandoxfmt --checkpass.simulator:getfrom this branch against the production session above and an iOS session with a bad--device.🤖 Generated with Claude Code