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 ...
                    • solution for postgres 11 upgrade issues

                      When Supportcenter Plus is upgraded to 14300 or later, postgres is also upgraded to 11.17. If you are using bundled postgres, data migration through pgdump and restore mechanism also happens. To ensure efficiency in Postgres 11.17, make sure your ...
                    • SDP MSP solution for postgres 11 upgrade issues

                      When ServiceDesk Plus MSP is upgraded to 14300 or later, postgres is also upgraded to 11.17. If you are using bundled postgres, data migration through pgdump and restore mechanism also happens. To ensure efficiency in Postgres 11.17, make sure your ...
                    • Upgrade Failure due to the presence of CtrlZ Failure

                      This issue (SD-118352) in fixed in version 14710. Post this release, these characters are handled in the migration itself. If you are planning to migrate from version less than 14610 to 14610, then you can directly migrate to 14710, to handle this ...