PDF Export - Issue after Puppetter upgrade in 14820

PDF Export - Issue after Puppetter upgrade in 14820


Context:

After upgrading to Puppeteer from PhantomJS in Build 14820, some tickets have been raised with exceptions like "Error in Exporting Data." The server logs in the reports module may display errors similar to:


java.lang.Exception: {"error":{"message":"An `executablePath` or `channel` must be specified for `puppeteer-core`","stack":"Error: An `executablePath` or `channel` must be specified for `puppeteer-core`\n at assert (C:\\snapshot\\node_files\\node_modules\\puppeteer-core\\lib\\cjs\\puppeteer\\util\\assert.js:18:15)\n at ChromeLauncher.computeLaunchArguments (C:\\snapshot\\node_files\\node_modules\\puppeteer-core\\lib\\cjs\\puppeteer\\node\\ChromeLauncher.js:102:36)\n at async ChromeLauncher.launch (C:\\snapshot\\node_files\\node_modules\\puppeteer-core\\lib\\cjs\\puppeteer\\node\\ProductLauncher.js:69:28)\n at async C:\\snapshot\\node_files\\index.js:150:25","statuscode":200}}


Possible Reasons:

No Internet Connection: The server does not have an Internet connection to download Chromium.

Blocked URLs: The server blocks access to the following URLs:

https://storage.googleapis.com/

https://npmmirror.com/

SSL Issues: SSL issues with these URLs can prevent Chromium download.


Steps to Resolve:

Check Internet Connectivity:

If the internet access cannot be provided for security reasons, please be informed that it is a one-time process. After the PDF export is set up, the internet access can be blocked again.

Try accessing the URLs (https://storage.googleapis.com/ and https://npmmirror.com/) in a browser.

If the URLs are blocked, please ask the network team to allow them. If not feasible, manually download and install Chromium.


Manual Chromium Installation:


1. Download the appropriate PDF executable zip file from this link.

2. Extract the zip file to the /custom/pdffolder directory.

3. Restart the service and attempt the PDF export again.


Check Configuration File:


If the issue still persists,

 

1. Navigate to /custom/pdffolder/.pcr-stats.json. If this file is missing, create it with the following content:



{
   "puppeteerVersion": "21.11.0",
   "platform": "win64",
   "revision": "<revision number from the LAST_CHANGE API>",
   "cacheDir": "Build pdffolder directory",
   "snapshotsDir": "Chromium folder",
   "executablePath": "Chromium executable path"
}


Sample Configuration:



{
   "puppeteerVersion": "21.11.0",
   "platform": "win64",
   "revision": "1343995",
   "cacheDir": "C:/Builds/Natraj/sdp_preview/AdventNet/ME/ServiceDesk/custom/clientUtils",
   "snapshotsDir": "C:/Builds/Natraj/sdp_preview/AdventNet/ME/ServiceDesk/custom/clientUtils/.chromium-browser-snapshots",
   "executablePath": "C:/Builds/Natraj/sdp_preview/AdventNet/ME/ServiceDesk/custom/clientUtils/.chromium-browser-snapshots/chromium/win64-1343995/chrome-win/chrome.exe"
}


If it is present but couldn't find the  "executablePath" , then please follow the Manual Chromium Installation process.


Manual Installation Process:


Access the latest revision ID from the following URLs:


Windows: Link

Linux: Link


Download Chromium using the obtained revision ID:

Windows: https://storage.googleapis.com/chromium-browser-snapshots/Win_x64/${revision}/chrome-win.zip

Linux: https://storage.googleapis.com/chromium-browser-snapshots/Linux_x64/${revision}/chrome-linux.zip

(where ${revision} is the obtained revision ID)

Extract Chromium to the /custom/pdffolder/ directory, locate the executable file, and update the executablePath and other details in the .pcr-stats.json file as shown in the stats example above.


                  New to ADSelfService Plus?

                    • Related Articles

                    • Upgrade issue from 14200 to 14300 (LINUX)

                      We have a prerequisiste that when upgrading SDP MSP from version 14200 to 14300 in a Linux environment the GNU C library should be upgrade to version 2.14 or above -> Sometime even if you have upgraded your GNU C library to the 2.14 or above the ...
                    • 10.5 Linux Upgrade failure and solutions

                      Traces in logs : 1. java.lang.Exception: InitPgsqlScript exited with value :: 1 at com.adventnet.persistence.PostgresPreProcessor.executeInitPgsqlScript(PostgresPreProcessor.java:1733) 2. PGSQL Permission related errors. 3. SDP MSP installed as root ...
                    • Upgrade Failed -> Reverting steps

                      This article covers 2 areas : a) Analysis stage b) Reversion steps (rollback) a) Analysis stage Please send the below files to our support for analysis: 1. Zip the complete log folder present under <servicedesk plus msp home>/server/default or from ...
                    • Upgrade Pre-Validation error due to 'no AdventnetOper_64 in java.library.path'

                      Issue :  Upgrade Pre-validation error occurs with trace  'no AdventnetOper_64 in java.library.path' Possible Causes : 1) Mis-configuration in {ServiceDesk}/bin/scripts/UpdMgr.bat file 2) Applying patch for validation more than once in UpdateManager ...
                    • Inline images broken after SCP Upgrade

                      We suspect that this issue may arise if the migration schedule has not been run post-upgrade. To troubleshoot this issue further, we kindly request the output of the following query. Please connect to the database of the working build and execute the ...