question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Running with a sandbox

See original GitHub issue

What would you like to have implemented?

Is it possible to run Chromium without the --no-sandbox flag?

Why would it be useful?

For safety when executing foreign code.

When attempting to run without a sandbox:

 ERROR   Error: Failed to launch the browser process!
[0703/095854.412457:WARNING:resource_bundle.cc(435)] locale_file_path.empty() for locale 
[0703/095854.412718:FATAL:zygote_host_impl_linux.cc(116)] No usable sandbox! Update your kernel or see https://chromium.googlesource.com/chromium/src/+/master/docs/linux/suid_sandbox_development.md for more information on developing with the SUID sandbox. If you want to live dangerously and need an immediate workaround, you can try using --no-sandbox.
#0 0x5620dd3b8b29 (/tmp/chromium+0x48e4b28)
#1 0x5620dd328173 (/tmp/chromium+0x4854172)
#2 0x5620dd338d25 (/tmp/chromium+0x4864d24)
#3 0x5620de8be36e (/tmp/chromium+0x5dea36d)
#4 0x5620dd2cb110 (/tmp/chromium+0x47f710f)
#5 0x5620de8c5157 (/tmp/chromium+0x5df1156)
#6 0x5620dd2c4801 (/tmp/chromium+0x47f0800)
#7 0x5620dd32449d (/tmp/chromium+0x485049c)
#8 0x5620dd3241bc (/tmp/chromium+0x48501bb)
#9 0x7f94f470a02a __libc_start_main
#10 0x5620db4aea2a _start

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
williamjulianvicarycommented, Jul 16, 2020

It was the args that are provided by chromium.args that were missing from my initial call (I wasn’t launching with the above options before - which works fine now).

It seems the options provided by chromium.args aren’t just a suggestion, they’re required by the packaged Chromium instance (at least some of them).

1reaction
williamjulianvicarycommented, Jul 16, 2020

@Dadidam I was actually using the package to do the extraction only, ignoring the wrapping and essentially calling the await for the chromiumPath manually and pushing that to the relevant ENV var for puppeteer core.

In the end I tweaked the approach and instead I’m now overriding the launch() method on puppeteer with this:

puppeteer.launch = async function launch(options = {}) {

    const newOptions = {
        args: chromium.args,
        defaultViewport: chromium.defaultViewport,
        executablePath: process.env.CHROMIUM_PATH,
        headless: true,
        ignoreHTTPSErrors: true
    };

    return await this._launcher.launch(newOptions);
}

Ideally I was hoping to be able to include the sandbox, but I have a feeling thats just not a supported approach with AWS.

Read more comments on GitHub >

github_iconTop Results From Across the Web

What is Sandboxing and How to Sandbox a Program
Running a program in a sandbox allows the system to pre-allocate resources such as memory and disk space in advance of the program...
Read more >
Running the Ultimate Sandbox Game - Correctly #35 - YouTube
We look at how you can run a sandbox game correctly, where the players can go wherever they choose and you can adequately...
Read more >
What is meant by "run in sandbox"? - Microsoft Community
"Sandboxie runs your programs in an isolated space which prevents them from making permanent changes to other programs and data in your computer ......
Read more >
Tips on running a sandbox? : r/rpg - Reddit
I can only run pure sandbox games using the nWoD/oWoD systems because I've been running those games for over 15 years. Screw prep....
Read more >
Windows Sandbox: How to Safely Test Software Without ...
Open Windows Sandbox. The Sandbox is now ready for your command. To open it in Windows 10, click the Start button, scroll down...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found