NeoNomade
NeoNomade2y ago

random error about interception

I get this error randomly, from what I see is not related to anything in my code. I don't understand why.
DEBUG PuppeteerCrawler:SessionPool: Created new Session - session_rbfS2rOwye
/project/node_modules/puppeteer-core/lib/cjs/puppeteer/util/assert.js:18
throw new Error(message);
^

Error: Request Interception is not enabled!
at assert (/project/node_modules/puppeteer-core/lib/cjs/puppeteer/util/assert.js:18:15)
at CdpHTTPRequest.continue (/project/node_modules/puppeteer-core/lib/cjs/puppeteer/cdp/HTTPRequest.js:158:32)
at handleRequest (/project/node_modules/@crawlee/puppeteer/internals/utils/puppeteer_request_interception.js:99:12)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async masterHandler (/project/node_modules/@crawlee/puppeteer/internals/utils/puppeteer_request_interception.js:171:17)
at async CdpHTTPRequest.finalizeInterceptions (/project/node_modules/puppeteer-core/lib/cjs/puppeteer/cdp/HTTPRequest.js:87:9)

Node.js v21.6.2
DEBUG PuppeteerCrawler:SessionPool: Created new Session - session_rbfS2rOwye
/project/node_modules/puppeteer-core/lib/cjs/puppeteer/util/assert.js:18
throw new Error(message);
^

Error: Request Interception is not enabled!
at assert (/project/node_modules/puppeteer-core/lib/cjs/puppeteer/util/assert.js:18:15)
at CdpHTTPRequest.continue (/project/node_modules/puppeteer-core/lib/cjs/puppeteer/cdp/HTTPRequest.js:158:32)
at handleRequest (/project/node_modules/@crawlee/puppeteer/internals/utils/puppeteer_request_interception.js:99:12)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async masterHandler (/project/node_modules/@crawlee/puppeteer/internals/utils/puppeteer_request_interception.js:171:17)
at async CdpHTTPRequest.finalizeInterceptions (/project/node_modules/puppeteer-core/lib/cjs/puppeteer/cdp/HTTPRequest.js:87:9)

Node.js v21.6.2
9 Replies
memo23
memo232y ago
Interception is tied to page.on request event, check if you have something like that
NeoNomade
NeoNomadeOP2y ago
I know. I only have enqueueLinks and enqueueLinksByClickingElements I don't know if the second one is using page.on events
memo23
memo232y ago
I would start with Disabling and enabling the mentioned methods, also adding interception for check and in the end important part is checking definition of methods…
NeoNomade
NeoNomadeOP2y ago
@Andrey Bykov any ideas regarding this ? seems like it is tied to enqueueLinksByClickingElements
genetic-orange
genetic-orange2y ago
enqueueLinksByClickingElements is using request Interception indeed. I could assume there are some changes in the latest version of puppeteer and how it's handled, maybe also related to node 21. Will pass it to the team @NeoNomade btw which version of crawlee are you using?
NeoNomade
NeoNomadeOP2y ago
3.8.0 latest release
genetic-orange
genetic-orange2y ago
latest is 3.8.1 though, but thanks! Btw - could you provide minimum reproduction?
NeoNomade
NeoNomadeOP2y ago
@Andrey Bykov sorry for not following up. I just used the enqueueLinksByClickingElements. It is the last action on the page. Other than that I’m not doing anything special in particular @Andrey Bykov I was working for many hours and I made a stupid mistake. In the handler that contained the enqueueLinksByClickingElements I wasn't closing the page at the end ... I think this why it was failing. I'm testing right now to see if issue appears again.
genetic-orange
genetic-orange2y ago
Thanks for the heads-up! Let me know whether it solves it 👌

Did you find this page helpful?