jackwener/OpenCLI · error · CommandExecutionError

amazon review page redirected to sign-in and product page fa

Error message

amazon review page redirected to sign-in and product page fallback did not expose review summary

What it means

CommandExecutionError thrown when the review page redirected to sign-in but the product-page fallback DID load (not a sign-in state) yet still exposed no review summary (no average rating and no review count). The library cannot tell whether content is gated or the page changed, so it fails with a remediation hint instead of returning empty data.

Source

Thrown at clis/amazon/discussion.js:81

    const reviewUrl = buildDiscussionUrl(input);
    const reviewState = await gotoAndReadState(page, reviewUrl, 2500, 'discussion');
    assertUsableState(reviewState, 'discussion');
    const reviewPayload = await readCurrentDiscussionPayload(page, limit);
    if (hasDiscussionSummary(reviewPayload)) {
        return reviewPayload;
    }
    const productUrl = buildProductUrl(input);
    const productState = await gotoAndReadState(page, productUrl, 2500, 'discussion');
    assertUsableState(productState, 'discussion');
    if (isSignInState(reviewState) && isSignInState(productState)) {
        throw new AuthRequiredError(amazonHostFromInput(input) ?? DOMAIN, 'Amazon review discussion requires an active signed-in Amazon session in the shared Chrome profile.');
    }
    const productPayload = await readCurrentDiscussionPayload(page, limit);
    if (hasDiscussionSummary(productPayload)) {
        return productPayload;
    }
    if (isSignInState(reviewState)) {
        throw new CommandExecutionError('amazon review page redirected to sign-in and product page fallback did not expose review summary', 'Open the product page in Chrome, verify reviews are visible, and retry.');
    }
    return reviewPayload;
}
cli({
    site: 'amazon',
    name: 'discussion',
    access: 'read',
    description: 'Amazon review summary and sample customer discussion from product review pages',
    domain: 'amazon.com',
    strategy: Strategy.COOKIE,
    navigateBefore: false,
    args: [
        {
            name: 'input',
            required: true,
            positional: true,
            help: 'ASIN or product URL, for example B0FJS72893',
        },

View on GitHub (pinned to 49907e53dc)

Solutions

  1. Confirm the product actually has reviews — a zero-review product legitimately has no summary to expose
  2. Open the product page in Chrome, verify the review summary is visible signed-in, then retry
  3. Retry later or from a cleaner session if a robot check interfered
  4. If reviews are visible manually but the error persists, the data-hook selectors likely changed — report a scraping-selector bug
Defensive patterns

Strategy: fallback

Try / catch

try {
  return await opencli.call('amazon discussion', { input: asin });
} catch (e) {
  if (/product page fallback did not expose review summary/.test(e.message)) {
    // treat as 'no reviews available' or retry signed-in later
    return null;
  }
  throw e;
}

Prevention

When it happens

Trigger: readDiscussionPayload: reviewState is a sign-in page, product page loads normally, hasDiscussionSummary(productPayload) is false (no [data-hook=rating-out-of-text] or [data-hook=total-review-count] found), and reviewState.isSignInState is true — hitting the `if (isSignInState(reviewState))` branch at discussion.js:81.

Common situations: Products with zero reviews (no rating/count elements exist at all); Amazon A/B test removing those data-hook selectors; product page variant for obscure ASINs; partially working session where reviews are gated but the product page renders.

Related errors


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