Skip to content

Puppeteer randomly throws Protocol Error

Information

The scraping application sometimes throws a Protocol warning when crawling websites. This behavior seems to be random. The exact warning is: Protocol error (Page.createIsolatedWorld): No frame for given id found

This warning seems to be related to the page.goto method and cannot be easily reproduced.

The scraping functionality works properly and the applications continues to operate without any other issues.

Environment

  • Puppeteer version: 13.1.3
  • Chromium version: 98.0.4758.0
  • Platform: KDE neon User Edition 5.23.4 Release: 20.04
  • NodeJs version: 12.22.7

Steps to reproduce

Cannot reproduce every time. It is often observed when visiting 10news.one

Stack Trace

(node:21854) UnhandledPromiseRejectionWarning: ProtocolError: Protocol error (Page.createIsolatedWorld): No frame for given id found
    at /home/manos/Workspace/scrape-titan/node_modules/puppeteer/lib/cjs/puppeteer/common/Connection.js:230:24
    at new Promise (<anonymous>)
    at CDPSession.send (/home/manos/Workspace/scrape-titan/node_modules/puppeteer/lib/cjs/puppeteer/common/Connection.js:226:16)
    at /home/manos/Workspace/scrape-titan/node_modules/puppeteer/lib/cjs/puppeteer/common/FrameManager.js:291:37
    at Array.map (<anonymous>)
    at FrameManager._ensureIsolatedWorld (/home/manos/Workspace/scrape-titan/node_modules/puppeteer/lib/cjs/puppeteer/common/FrameManager.js:291:14)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at async Promise.all (index 1)
    at async FrameManager.initialize (/home/manos/Workspace/scrape-titan/node_modules/puppeteer/lib/cjs/puppeteer/common/FrameManager.js:102:13)
    at async FrameManager._onAttachedToTarget (/home/manos/Workspace/scrape-titan/node_modules/puppeteer/lib/cjs/puppeteer/common/FrameManager.js:186:9)
(node:21854) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)
(node:21854) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.