puppeteer: [Bug]: ProtocolError: Network.getResponseBody timed out. Increase the 'protocolTimeout' setting in launch/connect calls for a higher timeout if needed.
Bug expectation
I expect this error to be managed by an exception handler, and not crash the app.
this is the full stack-trace:
ProtocolError: Network.getResponseBody timed out. Increase the 'protocolTimeout' setting in launch/connect calls for a higher timeout if needed.
at new Callback (/root/server/node_modules/puppeteer-core/lib/cjs/puppeteer/common/Connection.js:61:35)
at CallbackRegistry.create (/root/server/node_modules/puppeteer-core/lib/cjs/puppeteer/common/Connection.js:106:26)
at Connection._rawSend (/root/server/node_modules/puppeteer-core/lib/cjs/puppeteer/common/Connection.js:216:26)
at CDPSessionImpl.send (/root/server/node_modules/puppeteer-core/lib/cjs/puppeteer/common/Connection.js:425:78)
at next (/root/server/node_modules/puppeteer-extra-plugin-stealth/evasions/sourceurl/index.js:34:41)
at CDPSessionImpl.send (/root/server/node_modules/puppeteer-extra-plugin-stealth/evasions/sourceurl/index.js:67:18)
at /root/server/node_modules/puppeteer-core/lib/cjs/puppeteer/common/HTTPResponse.js:99:100
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async HTTPResponse.text (/root/server/node_modules/puppeteer-core/lib/cjs/puppeteer/api/HTTPResponse.js:98:25)
at async HTTPResponse.json (/root/server/node_modules/puppeteer-core/lib/cjs/puppeteer/api/HTTPResponse.js:110:25)
Bug behavior
- Flaky
Minimal, reproducible example
cannot share the example :)
Error string
ProtocolError: Network.getResponseBody timed out. Increase the ‘protocolTimeout’ setting in launch/connect calls for a higher timeout if needed.
Puppeteer configuration
No response
Puppeteer version
latest
Node version
latest
Package manager
npm
Package manager version
latest
Operating system
Linux
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 1
- Comments: 15
Commits related to this issue
- Run Puppeteer with the 'shell' headless setting This starts Chrome in its older headless mode, which currently resolves an error starting the Jest and Puppeteer based browser integration tests in Cir... — committed to 18F/tock by deleted user 2 years ago
- Run Puppeteer with the 'shell' headless setting This starts Chrome in its older headless mode, which currently resolves an error starting the Jest and Puppeteer based browser integration tests in Cir... — committed to 18F/tock by deleted user 2 years ago
@PiyushSuneja02
If you are using puppeteer < 22.x.x try something like this:
or
if you are in v22 or above:
As far as I understand from reading here, is the new headless mode generates hidden platform windows, and that could be the source of the problem on docker stripped environments. Setting the headless mode to the old one doesn’t try to build those platform windows, and that’s why I think this works.
Hope this helps you. Cheers.
HEllo did you find solution, I have same problem?
In my case this can be bypassed by setting headless: true instead of headless: ‘new’, but then I got a nasty warning.
This does not happen when the code runs locally, only when it runs on docker using ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true ENV PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium-browser