Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

Find which bin is used to allow in jail (Chrome headless, Puppeteer)

Discussion in 'Workarounds and Optimization' started by Tommychris, Jan 5, 2018.

  1. Tommychris

    Tommychris Registered

    Jan 5, 2018
    Likes Received:
    Trophy Points:
    cPanel Access Level:
    Root Administrator
    Hi Everybody!

    I want to use Puppeteer (with Node.js). This is a Node.js wrapper around Chromium, so my goal is to use Chromium in headless mode. I wrote my sample script, and it works like a charm, if the logged in user has "normal shell", but it gives me false result if the user has Jailed shell.

    Of course, I want to use jailed shell in the future, but I also want to use that Puppeteer. My real problem is:

    When I run in both normal and jailed shell the script runs without any error. Only the produced image differs: In jailes shell I got white image, in normal shell I got the correct screenhsot.

    My node.js code:
    'use strict';
    const puppeteer = require('puppeteer');
    (async () => {
      const browser = await puppeteer.launch({
        ignoreHTTPSErrors: true,
        headless: true,
        args: ['--disable-gpu', '--enable-logging', '--no-sandbox', '--disable-setuid-sandbox'],
      const page = await browser.newPage();
      await page.goto('[URL]');[/URL]
      await page.screenshot({path: 'google.jpg', fromSurface: true});
      await page.close();
      await browser.close();
    So, how can I find which binaries are that Node.js, Puppeteer or Chrome tries to use, but it locates outside of the jail?

    After, how I can allow that binaries to run inside jailed shell?

    Thanks for your answers!
    #1 Tommychris, Jan 5, 2018
    Last edited by a moderator: Jan 5, 2018
  2. cPanelMichael

    cPanelMichael Technical Support Community Manager Staff Member

    Apr 11, 2011
    Likes Received:
    Trophy Points:
    cPanel Access Level:
    Root Administrator

    The following document provides instructions on how to configure custom jailed shell mounts should you like to grant jailed users access to a specific directory:

    How to Create Custom Jailed Shell Mounts - cPanel Knowledge Base - cPanel Documentation

    As far as the actual path or binary that's resulting in the issue you are facing, you may want to look into the documentation for the script you are using to determine where error messages are logged to get a better idea of why the images are not loading correctly.

    Thank you.
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice