Puppeteer and Chromium crashing when generating PDF with url2pdf extension

Hi,

To generate PDFs, I run url2pdf extension, which requires puppeteer and chromium. Today the process of generating PDF started failing on the server (Docker deployments).

Upon investigation, I saw that Chromium had crashed on the server. The Chromium process keeps running and doesn't fully finish. As a result, it was utilising up to 100% of the CPU usage. I had to reboot the server to bring the status back to normal.

I have attached two screenshots of the web server logs showing puppeteer errors.

Has anyone come across this issue? I have tried to find information on the internet in case there's an issue with puppeteer and chromium versions, but there's no issue reported similar to what I am getting.

Any help in resolving this issue is greatly appreciated. For the time being, I have disabled the steps that generate PDF in the app, so that the server doesn't crash.

EDIT: The PDFs are being generated correctly in the local Docker deployment. This issue is happening in remote servers only.

Hi.
Two things you can check:

  1. The URL being called - is it correctly formed on the remote server? Because it says protocol timeout.
  2. SSH into the remote server and check if you are able to access/ping the URL being called. Could be that remote server's IP is blocked from accessing the said URL.

I am assuming here that you have already restarted your remote server after facing the problem. If not, please restart and try again.

Hi Sid,

Thank you for listing the likely areas that could be the reasons for puppeteer to fail.

It turned out that there was an incompatibility between the latest versions of Chromium and Alpine distro of NodeJS. So, to resolve the issue, I pinned the Alpine version to 3.19 in the Dockerfile, which uses a slightly older version of Chromium.

The PDFs are now generating correctly, and the server is also not crashing.

1 Like