jackwener/OpenCLI · error · CommandExecutionError

Ctrip round-trip flight rows were missing required airline/f

Error message

Ctrip round-trip flight rows were missing required airline/flight/time/airport anchors

What it means

A CommandExecutionError thrown after filtering extracted rows down to 'complete' ones (those having departureTime, departureAirport, arrivalTime, arrivalAirport, and airline): if none of the extracted rows contain all required anchors, the CLI refuses to return partial garbage. Unlike error 916, rows were extracted, but every row is missing at least one required field.

Source

Thrown at clis/ctrip/flight-round.js:119

            .filter((r) => r.departureTime && r.departureAirport && r.arrivalTime && r.arrivalAirport && r.airline)
            .slice(0, limit)
            .map((r, i) => ({
                rank: i + 1,
                airline: r.airline,
                flightNo: r.flightNo,
                aircraft: r.aircraft,
                departureTime: r.departureTime,
                departureAirport: r.departureAirport,
                arrivalTime: r.arrivalTime,
                arrivalAirport: r.arrivalAirport,
                terminal: r.terminal,
                price: r.price,
                currency: r.currency,
                cabin: r.cabin,
                url: searchUrl,
            }));
        if (completeRows.length === 0) {
            throw new CommandExecutionError('Ctrip round-trip flight rows were missing required airline/flight/time/airport anchors');
        }
        return completeRows;
    },
});

export const __test__ = { WAIT_FOR_FLIGHTS_ROUND_JS, ROUND_CARD_SELECTOR };

View on GitHub (pinned to 49907e53dc)

Solutions

  1. Update to the latest library version where anchor extraction may have been fixed.
  2. Retry in case a transient render state (e.g. skeleton placeholders captured too early) produced incomplete rows.
  3. Inspect extracted cards in DevTools and report which anchor fields are absent to maintainers.
  4. Check whether Ctrip is serving a new card variant to your session/locale and consider using a standard logged-in profile.

Example fix

// before
const rows = await cli(['flight-round', ...]); // throws 'missing required ... anchors'
// after
await sleep(3000); // let inner fields finish rendering, then retry once
const rows = await cli(['flight-round', ...]);
Defensive patterns

Strategy: retry

Type guard

function isMissingAnchorsError(e) { return e && String(e.message || '').includes('missing required airline/flight/time/airport anchors'); }

Try / catch

try { return await runFlightRound(args); }
catch (e) { if (isMissingAnchorsError(e)) { await sleep(4000); return await runFlightRound(args); } throw e; }

Prevention

When it happens

Trigger: buildFlightExtractJs returns a non-empty array, but after .filter(r => r.departureTime && r.departureAirport && r.arrivalTime && r.arrivalAirport && r.airline) the completeRows array is empty.

Common situations: Ctrip card markup changed so time/airport/airline text lands in different nodes; a codeshare/skeleton-card layout that renders partial data; new card type (e.g. alternative transport suggestions) that the extractor scrapes but which lacks airport fields.

Related errors


AI-assisted analysis of jackwener/OpenCLI@49907e53dc (2026-08-29). Data as JSON: /api/errors/62dfe863239038d7. Report an issue: GitHub.