Closed chandanadesilva closed 1 day ago
I am seeing this log, which shows that the launch process is timing out (I have set the time out at four minutes):
2024-09-10T03:31:57 Launching Browser
2024-09-10T03:35:57 /app/node_modules/puppeteer-core/lib/cjs/puppeteer/common/CallbackRegistry.js:96
2024-09-10T03:35:57 #error = new Errors_js_1.ProtocolError();
2024-09-10T03:35:57 ^
2024-09-10T03:35:57 ProtocolError: Network.enable timed out. Increase the 'protocolTimeout' setting in launch/connect calls for a higher timeout if needed.
2024-09-10T03:35:57 at <instance_members_initializer> (/app/node_modules/puppeteer-core/lib/cjs/puppeteer/common/CallbackRegistry.js:96:14)
2024-09-10T03:35:57 at new Callback (/app/node_modules/puppeteer-core/lib/cjs/puppeteer/common/CallbackRegistry.js:100:16)
2024-09-10T03:35:57 at CallbackRegistry.create (/app/node_modules/puppeteer-core/lib/cjs/puppeteer/common/CallbackRegistry.js:32:26)
2024-09-10T03:35:57 at Connection._rawSend (/app/node_modules/puppeteer-core/lib/cjs/puppeteer/cdp/Connection.js:91:26)
2024-09-10T03:35:57 at CdpCDPSession.send (/app/node_modules/puppeteer-core/lib/cjs/puppeteer/cdp/CDPSession.js:78:33)
2024-09-10T03:35:57 at NetworkManager.addClient (/app/node_modules/puppeteer-core/lib/cjs/puppeteer/cdp/NetworkManager.js:80:20)
2024-09-10T03:35:57 at FrameManager.initialize (/app/node_modules/puppeteer-core/lib/cjs/puppeteer/cdp/FrameManager.js:189:38)
2024-09-10T03:35:57 at #initialize (/app/node_modules/puppeteer-core/lib/cjs/puppeteer/cdp/Page.js:312:36)
2024-09-10T03:35:57 at CdpPage._create (/app/node_modules/puppeteer-core/lib/cjs/puppeteer/cdp/Page.js:98:31)
2024-09-10T03:35:57 at /app/node_modules/puppeteer-core/lib/cjs/puppeteer/cdp/Target.js:199:42
2024-09-10T03:35:57 Node.js v22.8.0
Hi,
Thank you @chandanadesilva for your report! My apologies for only getting back to you now.
I'm quite puzzled, I cannot think of a reason why you'd experience this... I'll try to replicate it in Fargate as well, soon. I'll keep you updated if I figure it out!
In case I can't reproduce it, would you be able to share the details of the specific instance you're running it under? Which AMI you're using, perhaps?
Hello @ccjmne Thanks for the reply. As I mentioned, the image works fine in my desktop (Fedora 38), but hangs when trying to run on Fargate. Fargate is the AWS ECS option where you don't need EC2 instances. So I can't say which is the underlying AMI.
I am wondering if the issue is with the Alpine distro, as there is no Chrome distribution for Alpine.
Because I had to get my project completed, I used https://github.com/bedrockio/export-html
Ah, thank you, @chandanadesilva, I didn't know what Fargate was exactly.
I'm curious as to how export-html
works, then, since it also delegates to puppeteer
...
I'm planning to investigate it in the near future, if only to figure it out for myself!
Thanks for following up, and thanks for pointing to an alternative that worked in that case!
@ccjmne , The export html image is debian, that may be one reason. Their app code also seems to be a a bit more resilient. I don't know NodeJS, so can't comment too much about the app
Hello,
I want to use the html2pdf image to run a PDF generation service. I have found that it works very well to generate PDFs when I use it on my desktop. Thank you very much for publishing this.
I am trying to run the html2pdf container in AWS ECS.
As I mentioned earlier, The image works fine on my local desktop, but when I run it under AWS ECS/Fargate, the process with launches seems to launch a number of chrome processes and hangs. I show here the state before and during the launch process: Before Launch
During Launch
This is the output of a curl command which I am using to test:
I wonder if you can help Thanks and regards Chandana