plotly / Kaleido

Fast static image export for web-based visualization libraries with zero dependencies
Other
363 stars 36 forks source link

Have to use --single-process Chromium on Docker ARM64 #116

Open TiemenSch opened 2 years ago

TiemenSch commented 2 years ago

Turns out that I'm running into the same issues as https://github.com/plotly/Kaleido/issues/88 on ARM64 now:

#12 32.21 error: Failed to start Kaleido subprocess. Error stream:
#12 32.21 error: 
#12 32.21 error: [1021/124029.475100:WARNING:resource_bundle.cc(431)] locale_file_path.empty() for locale 
#12 32.21 error: [1021/124029.740378:WARNING:resource_bundle.cc(431)] locale_file_path.empty() for locale 
#12 32.21 error: [1021/124029.753443:WARNING:resource_bundle.cc(431)] locale_file_path.empty() for locale 
#12 32.21 error: [1021/124029.763457:FATAL:zygote_main_linux.cc(161)] Check failed: sandbox::ThreadHelpers::IsSingleThreaded(). 
#12 32.21 error: #0 0x004004756eb0 base::debug::CollectStackTrace()
#12 32.21 error: #1 0x0040046db7f4 base::debug::StackTrace::StackTrace()
#12 32.21 error: #2 0x0040046ea72c logging::LogMessage::~LogMessage()
#12 32.21 error: #3 0x0040046eb030 logging::LogMessage::~LogMessage()
#12 32.21 error: #4 0x00400448d87c content::ZygoteMain()
#12 32.21 error: #5 0x00400447e568 content::RunZygote()
#12 32.21 error: #6 0x00400447f6d8 content::ContentMainRunnerImpl::Run()
#12 32.21 error: #7 0x00400447d39c content::RunContentProcess()
#12 32.21 error: #8 0x00400447db3c content::ContentMain()
#12 32.21 error: #9 0x0040044cb08c headless::(anonymous namespace)::RunContentMain()
#12 32.21 error: #10 0x0040044caf04 headless::RunChildProcessIfNeeded()
#12 32.21 error: #11 0x0040028d8e00 main
#12 32.21 error: #12 0x0040086ecd24 __libc_start_main
#12 32.21 error: #13 0x0040028d33b4 (/usr/local/lib/python3.8/site-packages/kaleido/executable/bin/kaleido+0x28d33b3)
#12 32.21 error: 
#12 32.21 error: Received signal 6
#12 32.21 error: #0 0x004004756eb0 [1021/124029.781871:FATAL:zygote_main_linux.cc(161)] Check failed: sandbox::ThreadHelpers::IsSingleThreaded(). 
#12 32.21 error: #0 0x004004756eb0 base::debug::CollectStackTrace()
#12 32.21 error: #1 0x0040046db7f4 base::debug::StackTrace::StackTrace()
#12 32.21 error: #2 0x0040046ea72c logging::LogMessage::~LogMessage()
#12 32.21 error: #3 0x0040046eb030 logging::LogMessage::~LogMessage()
#12 32.21 error: #4 0x00400448d87c content::ZygoteMain()
#12 32.21 error: #5 0x00400447e568 content::RunZygote()
#12 32.21 error: #6 0x00400447f6d8 content::ContentMainRunnerImpl::Run()
#12 32.21 error: #7 0x00400447d39c content::RunContentProcess()
#12 32.21 error: #8 0x00400447db3c content::ContentMain()
#12 32.21 error: #9 0x0040044cb08c headless::(anonymous namespace)::RunContentMain()
#12 32.21 error: #10 0x0040044caf04 headless::RunChildProcessIfNeeded()
#12 32.21 error: #11 0x0040028d8e00 main
#12 32.21 error: #12 0x0040086ecd24 __libc_start_main
#12 32.21 error: #13 0x0040028d33b4 (/usr/local/lib/python3.8/site-packages/kaleido/executable/bin/kaleido+0x28d33b3)
#12 32.21 error: 
#12 32.21 error: Received signal 6
#12 32.21 error: #0 0x004004756eb0 base::debug::CollectStackTrace()
#12 32.21 error: #1 0x0040046db7f4 base::debug::CollectStackTrace()
#12 32.21 error: #1 0x0040046db7f4 base::debug::StackTrace::StackTrace()
#12 32.21 error: #2 0x004004756e7c base::debug::StackTrace::StackTrace()
#12 32.21 error: #2 0x004004756e7c base::debug::(anonymous namespace)::StackDumpSignalHandler()
#12 32.21 error: #3 0x004008353500 ([stack]+0x83534ff)
#12 32.21 error: #4 0x0040086fe714 gsignal
#12 32.21 error: #5 0x0040086ec8e8 abort
#12 32.21 error: #6 0x004004755f24 base::debug::(anonymous namespace)::StackDumpSignalHandler()
#12 32.21 error: #3 0x004008353520 ([stack]+0x835351f)
#12 32.21 error: #4 0x0040086fe714 gsignal
#12 32.21 error: #5 0x0040086ec8e8 abort
#12 32.21 error: #6 0x004004755f24 base::debug::BreakDebugger()
#12 32.21 error: #7 0x0040046eab3c base::debug::BreakDebugger()
#12 32.21 error: #7 0x0040046eab3c logging::LogMessage::~LogMessage()
#12 32.21 error: #8 0x0040046eb030 logging::LogMessage::~LogMessage()
#12 32.21 error: #8 0x0040046eb030 logging::LogMessage::~LogMessage()
#12 32.21 error: #9 0x00400448d87c logging::LogMessage::~LogMessage()
#12 32.21 error: #9 0x00400448d87c content::ZygoteMain()
#12 32.21 error: #10 0x00400447e568 content::ZygoteMain()
#12 32.21 error: #10 0x00400447e568 content::RunZygote()
#12 32.21 error: #11 0x00400447f6d8 content::RunZygote()
#12 32.21 error: #11 0x00400447f6d8 content::ContentMainRunnerImpl::Run()
#12 32.21 error: #12 0x00400447d39c content::ContentMainRunnerImpl::Run()
#12 32.21 error: #12 0x00400447d39c content::RunContentProcess()
#12 32.21 error: #13 0x00400447db3c content::RunContentProcess()
#12 32.21 error: #13 0x00400447db3c content::ContentMain()
#12 32.21 error: #14 0x0040044cb08c content::ContentMain()
#12 32.21 error: #14 0x0040044cb08c headless::(anonymous namespace)::RunContentMain()
#12 32.21 error: #15 0x0040044caf04 headless::(anonymous namespace)::RunContentMain()
#12 32.21 error: #15 0x0040044caf04 headless::RunChildProcessIfNeeded()
#12 32.21 error: #16 0x0040028d8e00 main
#12 32.21 error: #17 0x0040086ecd24 __libc_start_main
#12 32.21 error: #18 0x0040028d33b4 headless::RunChildProcessIfNeeded()
#12 32.21 error: #16 0x0040028d8e00 main
#12 32.21 error: #17 0x0040086ecd24 __libc_start_main
#12 32.21 error: #18 0x0040028d33b4 (/usr/local/lib/python3.8/site-packages/kaleido/executable/bin/kaleido+0x28d33b3)
#12 32.21 error: [end of stack trace]
#12 32.21 error: Calling _exit(1). Core file will not be generated.
#12 32.21 error: (/usr/local/lib/python3.8/site-packages/kaleido/executable/bin/kaleido+0x28d33b3)
#12 32.21 error: [end of stack trace]
#12 32.21 error: Calling _exit(1). Core file will not be generated.
#12 32.21 error: Unsupported ioctl: cmd=0x8946
#12 32.21 error: [1021/124031.544023:WARNING:gpu_process_host.cc(1274)] The GPU process has crashed 1 time(s)
#12 32.21 error: qemu: unknown option 'type=utility'
#12 32.21 error: [1021/124031.713624:WARNING:gpu_process_host.cc(1274)] The GPU process has crashed 2 time(s)
#12 32.21 error: [1021/124031.726535:WARNING:gpu_process_host.cc(1274)] The GPU process has crashed 3 time(s)
#12 32.21 error: [1021/124031.743622:WARNING:gpu_process_host.cc(1274)] The GPU process has crashed 4 time(s)
#12 32.21 error: [1021/124031.844312:WARNING:gpu_process_host.cc(1274)] The GPU process has crashed 5 time(s)
#12 32.21 error: [1021/124031.847406:ERROR:network_service_instance_impl.cc(286)] Network service crashed, restarting service.
#12 32.21 error: qemu: unknown option 'type=utility'
#12 32.21 error: [1021/124031.944065:WARNING:gpu_process_host.cc(1274)] The GPU process has crashed 6 time(s)
#12 32.21 error: [1021/124031.945056:FATAL:gpu_data_manager_impl_private.cc(407)] GPU process isn't usable. Goodbye.
#12 32.21 error: #0 0x004004756eb0 base::debug::CollectStackTrace()
#12 32.21 error: #1 0x0040046db7f4 base::debug::StackTrace::StackTrace()
#12 32.21 error: #2 0x0040046ea72c logging::LogMessage::~LogMessage()
#12 32.21 error: #3 0x00400343f278 content::(anonymous namespace)::IntentionallyCrashBrowserForUnusableGpuProcess()
#12 32.21 error: #4 0x00400343d294 content::GpuDataManagerImplPrivate::FallBackToNextGpuMode()
#12 32.21 error: #5 0x00400343bad0 content::GpuDataManagerImpl::FallBackToNextGpuMode()
#12 32.21 error: #6 0x00400344472c content::GpuProcessHost::RecordProcessCrash()
#12 32.21 error: #7 0x0040032f3a30 content::BrowserChildProcessHostImpl::OnProcessLaunchFailed()
#12 32.21 error: #8 0x00400334c6d8 content::internal::ChildProcessLauncherHelper::PostLaunchOnClientThread()
#12 32.21 error: #9 0x00400334c920 base::internal::Invoker<>::RunOnce()
#12 32.21 error: #10 0x00400471d334 base::TaskAnnotator::RunTask()
#12 32.21 error: #11 0x00400472d920 base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::DoWorkImpl()
#12 32.21 error: #12 0x00400472d68c base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::DoWork()
#12 32.21 error: #13 0x004004775448 base::MessagePumpLibevent::Run()
#12 32.21 error: #14 0x00400472e0b0 base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::Run()
#12 32.21 error: #15 0x00400470a118 base::RunLoop::Run()
#12 32.21 error: #16 0x00400330dd60 content::BrowserProcessSubThread::IOThreadRun()
#12 32.21 error: #17 0x004004745150 base::Thread::ThreadMain()
#12 32.21 error: #18 0x004004765410 base::(anonymous namespace)::ThreadFunc()
#12 32.21 error: #19 0x0040083ac7e4 start_thread
#12 32.21 error: #20 0x00400879badc (/lib/aarch64-linux-gnu/libc-2.28.so+0xcfadb)
#12 32.21 error: Task trace:
#12 32.21 error: #0 0x00400334c54c content::internal::ChildProcessLauncherHelper::PostLaunchOnLauncherThread()
#12 32.21 error: #1 0x00400334c08c content::internal::ChildProcessLauncherHelper::StartLaunchOnClientThread()
#12 32.21 error: #2 0x0040037fc850 content::VizProcessTransportFactory::ConnectHostFrameSinkManager()
#12 32.21 error: #3 0x004004cc6258 mojo::SimpleWatcher::Context::Notify()
#12 32.21 error: #4 0x0040037fc850 content::VizProcessTransportFactory::ConnectHostFrameSinkManager()
#12 32.21 error: Task trace buffer limit hit, update PendingTask::kTaskBacktraceLength to increase.
#12 32.21 error: 
#12 32.21 error: Received signal 6
#12 32.21 error: #0 0x004004756eb0 base::debug::CollectStackTrace()
#12 32.21 error: #1 0x0040046db7f4 base::debug::StackTrace::StackTrace()
#12 32.21 error: #2 0x004004756e7c base::debug::(anonymous namespace)::StackDumpSignalHandler()
#12 32.21 error: #3 0x004023322d70 <unknown>
#12 32.21 error: #4 0x0040086fe714 gsignal
#12 32.21 error: #5 0x0040086ec8e8 abort
#12 32.21 error: #6 0x004004755f24 base::debug::BreakDebugger()
#12 32.21 error: #7 0x0040046eab3c logging::LogMessage::~LogMessage()
#12 32.21 error: #8 0x00400343f278 content::(anonymous namespace)::IntentionallyCrashBrowserForUnusableGpuProcess()
#12 32.21 error: #9 0x00400343d294 content::GpuDataManagerImplPrivate::FallBackToNextGpuMode()
#12 32.21 error: #10 0x00400343bad0 content::GpuDataManagerImpl::FallBackToNextGpuMode()
#12 32.21 error: #11 0x00400344472c content::GpuProcessHost::RecordProcessCrash()
#12 32.21 error: #12 0x0040032f3a30 content::BrowserChildProcessHostImpl::OnProcessLaunchFailed()
#12 32.21 error: #13 0x00400334c6d8 content::internal::ChildProcessLauncherHelper::PostLaunchOnClientThread()
#12 32.21 error: #14 0x00400334c920 base::internal::Invoker<>::RunOnce()
#12 32.21 error: #15 0x00400471d334 base::TaskAnnotator::RunTask()
#12 32.21 error: #16 0x00400472d920 base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::DoWorkImpl()
#12 32.21 error: #17 0x00400472d68c base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::DoWork()
#12 32.21 error: #18 0x004004775448 base::MessagePumpLibevent::Run()
#12 32.21 error: #19 0x00400472e0b0 base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::Run()
#12 32.21 error: #20 0x00400470a118 base::RunLoop::Run()
#12 32.21 error: #21 0x00400330dd60 content::BrowserProcessSubThread::IOThreadRun()
#12 32.21 error: #22 0x004004745150 base::Thread::ThreadMain()
#12 32.21 error: #23 0x004004765410 base::(anonymous namespace)::ThreadFunc()
#12 32.21 error: #24 0x0040083ac7e4 start_thread
#12 32.21 error: #25 0x00400879badc (/lib/aarch64-linux-gnu/libc-2.28.so+0xcfadb)
#12 32.21 error: [end of stack trace]
#12 32.21 error: Calling _exit(1). Core file will not be generated.

This happens when Kaleido is invoked during a Docker build on ARM64 (when using Docker buildx on AMD64 that is). Hence, I'm not sure if this is a pure Kaleido problem, a QEMU problem, or some other source.

What can I do to debug this further?

TiemenSch commented 2 years ago

Providing the --single-process Chromium flag clears the error, although AFAIK I can't permanently change the defaults? Even then, I read that it isn't a recommended flag to use by default.

nirentuladhar commented 2 years ago

Did you manage to fix it by any chance? I'm running into similar error when trying to build and invoke locally. I'm using M1 with linux/amd64 container. Adding that flag doesn't clear the error for me. It works fine on AWS Lambda though.

Invoking Container created from generatechartsfunction:python3.8-v1
Building image..................
Skip pulling image and use local one: generatechartsfunction:rapid-1.34.1-x86_64.

START RequestId: 64edd9ba-d547-4dd9-92fd-2d0873f614c9 Version: $LATEST
[ERROR] ValueError: Failed to start Kaleido subprocess. Error stream:

[1101/053521.784611:WARNING:resource_bundle.cc(431)] locale_file_path.empty() for locale
[1101/053521.970159:WARNING:resource_bundle.cc(431)] locale_file_path.empty() for locale
[1101/053521.970255:WARNING:resource_bundle.cc(431)] locale_file_path.empty() for locale
[1101/053521.987449:FATAL:zygote_main_linux.cc(161)] Check failed: sandbox::ThreadHelpers::IsSingleThreaded().
#0 0x004004e28d79 base::debug::CollectStackTrace()
#1 0x004004da6633 base::debug::StackTrace::StackTrace()
#2 0x004004db615f logging::LogMessage::~LogMessage()
#3 0x004004db6cde logging::LogMessage::~LogMessage()
#4 0x004004b21345 content::ZygoteMain()
#5 0x004004b0e8ea content::RunZygote()
#6 0x004004b0fb64 content::ContentMainRunnerImpl::Run()
#7 0x004004b0d374 content::RunContentProcess()
#8 0x004004b0dcfc content::ContentMain()
#9 0x004004b5f182 headless::(anonymous namespace)::RunContentMain()
#10 0x004004b5efbb headless::RunChildProcessIfNeeded()
#11 0x004002b7df09 main
#12 0x00400b66013a __libc_start_main
#13 0x004002b773ea _start

[1101/053521.987458:FATAL:zygote_main_linux.cc(161)] Check failed: sandbox::ThreadHelpers::IsSingleThreaded().
#0 0x004004e28d79 base::debug::CollectStackTrace()
#1 0x004004da6633 base::debug::StackTrace::StackTrace()
#2 0x004004db615f logging::LogMessage::~LogMessage()
#3 0x004004db6cde logging::LogMessage::~LogMessage()
#4 0x004004b21345 content::ZygoteMain()
#5 0x004004b0e8ea content::RunZygote()
#6 0x004004b0fb64 content::ContentMainRunnerImpl::Run()
#7 0x004004b0d374 content::RunContentProcess()
#8 0x004004b0dcfc content::ContentMain()
#9 0x004004b5f182 headless::(anonymous namespace)::RunContentMain()
#10 0x004004b5efbb headless::RunChildProcessIfNeeded()
#11 0x004002b7df09 main
#12 0x00400b66013a __libc_start_main
#13 0x004002b773ea _start

Received signal 6
Received signal 6
##0 0x004004e28d79 0 0x004004e28d79 base::debug::CollectStackTrace()base::debug::CollectStackTrace()
#1
 #0x1004004da6633  0x004004da6633 base::debug::StackTrace::StackTrace()
base::debug::StackTrace::StackTrace()#
2# 20x 0x004004e2895b 004004e2895b base::debug::(anonymous namespace)::StackDumpSignalHandler()base::debug::(anonymous namespace)::StackDumpSignalHandler()
#3
 #0x300400a2f67e0  0x00400a2f67e0 (/usr/lib64/libpthread-2.26.so+0x117df)
#4 0x(/usr/lib64/libpthread-2.26.so+0x117df)00400b672ca0
 #4 0x00400b672ca0 __GI_raise__GI_raise
#
5# 50x 00400b6741480x 00400b674148 __GI_abort
#6 0x004004e278f5 __GI_abort
#6 0x004004e278f5 base::debug::BreakDebugger()base::debug::BreakDebugger()
#7
 #0x7004004db65b2  0x004004db65b2 logging::LogMessage::~LogMessage()logging::LogMessage::~LogMessage()

##88  0x0x004004db6cde004004db6cde  logging::LogMessage::~LogMessage()
#9 0x004004b21345 logging::LogMessage::~LogMessage()
#9 0x004004b21345 content::ZygoteMain()
#10 0x004004b0e8ea content::ZygoteMain()
#10 0x004004b0e8ea content::RunZygote()
#11 0x004004b0fb64 content::RunZygote()
#11 0x004004b0fb64 content::ContentMainRunnerImpl::Run()
#12 0x004004b0d374 content::ContentMainRunnerImpl::Run()
#12 0x004004b0d374 content::RunContentProcess()
#13 0x004004b0dcfc content::RunContentProcess()
#13 0x004004b0dcfc content::ContentMain()
#14 0x004004b5f182 content::ContentMain()
#14 0x004004b5f182 headless::(anonymous namespace)::RunContentMain()
#15 0x004004b5efbb headless::RunChildProcessIfNeeded()
#16 0x004002b7df09 main
#17 0x00400b66013a __libc_start_main
#18 0x004002b773ea headless::(anonymous namespace)::RunContentMain()
#15 0x004004b5efbb headless::RunChildProcessIfNeeded()
#16 0x004002b7df09 main
#17 0x00400b66013a __libc_start_main
#18 0x004002b773ea _start
  r8: 0000000000000000  r9: 0000004009eb4280 r10: 0000000000000008 r11: 000000400b7b69d0
 r12: 0000004009eb4d20 r13: 0000185fd8c04dc0 r14: 0000185fd8c04dd0 r15: 0000185fd8c04dd8
  di: 0000000000000002  si: 0000004009eb4280  bp: 0000004009eb44d0  bx: 0000000000000006
  dx: 0000000000000000  ax: 0000000000000000  cx: 0000000000000000  sp: 0000004009eb4280
  ip: 000000400b672ca0 efl: 0000000000000246 cgf: 002b000000000033 erf: 0000000000000000
 trp: ffffffffffffffff msk: 0000000000000000 cr2: 0000000000000000
[end of stack trace]
Calling _exit(1). Core file will not be generated.
_start
  r8: 0000000000000000  r9: 0000004009eb4290 r10: 0000000000000008 r11: 000000400b7b69d0
 r12: 0000004009eb4d30 r13: 000018a73ee40dc0 r14: 000018a73ee40dd0 r15: 000018a73ee40dd8
  di: 0000000000000002  si: 0000004009eb4290  bp: 0000004009eb44e0  bx: 0000000000000006
  dx: 0000000000000000  ax: 0000000000000000  cx: 0000000000000000  sp: 0000004009eb4290
  ip: 000000400b672ca0 efl: 0000000000000246 cgf: 002b000000000033 erf: 0000000000000000
 trp: ffffffffffffffff msk: 0000000000000000 cr2: 0000000000000000
[end of stack trace]
Calling _exit(1). Core file will not be generated.
[1101/053522.559107:ERROR:file_path_watcher_linux.cc(315)] inotify_init() failed: Function not implemented (38)
[1101/053525.170400:WARNING:ipc_message_attachment_set.cc(49)] MessageAttachmentSet destroyed with unconsumed attachments: 0/1
[1101/053525.170634:ERROR:command_buffer_proxy_impl.cc(122)] ContextResult::kTransientFailure: Failed to send GpuChannelMsg_CreateCommandBuffer.
/var/task/kaleido/executable/kaleido: line 10:    37 Killed                  ./bin/kaleido $@
    raise ValueError(message)pes/base.py", line 198, in _ensure_kaleidoorm
END RequestId: 64edd9ba-d547-4dd9-92fd-2d0873f614c9
REPORT RequestId: 64edd9ba-d547-4dd9-92fd-2d0873f614c9  Init Duration: 1.36 ms  Duration: 8005.14 ms    Billed Duration: 8006 ms    Memory Size: 128 MB Max Memory Used: 128 MB
{"errorMessage": "Failed to start Kaleido subprocess. Error stream:\n\n[1101/053521.784611:WARNING:resource_bundle.cc(431)] locale_file_path.empty() for locale \n[1101/053521.970159:WARNING:resource_bundle.cc(431)] locale_file_path.empty() for locale \n[1101/053521.970255:WARNING:resource_bundle.cc(431)] locale_file_path.empty() for locale \n[1101/053521.987449:FATAL:zygote_main_linux.cc(161)] Check failed: sandbox::ThreadHelpers::IsSingleThreaded(). \n#0 0x004004e28d79 base::debug::CollectStackTrace()\n#1 0x004004da6633 base::debug::StackTrace::StackTrace()\n#2 0x004004db615f logging::LogMessage::~LogMessage()\n#3 0x004004db6cde logging::LogMessage::~LogMessage()\n#4 0x004004b21345 content::ZygoteMain()\n#5 0x004004b0e8ea content::RunZygote()\n#6 0x004004b0fb64 content::ContentMainRunnerImpl::Run()\n#7 0x004004b0d374 content::RunContentProcess()\n#8 0x004004b0dcfc content::ContentMain()\n#9 0x004004b5f182 headless::(anonymous namespace)::RunContentMain()\n#10 0x004004b5efbb headless::RunChildProcessIfNeeded()\n#11 0x004002b7df09 main\n#12 0x00400b66013a __libc_start_main\n#13 0x004002b773ea _start\n\n[1101/053521.987458:FATAL:zygote_main_linux.cc(161)] Check failed: sandbox::ThreadHelpers::IsSingleThreaded(). \n#0 0x004004e28d79 base::debug::CollectStackTrace()\n#1 0x004004da6633 base::debug::StackTrace::StackTrace()\n#2 0x004004db615f logging::LogMessage::~LogMessage()\n#3 0x004004db6cde logging::LogMessage::~LogMessage()\n#4 0x004004b21345 content::ZygoteMain()\n#5 0x004004b0e8ea content::RunZygote()\n#6 0x004004b0fb64 content::ContentMainRunnerImpl::Run()\n#7 0x004004b0d374 content::RunContentProcess()\n#8 0x004004b0dcfc content::ContentMain()\n#9 0x004004b5f182 headless::(anonymous namespace)::RunContentMain()\n#10 0x004004b5efbb headless::RunChildProcessIfNeeded()\n#11 0x004002b7df09 main\n#12 0x00400b66013a __libc_start_main\n#13 0x004002b773ea _start\n\nReceived signal 6\nReceived signal 6\n##0 0x004004e28d79 0 0x004004e28d79 base::debug::CollectStackTrace()base::debug::CollectStackTrace()\n#1\n #0x1004004da6633  0x004004da6633 base::debug::StackTrace::StackTrace()\nbase::debug::StackTrace::StackTrace()#\n2# 20x 0x004004e2895b 004004e2895b base::debug::(anonymous namespace)::StackDumpSignalHandler()base::debug::(anonymous namespace)::StackDumpSignalHandler()\n#3\n #0x300400a2f67e0  0x00400a2f67e0 (/usr/lib64/libpthread-2.26.so+0x117df)\n#4 0x(/usr/lib64/libpthread-2.26.so+0x117df)00400b672ca0\n #4 0x00400b672ca0 __GI_raise__GI_raise\n#\n5# 50x 00400b6741480x 00400b674148 __GI_abort\n#6 0x004004e278f5 __GI_abort\n#6 0x004004e278f5 base::debug::BreakDebugger()base::debug::BreakDebugger()\n#7\n #0x7004004db65b2  0x004004db65b2 logging::LogMessage::~LogMessage()logging::LogMessage::~LogMessage()\n\n##88  0x0x004004db6cde004004db6cde  logging::LogMessage::~LogMessage()\n#9 0x004004b21345 logging::LogMessage::~LogMessage()\n#9 0x004004b21345 content::ZygoteMain()\n#10 0x004004b0e8ea content::ZygoteMain()\n#10 0x004004b0e8ea content::RunZygote()\n#11 0x004004b0fb64 content::RunZygote()\n#11 0x004004b0fb64 content::ContentMainRunnerImpl::Run()\n#12 0x004004b0d374 content::ContentMainRunnerImpl::Run()\n#12 0x004004b0d374 content::RunContentProcess()\n#13 0x004004b0dcfc content::RunContentProcess()\n#13 0x004004b0dcfc content::ContentMain()\n#14 0x004004b5f182 content::ContentMain()\n#14 0x004004b5f182 headless::(anonymous namespace)::RunContentMain()\n#15 0x004004b5efbb headless::RunChildProcessIfNeeded()\n#16 0x004002b7df09 main\n#17 0x00400b66013a __libc_start_main\n#18 0x004002b773ea headless::(anonymous namespace)::RunContentMain()\n#15 0x004004b5efbb headless::RunChildProcessIfNeeded()\n#16 0x004002b7df09 main\n#17 0x00400b66013a __libc_start_main\n#18 0x004002b773ea _start\n  r8: 0000000000000000  r9: 0000004009eb4280 r10: 0000000000000008 r11: 000000400b7b69d0\n r12: 0000004009eb4d20 r13: 0000185fd8c04dc0 r14: 0000185fd8c04dd0 r15: 0000185fd8c04dd8\n  di: 0000000000000002  si: 0000004009eb4280  bp: 0000004009eb44d0  bx: 0000000000000006\n  dx: 0000000000000000  ax: 0000000000000000  cx: 0000000000000000  sp: 0000004009eb4280\n  ip: 000000400b672ca0 efl: 0000000000000246 cgf: 002b000000000033 erf: 0000000000000000\n trp: ffffffffffffffff msk: 0000000000000000 cr2: 0000000000000000\n[end of stack trace]\nCalling _exit(1). Core file will not be generated.\n_start\n  r8: 0000000000000000  r9: 0000004009eb4290 r10: 0000000000000008 r11: 000000400b7b69d0\n r12: 0000004009eb4d30 r13: 000018a73ee40dc0 r14: 000018a73ee40dd0 r15: 000018a73ee40dd8\n  di: 0000000000000002  si: 0000004009eb4290  bp: 0000004009eb44e0  bx: 0000000000000006\n  dx: 0000000000000000  ax: 0000000000000000  cx: 0000000000000000  sp: 0000004009eb4290\n  ip: 000000400b672ca0 efl: 0000000000000246 cgf: 002b000000000033 erf: 0000000000000000\n trp: ffffffffffffffff msk: 0000000000000000 cr2: 0000000000000000\n[end of stack trace]\nCalling _exit(1). Core file will not be generated.\n[1101/053522.559107:ERROR:file_path_watcher_linux.cc(315)] inotify_init() failed: Function not implemented (38)\n[1101/053525.170400:WARNING:ipc_message_attachment_set.cc(49)] MessageAttachmentSet destroyed with unconsumed attachments: 0/1\n[1101/053525.170634:ERROR:command_buffer_proxy_impl.cc(122)] ContextResult::kTransientFailure: Failed to send GpuChannelMsg_CreateCommandBuffer.\n/var/task/kaleido/executable/kaleido: line 10:    37 Killed                  ./bin/kaleido $@\n", "errorType": "ValueError", "stackTrace": ["  File \"/var/task/app.py\", line 25, in lambda_handler\n    body = generate_comprehensive_charts(analysis)\n", "  File \"/var/task/app.py\", line 578, in generate_comprehensive_charts\n    TIP = draw_series_chart(TIP_data)\n", "  File \"/var/task/app.py\", line 142, in draw_series_chart\n    png = pio.to_image(fig)\n", "  File \"/var/task/plotly/io/_kaleido.py\", line 145, in to_image\n    img_bytes = scope.transform(\n", "  File \"/var/task/kaleido/scopes/plotly.py\", line 153, in transform\n    response = self._perform_transform(\n", "  File \"/var/task/kaleido/scopes/base.py\", line 293, in _perform_transform\n    self._ensure_kaleido()\n", "  File \"/var/task/kaleido/scopes/base.py\", line 198, in _ensure_kaleido\n    raise ValueError(message)\n"]}
rectalogic commented 1 year ago

Here is a simple repro, on MacBook M1 using the puppeteer supplied amd64 image. Passing --single-process does not help:

% docker run -i --init --cap-add=SYS_ADMIN --rm ghcr.io/puppeteer/puppeteer:latest node <<EOF
const puppeteer = require('puppeteer');

(async () => {
  const browser = await puppeteer.launch({ args: ['--no-sandbox', '--single-process'] });
  const page = await browser.newPage();  
  await page.goto('https://example.com');
  await browser.close();
  console.log('done');
})();
EOF
WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
/home/pptruser/node_modules/puppeteer-core/lib/cjs/puppeteer/node/BrowserRunner.js:299
            reject(new Error([
                   ^

Error: Failed to launch the browser process!
[1010/170942.197059:ERROR:stack_trace_posix.cc(711)] Failed to parse the contents of /proc/self/maps
[1010/170942.591176:ERROR:stack_trace_posix.cc(711)] Failed to parse the contents of /proc/self/maps
[1010/170942.592508:ERROR:stack_trace_posix.cc(711)] Failed to parse the contents of /proc/self/maps
[1010/170942.615233:FATAL:zygote_main_linux.cc(162)] Check failed: sandbox::ThreadHelpers::IsSingleThreaded(). 
#0 0x0040077694e2 base::debug::CollectStackTrace()
#1 0x0040076daab3 base::debug::StackTrace::StackTrace()
#2 0x0040076d7cf7 logging::LogMessage::~LogMessage()
#3 0x0040076d8a8e logging::LogMessage::~LogMessage()
#4 0x004007227c27 content::ZygoteMain()
#5 0x004007222061 content::RunZygote()
#6 0x004007222f24 content::RunOtherNamedProcessTypeMain()
#7 0x004007223e07 content::ContentMainRunnerImpl::Run()
#8 0x004007221399 content::RunContentProcess()
#9 0x0040072214fe content::ContentMain()
#10 0x0040072833c6 headless::(anonymous namespace)::RunContentMain()
#11 0x004007283243 headless::RunChildProcessIfNeeded()
#12 0x004007281e15 headless::HeadlessShellMain()
#13 0x00400376c1e3 ChromeMain
#14 0x0040109f709b __libc_start_main
#15 0x00400376c02a _start

[1010/170942.614179:FATAL:zygote_main_linux.cc(162)] Check failed: sandbox::ThreadHelpers::IsSingleThreaded(). 
#0 0x0040077694e2 base::debug::CollectStackTrace()
#1 0x0040076daab3 base::debug::StackTrace::StackTrace()
#2 0x0040076d7cf7 logging::LogMessage::~LogMessage()
#3 0x0040076d8a8e logging::LogMessage::~LogMessage()
#4 0x004007227c27 content::ZygoteMain()
#5 0x004007222061 content::RunZygote()
#6 0x004007222f24 content::RunOtherNamedProcessTypeMain()
#7 0x004007223e07 content::ContentMainRunnerImpl::Run()
#8 0x004007221399 content::RunContentProcess()
#9 0x0040072214fe content::ContentMain()
#10 0x0040072833c6 headless::(anonymous namespace)::RunContentMain()
#11 0x004007283243 headless::RunChildProcessIfNeeded()
#12 0x004007281e15 headless::HeadlessShellMain()
#13 0x00400376c1e3 ChromeMain
#14 0x0040109f709b __libc_start_main
#15 0x00400376c02a _start

qemu: uncaught target signal 5 (Trace/breakpoint trap) - core dumped
qemu: uncaught target signal 5 (Trace/breakpoint trap) - core dumped
Received signal 11 SEGV_MAPERR 20202020202028
#0 0x0040077694e2 base::debug::CollectStackTrace()
#1 0x0040076daab3 base::debug::StackTrace::StackTrace()
#2 0x004007769001 base::debug::(anonymous namespace)::StackDumpSignalHandler()
#3 0x00400f4e0730 <unknown>
#4 0x00400887b4d8 FcStrSerializeAlloc
#5 0x004008869c4e FcDirCacheBuild
#6 0x00400886f7e6 FcDirCacheScan
#7 0x00400886f87e IA__FcDirCacheRead
#8 0x0040088656c7 FcConfigAddDirList
#9 0x004008865612 IA__FcConfigBuildFonts
#10 0x004008873661 IA__FcInitLoadConfigAndFonts
#11 0x004008864ab2 FcConfigInit
#12 0x0040089009a4 _ZN4base12NoDestructorIN3gfx12_GLOBAL__N_116GlobalFontConfigEDnEC2IJEEEDpOT_
#13 0x00400890029d gfx::GetGlobalFontConfig()
#14 0x004004bd84ae content::BrowserMainRunnerImpl::Initialize()
#15 0x00400722957a headless::HeadlessContentMainDelegate::RunProcess()
#16 0x004007222b22 content::RunBrowserProcessMain()
#17 0x004007223fe2 content::ContentMainRunnerImpl::RunBrowser()
#18 0x004007223e2b content::ContentMainRunnerImpl::Run()
#19 0x004007221399 content::RunContentProcess()
#20 0x0040072214fe content::ContentMain()
#21 0x0040072833c6 headless::(anonymous namespace)::RunContentMain()
#22 0x004007283068 headless::HeadlessShellMain()
#23 0x00400376c1e3 ChromeMain
#24 0x0040109f709b __libc_start_main
#25 0x00400376c02a _start
  r8: 000000000000eeff  r9: 00001dc8002b4000 r10: 0000000000014000 r11: 73746e6f662f6572
 r12: 00001dc8002ba208 r13: 00001dc800245d40 r14: 0000000000000010 r15: 00001dc8002b4000
  di: 00001dc8002458e0  si: 00001dc8002458e0  bp: 000000400f48f680  bx: 00001dc8002458e0
  dx: 00000000ee47735e  ax: 2f20202020202020  cx: 00001dc8ee6bc000  sp: 000000400f48f660
  ip: 000000400887b4d8 efl: 0000000000000202 cgf: 002b000000000033 erf: 0000000000000004
 trp: ffffffffffffffff msk: 0000000000000000 cr2: 0020202020202028
[end of stack trace]
qemu: uncaught target signal 11 (Segmentation fault) - core dumped

TROUBLESHOOTING: https://github.com/puppeteer/puppeteer/blob/main/docs/troubleshooting.md

    at onClose (/home/pptruser/node_modules/puppeteer-core/lib/cjs/puppeteer/node/BrowserRunner.js:299:20)
    at Interface.<anonymous> (/home/pptruser/node_modules/puppeteer-core/lib/cjs/puppeteer/node/BrowserRunner.js:287:24)
    at Interface.emit (node:events:525:35)
    at Interface.close (node:readline:590:8)
    at Socket.onend (node:readline:280:10)
    at Socket.emit (node:events:525:35)
    at endReadableNT (node:internal/streams/readable:1358:12)
    at processTicksAndRejections (node:internal/process/task_queues:83:21)
vroon5 commented 1 year ago

I also have a macbook M1 and I face the same ERROR:stack_trace_posix.cc(711)] Failed to parse the contents of /proc/self/maps

gvwilson commented 2 months ago

Thanks for your interest in Kaleido. We are currently working on an overhaul that might address your issue - we hope to have news in a few weeks and will post an update then. Thanks - @gvwilson