jackwener/OpenCLI · error · CommandExecutionError

huodongxing events returned malformed extraction rows

Error message

huodongxing events returned malformed extraction rows

What it means

After the browser extracts event cards, requireExtractionRows expects payload { ok: true, rows: [...] }. If ok is true but rows is missing or not an array, the in-page extractor returned an unexpected shape, so this CommandExecutionError is thrown.

Source

Thrown at clis/huodongxing/events.js:279

    return {
      ok: false,
      code: 'EMPTY_RESULT',
      message: 'huodongxing events returned no data',
      hint: 'No Huodongxing event cards were found. The page may be empty or the DOM structure may have changed.',
    };
  }
  return { ok: true, rows };
}

function isTransientAccessPayload(result) {
  return unwrapEvaluateResult(result)?.code === 'TRANSIENT_ACCESS';
}

function requireExtractionRows(result) {
  const payload = unwrapEvaluateResult(result);
  if (payload?.ok === true && Array.isArray(payload.rows)) return payload.rows;
  if (payload?.ok === true) {
    throw new CommandExecutionError(
      'huodongxing events returned malformed extraction rows',
      'Expected browser extraction payload rows to be an array.',
    );
  }
  if (payload?.code === 'RATE_LIMIT') {
    throw new CommandExecutionError(
      payload.message || 'huodongxing events was rate limited by www.huodongxing.com',
      payload.hint || 'Wait a few minutes and retry from a real browser session.',
    );
  }
  if (payload?.code === 'TRANSIENT_ACCESS') {
    throw new CommandExecutionError(
      payload.message || 'huodongxing events page returned a temporary busy/access page',
      payload.hint || 'Wait and retry from the same browser session.',
    );
  }
  if (payload?.code === 'INVALID_LIMIT') {
    throw new ArgumentError(payload.message || 'huodongxing limit must be a positive integer <= 50');

View on GitHub (pinned to 49907e53dc)

Solutions

  1. Update the CLI to the latest version that matches the current huodongxing markup
  2. Retry the command; a transient page state may have produced the bad payload
  3. Inspect the browser session manually to confirm the events page renders normally
  4. If persistent, file/patch the extractor script so it always returns rows as an array

Example fix

// inside the page script
// before
return { ok: true, rows: extractCards() };
// after
const rows = extractCards();
return { ok: true, rows: Array.isArray(rows) ? rows : [] };
Defensive patterns

Strategy: retry

Type guard

const isExtractionPayload = p => p && typeof p === 'object' && p.ok === true && Array.isArray(p.rows);

Try / catch

try { const rows = extractEventRows(limit); } catch (e) { if (e instanceof CommandExecutionError && /malformed extraction rows/.test(e.message)) { /* retry once after a short delay; else report CLI/site mismatch */ } else throw e; }

Prevention

When it happens

Trigger: The page.evaluate extraction script returns { ok: true } without an array rows field — typically after a site DOM/markup change or a partially failed in-page script branch.

Common situations: huodongxing changed its event-card markup so the extractor returns no rows array; stale CLI version incompatible with the current site layout; anti-bot page partially satisfied the probe.

Understand the failure class

Related errors


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