ErrLookup › Background articles › CommandExecutionError: Command Ran, But the Result Was Wrong — Common Causes and Fixes

CommandExecutionError: Command Ran, But the Result Was Wrong — Common Causes and Fixes

CommandExecutionError is a wrapper error thrown when a CLI command executed but something went wrong during that execution — a failed browser-automation step, an unexpected HTTP status, a malformed API payload, or a scrape that returned nothing the parser recognizes. Developers usually meet it in the jackwener/OpenCLI tooling (codex, reddit, bilibili, twitter, trip/ctrip, archive.org and other site adapters), where the message text after the prefix points at the real failure underneath.

Distilled from 2,073 documented records across 3 repositories.

Background

CommandExecutionError in these records is not an error a remote service returns; it is the CLI's own classification for 'the command I ran failed while running.' It is thrown at the orchestration layer of the OpenCLI command framework, typically with code COMMAND_EXEC and exit code 1, wrapping a lower-level failure whose details are folded into the message. That wrapping is deliberate: raw browser exceptions and in-page script errors are often not serializable or not meaningful on the Node side, so the library normalizes them into a single error whose message embeds the cause (an HTTP status, a JSON envelope code, a probe object, or the inner exception text).

The family covers two broad sub-kinds. The first is transport-level failures: a page.evaluate() call rejected, the browser tab navigated or closed mid-script, the bridge connection dropped, or a fetch rejected before a response arrived (DNS failure, timeout, TLS error, connection reset). The second is result-validation failures: the command completed, but the returned data failed an integrity check — a Codex extract-diff script returned a non-array, a Trip.com payload lacked its grouplist array, an archive.org metadata response had a non-array files field, a Booking.com hotel row lacked a canonical name/slug/URL, or a clicked filter chip never became active. In both cases the library prefers throwing over silently returning empty or corrupted results.

The library distinguishes this family from sibling errors, and that distinction is the key to debugging. Auth problems throw AuthRequiredError (don't re-login on a CommandExecutionError like 'HTTP 429 from /api/auth/session'); legitimately empty search results throw EmptyResultError (as the Ctrip ferry adapter does, reserving CommandExecutionError for 'rows rendered but the parser found nothing'); recognized API auth codes in mubu envelopes are routed to AuthRequiredError while unrecognized codes land here. When you see CommandExecutionError, read the message after the prefix: it usually names the failing step, the endpoint, the HTTP status, or the actual malformed value, and record-specific pages cover each variant in depth.

Because most OpenCLI commands drive live third-party sites through browser automation (Strategy.INTERCEPT network capture, in-page IIFE scrapes, signed-CDN two-step downloads), the dominant failure modes are environmental: page context destroyed mid-evaluate, Cloudflare or anti-bot interstitials, markup drift after a site redesign, and rate-limiting on shared egress IPs. Several variants also carry their own embedded diagnostics — lastAttribute for Bilibili relation polls, the serialized probe JSON for Linux.do verification, available=[...] model labels for Trae — so the message itself is usually the fastest diagnostic.

Common causes

What usually fixes it

Go deeper

Documented occurrences

…and 2,053 more across the corpus — use search.

Honest provenance: generated on 2026-08-29 from AI-assisted analysis of the linked records. See how records are made.