Skip to content

can't run puppeteer in centos7 #391

Closed
@rlog

Description

@rlog

Server Info:
CUP: Intel(R) Xeon(R) Platinum 8163 CPU @ 2.50GHz
MemTotal: 1016396 kB
OS:CentOS Linux release 7.3.1611 (Core)
Node:v8.4.0

when I try to run my app in this server, there have an error throw:

(node:29208) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: Failed to connect to chrome!

I want run Chromium which download by puppeteer manual,there have some log output:

robin@eve ~/project/memostickyserver/node_modules/puppeteer/.local-chromium/linux-494755/chrome-linux (master*) $ chrome
robin@eve ~/project/memostickyserver/node_modules/puppeteer/.local-chromium/linux-494755/chrome-linux (master*) $ ./chrome
[28268:28268:0819/223159.486750:FATAL:zygote_host_impl_linux.cc(123)] 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 0x7fd4bc6d6657 base::debug::StackTrace::StackTrace()
#1 0x7fd4bc6ea311 logging::LogMessage::~LogMessage()
#2 0x7fd4bb8db1f1 content::ZygoteHostImpl::Init()
#3 0x7fd4bb575da0 content::BrowserMainLoop::EarlyInitialization()
#4 0x7fd4bb57c4c3 content::BrowserMainRunnerImpl::Initialize()
#5 0x7fd4bb575532 content::BrowserMain()
#6 0x7fd4bc3e17fd content::ContentMainRunnerImpl::Run()
#7 0x7fd4bc3e9314 service_manager::Main()
#8 0x7fd4bc3e0462 content::ContentMain()
#9 0x7fd4bb020b74 ChromeMain
#10 0x7fd4b3da2b35 __libc_start_main
#11 0x7fd4bb0209d0

Received signal 6
#0 0x7fd4bc6d6657 base::debug::StackTrace::StackTrace()
#1 0x7fd4bc6d61cf base::debug::(anonymous namespace)::StackDumpSignalHandler()
#2 0x7fd4ba04d370
#3 0x7fd4b3db61d7 __GI_raise
#4 0x7fd4b3db78c8 __GI_abort
#5 0x7fd4bc6d5202 base::debug::BreakDebugger()
#6 0x7fd4bc6ea7cc logging::LogMessage::~LogMessage()
#7 0x7fd4bb8db1f1 content::ZygoteHostImpl::Init()
#8 0x7fd4bb575da0 content::BrowserMainLoop::EarlyInitialization()
#9 0x7fd4bb57c4c3 content::BrowserMainRunnerImpl::Initialize()
#10 0x7fd4bb575532 content::BrowserMain()
#11 0x7fd4bc3e17fd content::ContentMainRunnerImpl::Run()
#12 0x7fd4bc3e9314 service_manager::Main()
#13 0x7fd4bc3e0462 content::ContentMain()
#14 0x7fd4bb020b74 ChromeMain
#15 0x7fd4b3da2b35 __libc_start_main
#16 0x7fd4bb0209d0
r8: 00007fff21b42080 r9: 0000000000000395 r10: 0000000000000008 r11: 0000000000000206
r12: 00007fff21b424e0 r13: 000000000000016d r14: 00007fff21b424d8 r15: 00007fff21b424d0
di: 0000000000006e6c si: 0000000000006e6c bp: 00007fff21b42080 bx: 00007fff21b42080
dx: 0000000000000006 ax: 0000000000000000 cx: ffffffffffffffff sp: 00007fff21b41ed8
ip: 00007fd4b3db61d7 efl: 0000000000000206 cgf: 0000000000000033 erf: 0000000000000000
trp: 0000000000000000 msk: 0000000000000000 cr2: 0000000000000000
[end of stack trace]
Calling _exit(1). Core file will not be generated.
robin@eve ~/project/memostickyserver/node_modules/puppeteer/.local-chromium/linux-494755/chrome-linux (master*) $ ./chrome --no-sandbox
[0819/223234.158902:ERROR:nacl_helper_linux.cc(310)] NaCl helper process running without a sandbox!
Most likely you need to configure your SUID sandbox correctly

pls help,how to fix this ?

Activity

Garbee

Garbee commented on Aug 19, 2017

@Garbee
Contributor

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.

Right in the error output. Did you go to the referenced page and read what it says about the problem and how to address it?

rlog

rlog commented on Aug 20, 2017

@rlog
Author

@Garbee Thanks to replay

yes,I read that page and try:

sudo chown root:root chrome_sandbox && sudo chmod 4755 chrome_sandbox && \
    export CHROME_DEVEL_SANDBOX="$PWD/chrome_sandbox"

get some other error:

DevTools listening on ws://127.0.0.1:45565/devtools/browser/8b502ff1-9ad6-40c7-a335-ec9221e1d914
[0820/113237.953713:ERROR:devtools_http_handler.cc(245)] Error writing DevTools active port to file
[0820/113237.923530:FATAL:platform_font_linux.cc(83)] Check failed: InitDefaultFont(). Could not find the default font
#0 0x7f6fc457d657 base::debug::StackTrace::StackTrace()
#1 0x7f6fc4591311 logging::LogMessage::~LogMessage()
#2 0x7f6fc4aad472 gfx::PlatformFontLinux::PlatformFontLinux()
#3 0x7f6fc4aae436 gfx::PlatformFont::CreateDefault()
#4 0x7f6fc4aa68c9 gfx::Font::Font()
#5 0x7f6fc3688004 content::RenderViewHostImpl::CreateRenderView()
#6 0x7f6fc376c4b2 content::WebContentsImpl::CreateRenderViewForRenderManager()
#7 0x7f6fc3531b5d content::RenderFrameHostManager::ReinitializeRenderFrame()
#8 0x7f6fc3531247 content::RenderFrameHostManager::Navigate()
#9 0x7f6fc3510e15 content::NavigatorImpl::NavigateToEntry()
#10 0x7f6fc35117b5 content::NavigatorImpl::NavigateToPendingEntry()
#11 0x7f6fc3501eb7 content::NavigationControllerImpl::NavigateToPendingEntryInternal()
#12 0x7f6fc34fe0f2 content::NavigationControllerImpl::NavigateToPendingEntry()
#13 0x7f6fc34fedc4 content::NavigationControllerImpl::LoadURLWithParams()
#14 0x7f6fc6d293a8 headless::HeadlessWebContentsImpl::Create()
#15 0x7f6fc6d2c134 headless::HeadlessBrowserContextImpl::CreateWebContents()
#16 0x7f6fc428a40a headless::HeadlessShell::OnStart()
#17 0x7f6fc6d2d862 headless::HeadlessBrowserImpl::RunOnStartCallback()
#18 0x7f6fc7f807b1 headless::HeadlessContentMainDelegate::RunProcess()
#19 0x7f6fc4287ec7 content::RunNamedProcessTypeMain()
#20 0x7f6fc42887fd content::ContentMainRunnerImpl::Run()
#21 0x7f6fc4290314 service_manager::Main()
#22 0x7f6fc4287462 content::ContentMain()
#23 0x7f6fc6d2e325 headless::(anonymous namespace)::RunContentMain()
#24 0x7f6fc6d2e39c headless::HeadlessBrowserMain()
#25 0x7f6fc428e0e2 headless::HeadlessShellMain()
#26 0x7f6fc2ec7b6d ChromeMain
#27 0x7f6fbbc49b35 __libc_start_main
#28 0x7f6fc2ec79d0

Received signal 6
#0 0x7f6fc457d657 base::debug::StackTrace::StackTrace()
#1 0x7f6fc457d1cf base::debug::(anonymous namespace)::StackDumpSignalHandler()
#2 0x7f6fc1ef4370
#3 0x7f6fbbc5d1d7 __GI_raise
#4 0x7f6fbbc5e8c8 __GI_abort
#5 0x7f6fc457c202 base::debug::BreakDebugger()
#6 0x7f6fc45917cc logging::LogMessage::~LogMessage()
#7 0x7f6fc4aad472 gfx::PlatformFontLinux::PlatformFontLinux()
#8 0x7f6fc4aae436 gfx::PlatformFont::CreateDefault()
#9 0x7f6fc4aa68c9 gfx::Font::Font()
#10 0x7f6fc3688004 content::RenderViewHostImpl::CreateRenderView()
#11 0x7f6fc376c4b2 content::WebContentsImpl::CreateRenderViewForRenderManager()
#12 0x7f6fc3531b5d content::RenderFrameHostManager::ReinitializeRenderFrame()
#13 0x7f6fc3531247 content::RenderFrameHostManager::Navigate()
#14 0x7f6fc3510e15 content::NavigatorImpl::NavigateToEntry()
#15 0x7f6fc35117b5 content::NavigatorImpl::NavigateToPendingEntry()
#16 0x7f6fc3501eb7 content::NavigationControllerImpl::NavigateToPendingEntryInternal()
#17 0x7f6fc34fe0f2 content::NavigationControllerImpl::NavigateToPendingEntry()
#18 0x7f6fc34fedc4 content::NavigationControllerImpl::LoadURLWithParams()
#19 0x7f6fc6d293a8 headless::HeadlessWebContentsImpl::Create()
#20 0x7f6fc6d2c134 headless::HeadlessBrowserContextImpl::CreateWebContents()
#21 0x7f6fc428a40a headless::HeadlessShell::OnStart()
#22 0x7f6fc6d2d862 headless::HeadlessBrowserImpl::RunOnStartCallback()
#23 0x7f6fc7f807b1 headless::HeadlessContentMainDelegate::RunProcess()
#24 0x7f6fc4287ec7 content::RunNamedProcessTypeMain()
#25 0x7f6fc42887fd content::ContentMainRunnerImpl::Run()
#26 0x7f6fc4290314 service_manager::Main()
#27 0x7f6fc4287462 content::ContentMain()
#28 0x7f6fc6d2e325 headless::(anonymous namespace)::RunContentMain()
#29 0x7f6fc6d2e39c headless::HeadlessBrowserMain()
#30 0x7f6fc428e0e2 headless::HeadlessShellMain()
#31 0x7f6fc2ec7b6d ChromeMain
#32 0x7f6fbbc49b35 __libc_start_main
#33 0x7f6fc2ec79d0
r8: 00007ffd2a1a1030 r9: 0000000000000000 r10: 0000000000000008 r11: 0000000000000202
r12: 00007ffd2a1a1090 r13: 0000000000000076 r14: 00007ffd2a1a1088 r15: 00007ffd2a1a1080
di: 0000000000006e38 si: 0000000000006e38 bp: 00007ffd2a1a0c40 bx: 00007ffd2a1a0c40
dx: 0000000000000006 ax: 0000000000000000 cx: ffffffffffffffff sp: 00007ffd2a1a0a98
ip: 00007f6fbbc5d1d7 efl: 0000000000000202 cgf: 0000000000000033 erf: 0000000000000000
trp: 0000000000000000 msk: 0000000000000000 cr2: 0000000000000000
[end of stack trace]
Calling _exit(1). Core file will not be generated.
(node:28112) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 2): Error: socket hang up
[0100/000000.311368:ERROR:broker_posix.cc(43)] Invalid node channel message

paambaati

paambaati commented on Aug 20, 2017

@paambaati

Check failed: InitDefaultFont(). Could not find the default font

@rlog Looks like a missing dependency. Are you sure you've installed all the dependencies listed here?

rlog

rlog commented on Aug 20, 2017

@rlog
Author

@paambaati I'm trying to install all this dependencies on centos 7, but nothing new install:

robin@eve ~ $ sudo yum install gconf-service libasound2 libatk1.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgcc1 libgconf-2-4 libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 libnspr4 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 ca-certificates fonts-liberation libappindicator1 libnss3 lsb-release xdg-utils wget
[sudo] password for robin:
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
No package gconf-service available.
No package libasound2 available.
No package libatk1.0-0 available.
No package libc6 available.
No package libcairo2 available.
No package libcups2 available.
No package libdbus-1-3 available.
No package libexpat1 available.
No package libfontconfig1 available.
No package libgcc1 available.
No package libgconf-2-4 available.
No package libgdk-pixbuf2.0-0 available.
No package libglib2.0-0 available.
No package libgtk-3-0 available.
No package libnspr4 available.
No package libpango-1.0-0 available.
No package libpangocairo-1.0-0 available.
No package libstdc++6 available.
No package libx11-6 available.
No package libx11-xcb1 available.
No package libxcb1 available.
No package libxcomposite1 available.
No package libxcursor1 available.
No package libxdamage1 available.
No package libxext6 available.
No package libxfixes3 available.
No package libxi6 available.
No package libxrandr2 available.
No package libxrender1 available.
No package libxss1 available.
No package libxtst6 available.
Package ca-certificates-2017.2.14-70.1.el7_3.noarch already installed and latest version
No package fonts-liberation available.
No package libappindicator1 available.
No package libnss3 available.
No package lsb-release available.
Package xdg-utils-1.1.0-0.17.20120809git.el7.noarch already installed and latest version
Package wget-1.14-13.el7.x86_64 already installed and latest version
Nothing to do

Garbee

Garbee commented on Aug 21, 2017

@Garbee
Contributor

You need to convert the package names to be RHEL names. Those are only the Debian names.

rlog

rlog commented on Aug 21, 2017

@rlog
Author

@Garbee I don't know how to convert, google them one by one ...?

Garbee

Garbee commented on Aug 21, 2017

@Garbee
Contributor

That or grab an RPM copy of the installer and use software management tools to look at what the dependencies of the package are.

theoutlander

theoutlander commented on Aug 23, 2017

@theoutlander

Having a similar issue. Here's what I discovered:

[root@li583-175 chrome-linux]# ldd chrome | more
linux-vdso.so.1 => (0x00007ffcd3ee4000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f55baf90000)
libdl.so.2 => /lib64/libdl.so.2 (0x00007f55bad8c000)
librt.so.1 => /lib64/librt.so.1 (0x00007f55bab83000)
libpangocairo-1.0.so.0 => not found
libpango-1.0.so.0 => not found
libcairo.so.2 => not found
libgobject-2.0.so.0 => /lib64/libgobject-2.0.so.0 (0x00007f55ba932000)
libglib-2.0.so.0 => /lib64/libglib-2.0.so.0 (0x00007f55ba5fb000)
libX11.so.6 => /lib64/libX11.so.6 (0x00007f55ba2bc000)
libX11-xcb.so.1 => /lib64/libX11-xcb.so.1 (0x00007f55ba0ba000)
libxcb.so.1 => /lib64/libxcb.so.1 (0x00007f55b9e98000)
libXcomposite.so.1 => not found
libXcursor.so.1 => not found
libXdamage.so.1 => not found
libXext.so.6 => not found
libXfixes.so.3 => not found
libXi.so.6 => not found
libXrender.so.1 => not found
libXtst.so.6 => not found
libgmodule-2.0.so.0 => /lib64/libgmodule-2.0.so.0 (0x00007f55b9c91000)
libnss3.so => /lib64/libnss3.so (0x00007f55b9966000)
libnssutil3.so => /lib64/libnssutil3.so (0x00007f55b9739000)
libsmime3.so => /lib64/libsmime3.so (0x00007f55b9512000)
libnspr4.so => /lib64/libnspr4.so (0x00007f55b92d3000)
libcups.so.2 => not found
libexpat.so.1 => /lib64/libexpat.so.1 (0x00007f55b90a9000)
libfontconfig.so.1 => /lib64/libfontconfig.so.1 (0x00007f55b8e6b000)
libdbus-1.so.3 => /lib64/libdbus-1.so.3 (0x00007f55b8c23000)
libXss.so.1 => not found
libXrandr.so.2 => not found
libgconf-2.so.4 => not found
libgio-2.0.so.0 => /lib64/libgio-2.0.so.0 (0x00007f55b88a2000)
libasound.so.2 => /lib64/libasound.so.2 (0x00007f55b85a9000)
libm.so.6 => /lib64/libm.so.6 (0x00007f55b82a7000)
libatk-1.0.so.0 => not found
libgtk-3.so.0 => not found
libgdk-3.so.0 => not found
libgdk_pixbuf-2.0.so.0 => not found
libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007f55b808f000)
libc.so.6 => /lib64/libc.so.6 (0x00007f55b7cce000)
/lib64/ld-linux-x86-64.so.2 (0x000055a8c8793000)
libffi.so.6 => /lib64/libffi.so.6 (0x00007f55b7ac6000)
libXau.so.6 => /lib64/libXau.so.6 (0x00007f55b78c1000)
libplc4.so => /lib64/libplc4.so (0x00007f55b76bc000)
libplds4.so => /lib64/libplds4.so (0x00007f55b74b8000)
libfreetype.so.6 => /lib64/libfreetype.so.6 (0x00007f55b7211000)
libz.so.1 => /lib64/libz.so.1 (0x00007f55b6ffb000)
libselinux.so.1 => /lib64/libselinux.so.1 (0x00007f55b6dd3000)
libresolv.so.2 => /lib64/libresolv.so.2 (0x00007f55b6bb9000)
libpcre.so.1 => /lib64/libpcre.so.1 (0x00007f55b6957000)

I had installed one of the missing packages manually, but it still doesn't find it. I can see that particular package under /usr/lib/libpangocairo-1.0.so.0.

historylife

historylife commented on Aug 24, 2017

@historylife

So bottom of line , puppeteer can not work on centos !

theoutlander

theoutlander commented on Aug 24, 2017

@theoutlander

Here's another issue I'm running into when trying on Docker Centos7:

[root@3dd3c09a9d40 opt]# npm install -g puppeteer

puppeteer@0.9.0 install /usr/lib/node_modules/puppeteer
node install.js

Download failed: EACCES: permission denied, mkdir '/usr/lib/node_modules/puppeteer/.local-chromium'

  • puppeteer@0.9.0
    added 36 packages in 2.437s

I'm running as root. Not sure if that's the issue. I've changed ownership on that folder path. Even tried to create that folder manually and tried with sudo, yet I get that same error repeatedly.

liulangyu90316

liulangyu90316 commented on Aug 24, 2017

@liulangyu90316

@rlog try install fonts?

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

theoutlander

theoutlander commented on Aug 24, 2017

@theoutlander

Tried it in Ubuntu on Docker and got a similar message:

root@6c5ca63ee50a:/opt/node_modules/puppeteer/.local-chromium/linux-494755/chrome-linux# ./chrome
./chrome: error while loading shared libraries: libpangocairo-1.0.so.0: cannot open shared object file: No such file or directory

root@6c5ca63ee50a:/opt/node_modules/puppeteer/.local-chromium/linux-494755/chrome-linux# ldd ./chrome
linux-vdso.so.1 => (0x00007fffd9a6f000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f74809c4000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f74807c0000)
librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f74805b8000)
libpangocairo-1.0.so.0 => not found
libpango-1.0.so.0 => not found
libcairo.so.2 => not found
libgobject-2.0.so.0 => not found
libglib-2.0.so.0 => not found
libX11.so.6 => not found
libX11-xcb.so.1 => not found
libxcb.so.1 => not found
libXcomposite.so.1 => not found
libXcursor.so.1 => not found
libXdamage.so.1 => not found
libXext.so.6 => not found
libXfixes.so.3 => not found
libXi.so.6 => not found
libXrender.so.1 => not found
libXtst.so.6 => not found
libgmodule-2.0.so.0 => not found
libnss3.so => not found
libnssutil3.so => not found
libsmime3.so => not found
libnspr4.so => not found
libcups.so.2 => not found
libexpat.so.1 => /lib/x86_64-linux-gnu/libexpat.so.1 (0x00007f748038f000)
libfontconfig.so.1 => not found
libdbus-1.so.3 => not found
libXss.so.1 => not found
libXrandr.so.2 => not found
libgconf-2.so.4 => not found
libgio-2.0.so.0 => not found
libasound.so.2 => not found
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f7480086000)
libatk-1.0.so.0 => not found
libgtk-3.so.0 => not found
libgdk-3.so.0 => not found
libgdk_pixbuf-2.0.so.0 => not found
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f747fe70000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f747faa6000)
/lib64/ld-linux-x86-64.so.2 (0x00007f74887de000)
root@6c5ca63ee50a:/opt/node_modules/puppeteer/.local-chromium/linux-494755/chrome-linux#

101 remaining items

Loading
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

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @rlog@theaspect@xiaojue@heathdutton@haxpor

        Issue actions

          can't run puppeteer in centos7 · Issue #391 · puppeteer/puppeteer