Skip to content

Does CentOS system can run puppeteer with sandbox anyway? #560

Closed
@zhuyingda

Description

@zhuyingda

After installed all the requirement, I finally run the puppeteer with --no-sandbox and --disable-setuid-sandbox on CentOS 7.3, but it is not secure. I still want to know, is there anyway to run puppeteer with sandbox on CentOS?

Activity

aslushnikov

aslushnikov commented on Aug 27, 2017

@aslushnikov
Contributor

@zhuyingda could you please share what did you do to run on CentOS? It would be very valuable for the #391

I still want to know, is there anyway to run puppeteer with sandbox on CentOS?

The following might help: https://chromium.googlesource.com/chromium/src/+/master/docs/linux_suid_sandbox.md

zhuyingda

zhuyingda commented on Aug 28, 2017

@zhuyingda
Author

@aslushnikov Of course, the chrome in the.local-chromium dir can not run because of some c++ requirements, I install them by yum(package manager in centos) one by one, here is my install package list:
yum install pango.x86_64 libXcomposite.x86_64 libXcursor.x86_64 libXdamage.x86_64 libXext.x86_64 libXi.x86_64 libXtst.x86_64 cups-libs.x86_64 libXScrnSaver.x86_64 libXrandr.x86_64 GConf2.x86_64 alsa-lib.x86_64 atk.x86_64 gtk3.x86_64 -y
then, the puppeteer/.local-chrome/linux-496140/chrome-linux/chrome -v --no-sandbox --disable-setuid-sandbox can be ran. However, I still can not run puppeteer, it send out a socket hangup error.
After I installed these fonts, everything is right:
yum install ipa-gothic-fonts xorg-x11-fonts-100dpi xorg-x11-fonts-75dpi xorg-x11-utils xorg-x11-fonts-cyrillic xorg-x11-fonts-Type1 xorg-x11-fonts-misc -y

My centos version is: LSB Version: :core-4.1-amd64:core-4.1-noarch Distributor ID: CentOS Description: CentOS Linux release 7.3.1611 (Core) Release: 7.3.1611 Codename: Core

I hope these would be helpful to you, and thanks about the official headless chrome driver you provide, it is awesome!

aslushnikov

aslushnikov commented on Aug 28, 2017

@aslushnikov
Contributor

@zhuyingda great, thanks for sharing this! I've added the dependencies to the troubleshooting.md.

gavinfang-fi

gavinfang-fi commented on Sep 3, 2017

@gavinfang-fi

@zhuyingda I have this issue too, after I installed all of packages you mentioned I still got the error.

(node:9431) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: Failed to launch chrome!

LSB Version: :core-4.1-amd64:core-4.1-noarch:cxx-4.1-amd64:cxx-4.1-noarch:desktop-4.1-amd64:desktop-4.1-noarch:languages-4.1-amd64:languages-4.1-noarch:printing-4.1-amd64:printing-4.1-noarch
Distributor ID: CentOS
Description: CentOS Linux release 7.3.1611 (Core)
Release: 7.3.1611
Codename: Core

zhuyingda

zhuyingda commented on Sep 3, 2017

@zhuyingda
Author

@Dev-GavinFang Try to execute the puppeteer/.local-chrome/linux-496140/chrome-linux/chrome -v --no-sandbox --disable-setuid-sandbox and show me the error info?

tomasAlabes

tomasAlabes commented on Sep 11, 2017

@tomasAlabes
Contributor

If it helps anybody, in my distribution:

LSB Version:	:core-4.1-amd64:core-4.1-ia32:core-4.1-noarch:cxx-4.1-amd64:cxx-4.1-ia32:cxx-4.1-noarch:desktop-4.1-amd64:desktop-4.1-ia32:desktop-4.1-noarch:languages-4.1-amd64:languages-4.1-ia32:languages-4.1-noarch:printing-4.1-amd64:printing-4.1-ia32:printing-4.1-noarch
Description:	Oracle Linux Server release 7.1

Chrome Headless wasn't capturing because http_proxy was set. Removing all the proxies env variables made it work.

Samlin901211

Samlin901211 commented on Nov 29, 2017

@Samlin901211

@zhuyingda I have an error like this
image

zhuyingda

zhuyingda commented on Nov 29, 2017

@zhuyingda
Author

@Samlin901211 It seems like something wrong with dependencies for your running environment. Tell us your system info? I just install puppeteer on centos 7+ system.

Samlin901211

Samlin901211 commented on Nov 29, 2017

@Samlin901211

@zhuyingda
LSB Version: :core-4.1-amd64:core-4.1-noarch
Distributor ID: CentOS
Description: CentOS Linux release 7.0 (Final)
Release: 7.0
Codename: Final

I've installed all pacakges you said below ,but the error always exists

zhuyingda

zhuyingda commented on Nov 29, 2017

@zhuyingda
Author

@Samlin901211 Have you ever tried my dependencies list? I think your problem may because of gtk3.x86_64 , which is in my package list.

Samlin901211

Samlin901211 commented on Nov 29, 2017

@Samlin901211

@zhuyingda I've installed all of your dependencies list include of gtk3.x86_64;

zhuyingda

zhuyingda commented on Nov 29, 2017

@zhuyingda
Author

@Samlin901211 I dont have any centos 7.0 environment to see what problem you have. If you can, try update your system to centos 7.3 or 7.4, this two version which I am using for puppeteer.

githubcy

githubcy commented on Dec 12, 2018

@githubcy

linux-609904 这个版本需要安装一个叫libgtk-3.so.0这个的依赖包

aemoe

aemoe commented on Mar 16, 2020

@aemoe

@aslushnikov Of course, the chrome in the.local-chromium dir can not run because of some c++ requirements, I install them by yum(package manager in centos) one by one, here is my install package list:
yum install pango.x86_64 libXcomposite.x86_64 libXcursor.x86_64 libXdamage.x86_64 libXext.x86_64 libXi.x86_64 libXtst.x86_64 cups-libs.x86_64 libXScrnSaver.x86_64 libXrandr.x86_64 GConf2.x86_64 alsa-lib.x86_64 atk.x86_64 gtk3.x86_64 -y
then, the puppeteer/.local-chrome/linux-496140/chrome-linux/chrome -v --no-sandbox --disable-setuid-sandbox can be ran. However, I still can not run puppeteer, it send out a socket hangup error.
After I installed these fonts, everything is right:
yum install ipa-gothic-fonts xorg-x11-fonts-100dpi xorg-x11-fonts-75dpi xorg-x11-utils xorg-x11-fonts-cyrillic xorg-x11-fonts-Type1 xorg-x11-fonts-misc -y

My centos version is: LSB Version: :core-4.1-amd64:core-4.1-noarch Distributor ID: CentOS Description: CentOS Linux release 7.3.1611 (Core) Release: 7.3.1611 Codename: Core

I hope these would be helpful to you, and thanks about the official headless chrome driver you provide, it is awesome!

Problem is fixed. Thx.

satiseven

satiseven commented on Jun 20, 2020

@satiseven

I want to run firefox on centos server anybody can help me?
(node:17602) UnhandledPromiseRejectionWarning: Error: Failed to launch Firefox!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @tomasAlabes@aslushnikov@gavinfang-fi@satiseven@aemoe

        Issue actions

          Does CentOS system can run puppeteer with sandbox anyway? · Issue #560 · puppeteer/puppeteer