puppeteer: [Bug]: version 12.0.0 – Error: Unexpected extraInfo events for request on `page.goto`

Bug description

Steps to reproduce the problem:

  1. run a browserless/chrome docker image (https://hub.docker.com/r/browserless/chrome)
docker run --rm -it -p 3000:3000 -e DEBUG='browserless*' -e PREBOOT_CHROME=true -e MAX_CONCURRENT_SESSIONS=10 --name browserless browserless/chrome:latest
  1. try to load a page with puppeteer (puppeteer-core):
  const browser = await puppeteer.connect({ browserWSEndpoint: 'ws://localhost:3000' });
  const page = await browser.newPage();
  await page.goto('https://google.com', {
    waitUntil: 'networkidle2',
  });
  await page.screenshot({ path: 'puppeteer.png' })
  await browser.close();

Getting an exception (see the “Relevant log output”):

Error: Unexpected extraInfo events for request 8574FCDD373436FD23BAE6CB1FF3CAED

Added a console.log to print the extraInfos (see the “Relevant log output”):

With puppeteer v11.0.0 this doesn’t happen – same code, same browserless, only chaning the version in package.json and running yarn to install – the page loads and I’m getting the screenshot in the file.

Puppeteer version

12.0.0

Node.js version

v16.4.0

npm version

yarn 1.22.5

What operating system are you seeing the problem on?

macOS

Relevant log output

Puppeteer exception:

/Users/yurique/.../node_modules/puppeteer-core/lib/cjs/puppeteer/common/NetworkManager.js:347
            throw new Error('Unexpected extraInfo events for request ' + responseReceived.requestId);
                  ^

Error: Unexpected extraInfo events for request 8574FCDD373436FD23BAE6CB1FF3CAED
    at NetworkManager._emitResponseEvent (/Users/yurique/.../node_modules/puppeteer-core/lib/cjs/puppeteer/common/NetworkManager.js:347:19)
    at NetworkManager._onResponseReceived (/Users/yurique/.../node_modules/puppeteer-core/lib/cjs/puppeteer/common/NetworkManager.js:370:14)
    at /Users/yurique/.../node_modules/puppeteer-core/lib/cjs/vendor/mitt/src/index.js:51:62
    at Array.map (<anonymous>)
    at Object.emit (/Users/yurique/.../node_modules/puppeteer-core/lib/cjs/vendor/mitt/src/index.js:51:43)
    at CDPSession.emit (/Users/yurique/.../node_modules/puppeteer-core/lib/cjs/puppeteer/common/EventEmitter.js:72:22)
    at CDPSession._onMessage (/Users/yurique/.../node_modules/puppeteer-core/lib/cjs/puppeteer/common/Connection.js:245:18)
    at Connection._onMessage (/Users/yurique/.../node_modules/puppeteer-core/lib/cjs/puppeteer/common/Connection.js:117:25)
    at WebSocket.<anonymous> (/Users/yurique/.../node_modules/puppeteer-core/lib/cjs/puppeteer/node/NodeWebSocketTransport.js:13:32)
    at WebSocket.onMessage (/Users/yurique/.../node_modules/ws/lib/event-target.js:199:18)

console.log(extraInfos):

[
  {
    requestId: '8574FCDD373436FD23BAE6CB1FF3CAED',
    blockedCookies: [],
    headers: {
      status: '301',
      location: 'https://www.google.com/',
      'content-type': 'text/html; charset=UTF-8',
      'bfcache-opt-in': 'unload',
      date: 'Sun, 28 Nov 2021 01:24:14 GMT',
      expires: 'Tue, 28 Dec 2021 01:24:14 GMT',
      'cache-control': 'public, max-age=2592000',
      server: 'gws',
      'content-length': '220',
      'x-xss-protection': '0',
      'x-frame-options': 'SAMEORIGIN',
      'alt-svc': 'h3=":443"; ma=2592000,h3-29=":443"; ma=2592000,h3-Q050=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000,quic=":443"; ma=2592000; v="46,43"'
    }
  },
  {
    requestId: '8574FCDD373436FD23BAE6CB1FF3CAED',
    blockedCookies: [],
    headers: {
      status: '200',
      date: 'Sun, 28 Nov 2021 01:24:14 GMT',
      expires: '-1',
      'cache-control': 'private, max-age=0',
      'content-type': 'text/html; charset=UTF-8',
      'bfcache-opt-in': 'unload',
      p3p: 'CP="This is not a P3P policy! See g.co/p3phelp for more info."',
      'content-encoding': 'gzip',
      server: 'gws',
      'content-length': '41595',
      'x-xss-protection': '0',
      'x-frame-options': 'SAMEORIGIN',
      'set-cookie': '1P_JAR=2021-11-28-01; expires=Tue, 28-Dec-2021 01:24:14 GMT; path=/; domain=.google.com; Secure; SameSite=none\n' +
        'NID=511=HNG5DW5oAvTGM3MxEDI5w0cbS7BUiLM0i7vCtut0VnjatrLZPA0WG9nzN1CiIn3I72ZLtL4OXeO4msFkUZ5zYyX42rGAUgQPbbwkk_LqjVnbyxImeq-Nsrb9f3zAln1DjuF0WoSUTqR1iav_DqsLms_6rFD_aPnF5gQXW7so-cw; expires=Mon, 30-May-2022 01:24:14 GMT; path=/; domain=.google.com; HttpOnly',
      'alt-svc': 'h3=":443"; ma=2592000,h3-29=":443"; ma=2592000,h3-Q050=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000,quic=":443"; ma=2592000; v="46,43"'
    }
  }
]

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 6
  • Comments: 34 (4 by maintainers)

Commits related to this issue

Most upvoted comments

the problem is with the latest puppeteer version (12.0.0). Downgrading to version 11.0.0, if there is no way to update chromium, solves the problem:

yarn add puppeteer@11.0.0

I just released v12.0.1 that removes the failing assertion. Please give it a try and thanks everyone for reporting issues!

A temporal solution that prevents the application from exiting, is ignoring HTTTS errors like this:

const browser = await puppeteer.launch({
    headless: true,
    executablePath: '/usr/bin/chromium-browser',
    args: [
        '--no-sandbox',
        '--disable-setuid-sandbox',
        '--disable-dev-shm-usage',
    ],
    ignoreHTTPSErrors: true         // <- this flag
});

Apologies in advanced if I’ve done something wrong but I’m receiving these errors on Chrome 97

/project/node_modules/puppeteer/.local-chromium/linux-938248/chrome-linux/chrome --version
Chromium 97.0.4691.0 
/project/node_modules/puppeteer/lib/cjs/puppeteer/common/NetworkManager.js:346
            throw new Error('Unexpected extraInfo events for request ' + responseReceived.requestId);
                  ^

Error: Unexpected extraInfo events for request 131165.117
    at NetworkManager._emitResponseEvent (/project/node_modules/puppeteer/lib/cjs/puppeteer/common/NetworkManager.js:346:19)
    at NetworkManager._onResponseReceived (/project/node_modules/puppeteer/lib/cjs/puppeteer/common/NetworkManager.js:369:14)
    at /project/node_modules/puppeteer/lib/cjs/vendor/mitt/src/index.js:51:62
    at Array.map (<anonymous>)
    at Object.emit (/project/node_modules/puppeteer/lib/cjs/vendor/mitt/src/index.js:51:43)
    at CDPSession.emit (/project/node_modules/puppeteer/lib/cjs/puppeteer/common/EventEmitter.js:72:22)
    at CDPSession._onMessage (/project/node_modules/puppeteer/lib/cjs/puppeteer/common/Connection.js:245:18)
    at Connection._onMessage (/project/node_modules/puppeteer/lib/cjs/puppeteer/common/Connection.js:117:25)
    at WebSocket.<anonymous> (/project/node_modules/puppeteer/lib/cjs/puppeteer/node/NodeWebSocketTransport.js:13:32)
    at WebSocket.onMessage (/project/node_modules/ws/lib/event-target.js:199:18)

newer Chromium versions (e.g., 97.0.4692.0 or later)

Puppeteer 12.0.0 specifies 938248 in revisions.js which is prior to 97.0.4692.0

Version 12.0.0 is only compatible with the newer Chromium versions (e.g., 97.0.4692.0 or later) because of some breaking CDP changes.

Closing this issue because the error was suppressed in v12.0.1. The investigation and potential further fixes can be tracked via crbug.com/1274813

I filed a chromium bug to fix the bad ExtraInfo event behavior: https://bugs.chromium.org/p/chromium/issues/detail?id=1274813 In the meantime, @OrKoN’s change should make puppeteer stop throwing errors.

Ok, I see that the issue description has the minimal repro that I want and it occurs with up to date puppeteer and up to date chromium. Thanks!

@josepharhar

is this only happening with old versions of chromium and the new version of puppeteer?

It’s happened with actual puppeteer and Chrome.

a minimal puppeteer script which reproduces the problem?

https://github.com/zloirock/core-js/blob/5b39046ee5f57186122bc00ee2ef752be07496df/scripts/usage.mjs

How to reproduce:

  • Clone core-js
  • npm i
  • npm run usage-1000

Yeah, no problem, thanks for reporting! It took us a while to update the Chromium version bundled with Puppeteer (e.g., we do not have any releases for Chromium versions 94 - 96) due to the aforementioned CDP changes. If you encounter any other issues using v12 with Chromium 97+, let us know.