{"record":{"id":"62dfe863239038d7","repo":"jackwener/OpenCLI","slug":"ctrip-round-trip-flight-rows-were-missing-required","errorCode":null,"errorMessage":"Ctrip round-trip flight rows were missing required airline/flight/time/airport anchors","messagePattern":"Ctrip round-trip flight rows were missing required airline/flight/time/airport anchors","errorType":"exception","errorClass":"CommandExecutionError","httpStatus":null,"severity":"error","filePath":"clis/ctrip/flight-round.js","lineNumber":119,"sourceCode":"            .filter((r) => r.departureTime && r.departureAirport && r.arrivalTime && r.arrivalAirport && r.airline)\n            .slice(0, limit)\n            .map((r, i) => ({\n                rank: i + 1,\n                airline: r.airline,\n                flightNo: r.flightNo,\n                aircraft: r.aircraft,\n                departureTime: r.departureTime,\n                departureAirport: r.departureAirport,\n                arrivalTime: r.arrivalTime,\n                arrivalAirport: r.arrivalAirport,\n                terminal: r.terminal,\n                price: r.price,\n                currency: r.currency,\n                cabin: r.cabin,\n                url: searchUrl,\n            }));\n        if (completeRows.length === 0) {\n            throw new CommandExecutionError('Ctrip round-trip flight rows were missing required airline/flight/time/airport anchors');\n        }\n        return completeRows;\n    },\n});\n\nexport const __test__ = { WAIT_FOR_FLIGHTS_ROUND_JS, ROUND_CARD_SELECTOR };\n","sourceCodeStart":101,"sourceCodeEnd":126,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/ctrip/flight-round.js#L101-L126","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Update to the latest library version where anchor extraction may have been fixed.","Retry in case a transient render state (e.g. skeleton placeholders captured too early) produced incomplete rows.","Inspect extracted cards in DevTools and report which anchor fields are absent to maintainers.","Check whether Ctrip is serving a new card variant to your session/locale and consider using a standard logged-in profile."],"exampleFix":"// before\nconst rows = await cli(['flight-round', ...]); // throws 'missing required ... anchors'\n// after\nawait sleep(3000); // let inner fields finish rendering, then retry once\nconst rows = await cli(['flight-round', ...]);","handlingStrategy":"retry","validationCode":null,"typeGuard":"function isMissingAnchorsError(e) { return e && String(e.message || '').includes('missing required airline/flight/time/airport anchors'); }","tryCatchPattern":"try { return await runFlightRound(args); }\ncatch (e) { if (isMissingAnchorsError(e)) { await sleep(4000); return await runFlightRound(args); } throw e; }","preventionTips":["Retry — skeleton/placeholder cards captured too early often complete on rerun.","Keep the library updated for extraction-anchor fixes.","Use a logged-in standard locale/session to avoid exotic card variants.","Report reproducible cases with the card markup to maintainers."],"tags":["scraping","dom-extraction","data-quality","ctrip","parser"],"backgroundTag":"dom-parser-drift","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}