Open TiemenSch opened 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.
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"]}
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)
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
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
Turns out that I'm running into the same issues as https://github.com/plotly/Kaleido/issues/88 on ARM64 now:
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?