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

                    • PDF Export issue after Puppetter

                      Pdfexport fails after after upgrading to Puppetter from Phantom; We have had several customer tickets with an exception trace "Error in Exporting Data" and serverout log traces with: java.lang.Exception: {"error":{"message":"An `executablePath` or ...
                    • 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 ...
                    • Export Category,subcategory, item

                       This report is used to export the tree view. This report helps to import category,subcategory and item in other applications. Modify and import in the applications. SELECT CategoryDefinition.CATEGORYNAME "Category Name", SubCategoryDefinition.NAME ...
                    • 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 ...
                    • Query to Export solutions (MSSQL & PGSQL)

                      Tested in Build PGSQL (14300) or MSSQL (14306) Run this query under Reports->New Query Report and export it to the desired format SELECT solution.solutionid "Solutionid", KB_Topics.TOPICNAME " Topic",Solution.TITLE "Subject ",Solution.DESCRIPTION ...