jackwener/OpenCLI · error · CommandExecutionError

amazon discussion page did not expose review summary (landed

Error message

amazon discussion page did not expose review summary (landed on ${landedUrl})

What it means

CommandExecutionError thrown as the final sanity check of the amazon discussion command: after normalization, neither average_rating_text nor total_review_count_text is present, so the CLI refuses to return an empty review summary. The message includes the URL actually landed on to help diagnose redirects or robot checks. This is the guard for 'the page rendered but had none of the expected review summary elements'.

Source

Thrown at clis/amazon/discussion.js:115

            positional: true,
            help: 'ASIN or product URL, for example B0FJS72893',
        },
        {
            name: 'limit',
            type: 'int',
            default: 10,
            help: 'Maximum number of review samples to return (default 10)',
        },
    ],
    columns: ['asin', 'average_rating_value', 'total_review_count'],
    func: async (page, kwargs) => {
        const input = String(kwargs.input ?? '');
        const limit = Math.max(1, Number(kwargs.limit) || 10);
        const payload = await readDiscussionPayload(page, input, limit);
        const normalized = normalizeDiscussionPayload(payload);
        if (!normalized.average_rating_text && !normalized.total_review_count_text) {
            const landedUrl = cleanText(payload.href) || buildDiscussionUrl(input);
            throw new CommandExecutionError(`amazon discussion page did not expose review summary (landed on ${landedUrl})`, 'The review page may have changed or hit a robot check. Open the review page in Chrome and retry.');
        }
        return [normalized];
    },
});
export const __test__ = {
    normalizeDiscussionPayload,
    hasDiscussionSummary,
    isSignInState,
};

View on GitHub (pinned to 49907e53dc)

Solutions

  1. Open the landed URL (in the message) in Chrome, complete any captcha, confirm reviews show, and retry
  2. Verify the product actually has reviews; zero-review products may trip this
  3. Retry with backoff — transient robot checks are common under rapid scraping
  4. If persistent on pages that render manually, update the [data-hook=...] selectors in readCurrentDiscussionPayload for the new layout
Defensive patterns

Strategy: retry

Try / catch

async function getDiscussion(asin, tries = 3) {
  try {
    return await opencli.call('amazon discussion', { input: asin });
  } catch (e) {
    if (/did not expose review summary/.test(e.message) && tries > 0) {
      await sleep(5000);
      return getDiscussion(asin, tries - 1);
    }
    throw e;
  }
}

Prevention

When it happens

Trigger: Running amazon discussion where readDiscussionPayload returned a payload (from the review or product page) lacking both [data-hook=rating-out-of-text] and [data-hook=total-review-count] content — e.g. a robot-check page, an interstitial, or a markup change landed at the URL printed in the message.

Common situations: Amazon captcha/robot interstitial replacing the review page; Amazon A/B layout change renaming data-hook attributes; product with no reviews rendered on a variant page; regional redirect to a page with different markup.

Related errors


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