Closed jucallej closed 1 year ago
This issue has an invalid Puppeteer version: latest
. Versions must follow SemVer formatting. Please update the form with a valid version.
Just a heads up if somebody else faces this, enabling the Rosetta for emulation in docker seems to solve this. Maybe that shouldn't be a mandatory thing to do?
I believe it is the same issue as https://github.com/puppeteer/puppeteer/issues/9763
Bug expectation
When I follow https://pptr.dev/guides/docker and run on an M1 mac:
docker pull ghcr.io/puppeteer/puppeteer:latest
docker run -i --init --cap-add=SYS_ADMIN --rm ghcr.io/puppeteer/puppeteer:latest node -e "$(cat ./smoke-test.js)"
I get this error:
/home/pptruser/node_modules/@puppeteer/browsers/lib/cjs/launch.js:262 reject(new Error([ ^
Error: Failed to launch the browser process! [0427/102145.500313:ERROR:stack_trace_posix.cc(811)] Failed to parse the contents of /proc/self/maps [0427/102145.532396:FATAL:zygote_host_impl_linux.cc(127)] No usable sandbox! Update your kernel or see https://chromium.googlesource.com/chromium/src/+/main/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 0x004007d22f72 base::debug::CollectStackTrace()
1 0x004007d0f4b3 base::debug::StackTrace::StackTrace()
2 0x004007c61fbf logging::LogMessage::~LogMessage()
3 0x00400647ec16 content::ZygoteHostImpl::Init()
4 0x0040071b8b23 content::ContentMainRunnerImpl::Initialize()
5 0x0040071b6427 content::RunContentProcess()
6 0x0040071b6606 content::ContentMain()
7 0x0040077a01fa headless::HeadlessShellMain()
8 0x0040038d7255 ChromeMain
9 0x004010fa5d0a __libc_start_main
10 0x0040038d702a _start
qemu: uncaught target signal 5 (Trace/breakpoint trap) - core dumped
TROUBLESHOOTING: https://pptr.dev/troubleshooting
Node.js v18.16.0 ➜ test git:(main) ✗
Then I get this other error:
Is there a way of running puppeteer in docker in an M1 mac? Am I missing something? Thanks!
Bug behavior
Minimal, reproducible example
If I modify the file to add no-sandbox like puppeteer = require('puppeteer');
(async () => { const browser = await puppeteer.launch({ args: ['--no-sandbox'], }); const page = await browser.newPage(); await page.goto('https://example.com'); await browser.close(); console.log('done'); })();
➜ test git:(main) ✗ docker run -i --init --cap-add=SYS_ADMIN --rm ghcr.io/puppeteer/puppeteer:latest node -e "$(cat ./smoke-test.js)" WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
Puppeteer old Headless deprecation warning: In the near feature
headless: true
will default to the new Headless mode for Chrome instead of the old Headless implementation. For more information, please see https://developer.chrome.com/articles/new-headless/. Consider opting in early by passingheadless: "new"
topuppeteer.launch()
If you encounter any bugs, please report them to https://github.com/puppeteer/puppeteer/issues/new/choose./home/pptruser/node_modules/@puppeteer/browsers/lib/cjs/launch.js:262 reject(new Error([ ^
Error: Failed to launch the browser process! [0427/102314.926500:ERROR:stack_trace_posix.cc(811)] Failed to parse the contents of /proc/self/maps [0427/102315.669200:ERROR:stack_trace_posix.cc(811)] Failed to parse the contents of /proc/self/maps [0427/102315.670539:ERROR:stack_trace_posix.cc(811)] Failed to parse the contents of /proc/self/maps [0427/102315.700621:FATAL:zygote_main_linux.cc(162)] Check failed: sandbox::ThreadHelpers::IsSingleThreaded().
0 0x004007d22f72 base::debug::CollectStackTrace()
1 0x004007d0f4b3 base::debug::StackTrace::StackTrace()
2 0x004007c61fbf logging::LogMessage::~LogMessage()
3 0x004007c62b1e logging::LogMessage::~LogMessage()
4 0x004007c4bb07 logging::CheckError::~CheckError()
5 0x0040071bdfaf content::ZygoteMain()
6 0x0040071b7296 content::RunZygote()
7 0x0040071b8222 content::RunOtherNamedProcessTypeMain()
8 0x0040071b90cf content::ContentMainRunnerImpl::Run()
9 0x0040071b607a content::RunContentProcess()
10 0x0040071b6606 content::ContentMain()
11 0x0040077a02cf headless::HeadlessShellMain()
12 0x0040038d7255 ChromeMain
13 0x004010fa5d0a __libc_start_main
14 0x0040038d702a _start
[0427/102315.700255:FATAL:zygote_main_linux.cc(162)] Check failed: sandbox::ThreadHelpers::IsSingleThreaded().
0 0x004007d22f72 base::debug::CollectStackTrace()
1 0x004007d0f4b3 base::debug::StackTrace::StackTrace()
2 0x004007c61fbf logging::LogMessage::~LogMessage()
3 0x004007c62b1e logging::LogMessage::~LogMessage()
4 0x004007c4bb07 logging::CheckError::~CheckError()
5 0x0040071bdfaf content::ZygoteMain()
6 0x0040071b7296 content::RunZygote()
7 0x0040071b8222 content::RunOtherNamedProcessTypeMain()
8 0x0040071b90cf content::ContentMainRunnerImpl::Run()
9 0x0040071b607a content::RunContentProcess()
10 0x0040071b6606 content::ContentMain()
11 0x0040077a02cf headless::HeadlessShellMain()
12 0x0040038d7255 ChromeMain
13 0x004010fa5d0a __libc_start_main
14 0x0040038d702a _start
qemu: uncaught target signal 5 (Trace/breakpoint trap) - core dumped qemu: uncaught target signal 5 (Trace/breakpoint trap) - core dumped [0427/102316.358700:ERROR:bus.cc(399)] Failed to connect to the bus: Failed to connect to socket /run/dbus/system_bus_socket: No such file or directory Received signal 11 SEGV_MAPERR 40cf3900783c0008
0 0x004007d22f72 base::debug::CollectStackTrace()
1 0x004007d0f4b3 base::debug::StackTrace::StackTrace()
2 0x004007d22a01 base::debug::(anonymous namespace)::StackDumpSignalHandler()
3 0x004010078140
4 0x004008e8a678 FcCharSetSerializeAlloc
5 0x004008e9914c FcValueListSerializeAlloc
6 0x004008e990a1 FcPatternSerializeAlloc
7 0x004008e90e80 FcFontSetSerializeAlloc
8 0x004008e87390 FcDirCacheBuild
9 0x004008e8d083 FcDirCacheScan
10 0x004008e8d120 IA__FcDirCacheRead
11 0x004008e82567 FcConfigAddDirList
12 0x004008e824b2 IA__FcConfigBuildFonts
13 0x004008e91641 IA__FcInitLoadConfigAndFonts
14 0x004008e819d1 FcConfigInit
15 0x004008f215e4 base::NoDestructor<>::NoDestructor<>()
16 0x004008f20ded gfx::GetGlobalFontConfig()
17 0x004005d8708d content::BrowserMainRunnerImpl::Initialize()
18 0x00400dd68bcb headless::HeadlessContentMainDelegate::RunProcess()
19 0x0040071b7ed2 content::RunBrowserProcessMain()
20 0x0040071b931d content::ContentMainRunnerImpl::RunBrowser()
21 0x0040071b90f3 content::ContentMainRunnerImpl::Run()
22 0x0040071b607a content::RunContentProcess()
23 0x0040071b6606 content::ContentMain()
24 0x0040077a01fa headless::HeadlessShellMain()
25 0x0040038d7255 ChromeMain
26 0x004010fa5d0a __libc_start_main
27 0x0040038d702a _start
r8: 00003c78003a0000 r9: 0000000000000002 r10: 0000000000000e00 r11: 00003c78002558a8 r12: 0000004001eb4dd0 r13: 000000000000000e r14: 00003c78003b90a0 r15: 0000000000000000 di: 00003c78003a0000 si: 000000000001c000 bp: 0000004010023930 bx: 00003c7800255880 dx: 000000e70b775637 ax: 40cf3900783c0000 cx: 000000000000003b sp: 0000004010023900 ip: 0000004008e8a678 efl: 0000000000000206 cgf: 002b000000000033 erf: 0000000000000004 trp: ffffffffffffffff msk: 0000000000000000 cr2: 40cf3900783c0008 [end of stack trace] qemu: uncaught target signal 11 (Segmentation fault) - core dumped
TROUBLESHOOTING: https://pptr.dev/troubleshooting
Node.js v18.16.0 ➜ test git:(main) ✗
Error string
➜ test git:(main) ✗ docker run -i --init --cap-add=SYS_ADMIN --rm ghcr.io/puppeteer/puppeteer:latest node -e "$(cat ./smoke-test.js)" WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested Puppeteer old Headless deprecation warning: In the near feature #4 0x004008e8a678 FcCharSetSerializeAlloc #5 0x004008e9914c FcValueListSerializeAlloc #6 0x004008e990a1 FcPatternSerializeAlloc #7 0x004008e90e80 FcFontSetSerializeAlloc #8 0x004008e87390 FcDirCacheBuild #9 0x004008e8d083 FcDirCacheScan #10 0x004008e8d120 IA FcDirCacheRead #11 0x004008e82567 FcConfigAddDirList #12 0x004008e824b2 IAFcConfigBuildFonts #13 0x004008e91641 IAFcInitLoadConfigAndFonts #14 0x004008e819d1 FcConfigInit #15 0x004008f215e4 base::NoDestructor<>::NoDestructor<>() #16 0x004008f20ded gfx::GetGlobalFontConfig() #17 0x004005d8708d content::BrowserMainRunnerImpl::Initialize() #18 0x00400dd68bcb headless::HeadlessContentMainDelegate::RunProcess() #19 0x0040071b7ed2 content::RunBrowserProcessMain() #20 0x0040071b931d content::ContentMainRunnerImpl::RunBrowser() #21 0x0040071b90f3 content::ContentMainRunnerImpl::Run() #22 0x0040071b607a content::RunContentProcess() #23 0x0040071b6606 content::ContentMain() #24 0x0040077a01fa headless::HeadlessShellMain() #25 0x0040038d7255 ChromeMain #26 0x004010fa5d0a __libc_start_main #27 0x0040038d702a _start r8: 00003c78003a0000 r9: 0000000000000002 r10: 0000000000000e00 r11: 00003c78002558a8 r12: 0000004001eb4dd0 r13: 000000000000000e r14: 00003c78003b90a0 r15: 0000000000000000 di: 00003c78003a0000 si: 000000000001c000 bp: 0000004010023930 bx: 00003c7800255880 dx: 000000e70b775637 ax: 40cf3900783c0000 cx: 000000000000003b sp: 0000004010023900 ip: 0000004008e8a678 efl: 0000000000000206 cgf: 002b000000000033 erf: 0000000000000004 trp: ffffffffffffffff msk: 0000000000000000 cr2: 40cf3900783c0008 [end of stack trace] qemu: uncaught target signal 11 (Segmentation fault) - core dumped TROUBLESHOOTING: https://pptr.dev/troubleshooting at Interface.onClose (/home/pptruser/node_modules/@puppeteer/browsers/lib/cjs/launch.js:262:24) at Interface.emit (node:events:525:35) at Interface.close (node:internal/readline/interface:533:10) at Socket.onend (node:internal/readline/interface:259:10) at Socket.emit (node:events:525:35) at endReadableNT (node:internal/streams/readable:1359:12) at process.processTicksAndRejections (node:internal/process/task_queues:82:21) Node.js v18.16.0 ➜ test git:(main) ✗
headless: true
will default to the new Headless mode for Chrome instead of the old Headless implementation. For more information, please see https://developer.chrome.com/articles/new-headless/. Consider opting in early by passingheadless: "new"
topuppeteer.launch()
If you encounter any bugs, please report them to https://github.com/puppeteer/puppeteer/issues/new/choose. /home/pptruser/node_modules/@puppeteer/browsers/lib/cjs/launch.js:262 reject(new Error([ ^ Error: Failed to launch the browser process! [0427/102314.926500:ERROR:stack_trace_posix.cc(811)] Failed to parse the contents of /proc/self/maps [0427/102315.669200:ERROR:stack_trace_posix.cc(811)] Failed to parse the contents of /proc/self/maps [0427/102315.670539:ERROR:stack_trace_posix.cc(811)] Failed to parse the contents of /proc/self/maps [0427/102315.700621:FATAL:zygote_main_linux.cc(162)] Check failed: sandbox::ThreadHelpers::IsSingleThreaded(). #0 0x004007d22f72 base::debug::CollectStackTrace() #1 0x004007d0f4b3 base::debug::StackTrace::StackTrace() #2 0x004007c61fbf logging::LogMessage::~LogMessage() #3 0x004007c62b1e logging::LogMessage::~LogMessage() #4 0x004007c4bb07 logging::CheckError::~CheckError() #5 0x0040071bdfaf content::ZygoteMain() #6 0x0040071b7296 content::RunZygote() #7 0x0040071b8222 content::RunOtherNamedProcessTypeMain() #8 0x0040071b90cf content::ContentMainRunnerImpl::Run() #9 0x0040071b607a content::RunContentProcess() #10 0x0040071b6606 content::ContentMain() #11 0x0040077a02cf headless::HeadlessShellMain() #12 0x0040038d7255 ChromeMain #13 0x004010fa5d0a __libc_start_main #14 0x0040038d702a _start [0427/102315.700255:FATAL:zygote_main_linux.cc(162)] Check failed: sandbox::ThreadHelpers::IsSingleThreaded(). #0 0x004007d22f72 base::debug::CollectStackTrace() #1 0x004007d0f4b3 base::debug::StackTrace::StackTrace() #2 0x004007c61fbf logging::LogMessage::~LogMessage() #3 0x004007c62b1e logging::LogMessage::~LogMessage() #4 0x004007c4bb07 logging::CheckError::~CheckError() #5 0x0040071bdfaf content::ZygoteMain() #6 0x0040071b7296 content::RunZygote() #7 0x0040071b8222 content::RunOtherNamedProcessTypeMain() #8 0x0040071b90cf content::ContentMainRunnerImpl::Run() #9 0x0040071b607a content::RunContentProcess() #10 0x0040071b6606 content::ContentMain() #11 0x0040077a02cf headless::HeadlessShellMain() #12 0x0040038d7255 ChromeMain #13 0x004010fa5d0a libc_start_main #14 0x0040038d702a _start qemu: uncaught target signal 5 (Trace/breakpoint trap) - core dumped qemu: uncaught target signal 5 (Trace/breakpoint trap) - core dumped [0427/102316.358700:ERROR:bus.cc(399)] Failed to connect to the bus: Failed to connect to socket /run/dbus/system_bus_socket: No such file or directory Received signal 11 SEGV_MAPERR 40cf3900783c0008 #0 0x004007d22f72 base::debug::CollectStackTrace() #1 0x004007d0f4b3 base::debug::StackTrace::StackTrace() #2 0x004007d22a01 base::debug::(anonymous namespace)::StackDumpSignalHandler() #3 0x004010078140Puppeteer configuration
No response
Puppeteer version
latest
Node version
18.14.0
Package manager
npm
Package manager version
-
Operating system
macOS