jackwener/OpenCLI · error · AuthRequiredError

www.reuters.com

Error message

www.reuters.com

What it means

The command throws AuthRequiredError for www.reuters.com when the in-page script reports result.authRequired, meaning the page is gated by login, subscription, or human verification. Reuters paywalls much of its content, so the tool refuses to proceed and tells the caller authentication is needed.

Source

Thrown at clis/reuters/article-detail.js:39

        { name: 'url', required: true, positional: true, help: 'Reuters article URL (must be on reuters.com)' },
    ],
    columns: ['title', 'date', 'section', 'section_path', 'authors', 'description', 'word_count', 'url', 'body'],
    func: async (page, kwargs) => {
        const url = String(kwargs.url || '').trim();
        if (!url) {
            throw new ArgumentError('Article URL cannot be empty');
        }
        if (!REUTERS_HOST.test(url)) {
            throw new ArgumentError(`URL must be on reuters.com, got ${url}`);
        }
        await page.goto(url);
        await page.wait(2);
        const result = await page.evaluate(buildArticleDetailScript());
        if (result?.error) {
            throw new CommandExecutionError(`Reuters article-detail failed inside the page: ${result.error}`);
        }
        if (result?.authRequired) {
            throw new AuthRequiredError('www.reuters.com', 'Reuters article-detail is gated by login, subscription, or human verification');
        }
        if (!result || result.ok !== true) {
            throw new CommandExecutionError(
                'Reuters article-detail returned no payload',
                'Check that the URL points to a Reuters article and that the page loaded',
            );
        }
        const detail = mapArticleDetail(result.body?.article, result.body?.bodyText, url);
        if (!detail || (!detail.title && !detail.body)) {
            throw new EmptyResultError('reuters article-detail', 'Page rendered no article body — likely paywalled or a non-article URL');
        }
        return [detail];
    },
});

View on GitHub (pinned to 49907e53dc)

Solutions

  1. Run the site's auth/login command to establish an authenticated reuters.com session
  2. Verify the session is still valid (re-login if credentials expired)
  3. Try a non-paywalled article to confirm the session works
  4. If bot-verification is the cause, slow down or use a warmer session

Example fix

// before
reuters article-detail "https://www.reuters.com/markets/paywalled-article/"  # AuthRequiredError
// after
reuters auth login           # establish reuters.com session
reuters article-detail "https://www.reuters.com/markets/paywalled-article/"
Defensive patterns

Strategy: fallback

Validate before calling

null

Type guard

null

Try / catch

try {
  return await reutersArticleDetail(url);
} catch (e) {
  if (e instanceof AuthRequiredError || /gated by login/.test(String(e.message))) {
    await runSiteAuthLogin('reuters');
    return await reutersArticleDetail(url);
  }
  throw e;
}

Prevention

When it happens

Trigger: Loading the article URL yields a paywall, login wall, or bot/human-verification page; the scraping script detects this state and sets authRequired, so the command raises AuthRequiredError instead of returning partial data.

Common situations: Reading paywalled subscriber-only articles without an authenticated session; Reuters bot-detection flagging the automated browser; region-locked content requiring sign-in; exhausted free-article quota for anonymous readers.

Related errors


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