Ubuntu 24.04 Noble: Troubleshooting Puppeteer Cluster 'kill EACCES' Error

Help! Puppeteer Cluster won’t start on Ubuntu 24.04

I’m pulling my hair out trying to get Puppeteer Cluster working on Ubuntu 24.04 Noble. Every time I try to launch it, I get this annoying error:

Error creating puppeteer cluster Unable to launch browser, error message: kill EACCES

I’ve tried everything I can think of:

  • Installed Chromium multiple times
  • Added a bunch of dependencies
  • Set the executablePath to /snap/bin/chromium
  • Made the Chromium binary executable
  • Removed package-lock.json and reinstalled everything

Here’s my setup code:

const startPuppeteer = async () => {
  try {
    const settings = {
      headless: true,
      args: [
        '--no-sandbox',
        '--disable-gpu',
        '--disable-dev-shm-usage',
        '--disable-setuid-sandbox',
      ],
      executablePath: process.env.CHROMIUM_PATH || '/snap/bin/chromium',
    };

    const browser = await Cluster.launch({
      concurrency: Cluster.CONCURRENCY_CONTEXT,
      maxConcurrency: 10,
      puppeteerOptions: settings,
      timeout: 10000000,
    });
    return browser;
  } catch (error) {
    console.error('Failed to start puppeteer cluster', error.message);
  }
};

I’m using Puppeteer 21.8.0, Puppeteer Cluster 0.23.0, and Node.js 18. Any ideas on what I’m doing wrong or how to fix this?

Have you considered running Puppeteer in a Docker container? This approach often sidesteps OS-specific issues and provides a consistent environment. You’d need to create a Dockerfile with the necessary dependencies and Chrome/Chromium installed. Then, run your Node.js application inside the container.

Another thing to check is file permissions. Make sure the user running the script has read and execute permissions for Chromium and its dependencies. You can use ‘ls -l’ to check and ‘chmod’ to modify if needed.

If all else fails, try downgrading Puppeteer to an earlier version that’s known to work with your setup. Sometimes, newer versions introduce compatibility issues with certain OS configurations. You can do this by specifying the version in your package.json file.

hey, have u tried using a different browser like firefox? sometimes chromium can be a pain. also, check if ur firewall is blocking anything. i had a similar issue and it turned out my firewall was the culprit. disable it temporarily and see if that helps. good luck!

I’ve faced similar issues with Puppeteer on Ubuntu before, and it can be frustrating. One thing that worked for me was running Puppeteer as a non-root user. Are you running your script with sudo or as root? If so, try executing it as a regular user.

Another potential fix is to use the system’s Chrome instead of the bundled one. You can install Chrome with:

sudo apt install google-chrome-stable

Then update your executablePath to:

executablePath: '/usr/bin/google-chrome-stable',

If that doesn’t work, you might need to adjust your system’s security policies. Try running:

sudo sysctl -w kernel.unprivileged_userns_clone=1

This allows Chrome to create user namespaces, which it needs for sandboxing.

Lastly, double-check your Node.js version. Sometimes older versions can cause unexpected issues with newer Puppeteer releases. Consider upgrading to the latest LTS version if you haven’t already.

Hope one of these solutions helps you get unstuck!