I’m encountering an issue while attempting to start a Puppeteer Cluster on Ubuntu 24.04. The error displayed is as follows:
Error creating puppeteer cluster: Cannot initiate browser, error: kill EACCES
Here’s what I’ve tried to resolve this problem:
- Reinstalled
chromium
multiple times and confirmed the installation path. - Installed necessary dependencies:
libaacs0 libass9 libavcodec60 libavformat60 libavutil58 libbdplus0 libblas3 libbluray2 libbs2b0 libchromaprint1 libcjson1 libcodec2-1.2 libgfortran5 libgme0 libgsm1 liblapack3 liblilv-0-0 libmbedcrypto7t64 libmysofa1 libnorm1t64 libopenmpt0t64 liboss4-salsa2 libpgm-5.3-0t64 libplacebo338 libpocketsphinx3 libpostproc57 librabbitmq4 librist4 librubberband2 libserd-0-0 libshine3 libsnappy1v5 libsord-0-0 libsoxr0 libsphinxbase3t64 libsratom-0-0 libsrt1.5-gnutls libssh-gcrypt-4 libswresample4 libswscale7 libudfread0 libunibreak5 libvdpau1 libvidstab1.1 libvpl2 libx265-199 libxvidcore4 libzimg2 libzix-0-0 libzmq5 libzvbi-common libzvbi0t64 mesa-vdpau-drivers pocketsphinx-en-us vdpau-driver-all
- Specified the
executablePath
: I’ve set it to/snap/bin/chromium
within my Puppeteer configurations. - Made the Chromium binary executable:
chmod +x /snap/bin/chromium
- Removed
package-lock.json
and reinstalled all packages.
Here is an example of my Puppeteer setup code:
const initializePuppeteer = async () => {
try {
const options = {
headless: true,
args: [
'--no-sandbox',
'--disable-gpu',
'--disable-dev-shm-usage',
'--disable-setuid-sandbox',
],
executablePath: process.env.BROWSER_PATH || '/snap/bin/chromium',
};
const browser = await Cluster.launch({
concurrency: Cluster.CONCURRENCY_CONTEXT,
maxConcurrency: 10,
puppeteerOptions: options,
timeout: 10000000,
});
return browser;
} catch (error) {
console.error('Error setting up the puppeteer cluster', error.message);
}
};
Despite following these steps, I am still encountering the kill EACCES
error. What additional solutions can I explore to eliminate this issue?
OS Information:
- Ubuntu 24.04
Puppeteer Versions:
- Puppeteer:
^21.8.0
, - Puppeteer Cluster:
^0.23.0
, - Puppeteer Core:
^13.0.1
Node.js Version: 18
Chromium Installed via Snap: /snap/bin/chromium
What could I be missing, or do you have alternative suggestions to troubleshoot this problem?