Promise.all() called by html-pdf-chrome beforeNavigate() intermittently not resolving

Viewed 37

The below is from my https://github.com/westy92/html-pdf-chrome/issues/286#issue-718918879.

My Node.js application uses html-pdf-chrome to convert thousands of HTMLs to PDFs.

Intermittently (after several hours), the Promise.all() call in beforeNavigate() (https://github.com/westy92/html-pdf-chrome/blob/master/src/index.ts#L106-L110) does not resolve. As a result, my Node.js dependent that calls htmlPdf.create() also got stuck.

Due to the intermittence, I've split that into 3 separate await lines to insert console.debug() lines after each.

Based on those debugging statements, I've seen occurrences of either Runtime.enable() not resolving or Network.enable() not resolving.

Before I consider trying to handle this as a timeout problem (to potentially retry), I'm seeking for suggestions/ideas/help on how to debug this further.

I couldn't find past reports regarding such intermittent problem on GitHub or on SO.

The version of Node.js used is 12.16.3 on an AWS EC2 t2-medium instance.

The headless Chromium version is 706915 (installed as part of puppeteer@2.0.0 but I don't use anything from puppeteer itself). It is running on the same host as Node.js. It is started just before the Node.js process is started and there's no code that restarts the Chromium process. Newer precompiled Chromium instances don't work on this AWS EC2 (Linux ip-xxx-xxx-xxx-xxx 4.9.85-38.58.amzn1.x86_64 #1 SMP Wed Mar 14 01:17:26 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux).

0 Answers
Related