Nin*_*pac 5 linux ubuntu node.js seccomp puppeteer
这是我的测试脚本:
\nbug.hr/homepage.js
\nconst puppeteer = require(\'puppeteer-extra\');\n\n(async () => {\n const eventPage = `https://www.bug.hr/`;\n const browser = await puppeteer.launch({\n headless: true,\n dumpio: true\n });\n const page = await browser.newPage();\n await page.goto(eventPage, {\n waitUntil: \'domcontentloaded\'\n });\n console.log("TITLE: ", await page.evaluate(() => document.title));\n await browser.close();\n})();\n
Run Code Online (Sandbox Code Playgroud)\n这应该启动 Puppeteer (并且在我重新启动服务器后启动),相反,我得到了这个:
\nubuntu@ip-123-45-67-89:/var/www/tests$ env DEBUG="puppeteer:*" node bug.hr/homepage.js \n puppeteer:launcher Calling /usr/bin/chromium-browser --disable-background-networking --enable-features=NetworkService,NetworkServiceInProcess --disable-background-timer-throttling --disable-backgrounding-occluded-windows --disable-breakpad --disable-client-side-phishing-detection --disable-component-extensions-with-background-pages --disable-default-apps --disable-dev-shm-usage --disable-extensions --disable-features=Translate --disable-hang-monitor --disable-ipc-flooding-protection --disable-popup-blocking --disable-prompt-on-repost --disable-renderer-backgrounding --disable-sync --force-color-profile=srgb --metrics-recording-only --no-first-run --enable-automation --password-store=basic --use-mock-keychain --enable-blink-features=IdleDetection --headless --hide-scrollbars --mute-audio about:blank --remote-debugging-port=0 --user-data-dir=/tmp/puppeteer_dev_chrome_profile-fvYjAc +0ms\n\nDevTools listening on ws://127.0.0.1:42943/devtools/browser/5a94e4ce-f053-4e83-afdb-f44731fc185e\n[1109/015336.602361:ERROR:devtools_http_handler.cc(292)] Error writing DevTools active port to file\n[1109/015336.608627:ERROR:gpu_init.cc(453)] Passthrough is not supported, GL is swiftshader, ANGLE is \n[1109/015336.612599:FATAL:sandbox_bpf.cc(283)] Kernel refuses to turn on BPF filters\n[1109/015336.613361:FATAL:sandbox_bpf.cc(283)] Kernel refuses to turn on BPF filters\n[1109/015336.613265:FATAL:sandbox_bpf.cc(283)] Kernel refuses to turn on BPF filters\n puppeteer:protocol:SEND \xe2\x96\xba {"method":"Target.setDiscoverTargets","params":{"discover":true},"id":1} +0ms\n puppeteer:protocol:RECV \xe2\x97\x80 {"method":"Target.targetCreated","params":{"targetInfo":{"targetId":"17591FCF231B151133561BADC2D1A20C","type":"page","title":"","url":"about:blank","attached":false,"canAccessOpener":false,"browserContextId":"3F175AC4C3C999720E0FFEFA74971974"}}} +0ms\n puppeteer:protocol:RECV \xe2\x97\x80 {"method":"Target.targetCreated","params":{"targetInfo":{"targetId":"3066064f-b08d-429f-af6c-99c828566f63","type":"browser","title":"","url":"","attached":false,"canAccessOpener":false}}} +1ms\n puppeteer:protocol:RECV \xe2\x97\x80 {"method":"Target.targetCreated","params":{"targetInfo":{"targetId":"7b188175-60bc-4608-b6a2-a83ed34381b0","type":"browser","title":"","url":"","attached":true,"canAccessOpener":false}}} +0ms\n puppeteer:protocol:RECV \xe2\x97\x80 {"id":1,"result":{}} +0ms\n puppeteer:protocol:SEND \xe2\x96\xba {"method":"Target.createTarget","params":{"url":"about:blank"},"id":2} +4ms\n puppeteer:protocol:RECV \xe2\x97\x80 {"method":"Target.targetCreated","params":{"targetInfo":{"targetId":"BD017C91F9A3803C4D1204C1F648B61E","type":"page","title":"","url":"","attached":false,"canAccessOpener":false,"browserContextId":"3F175AC4C3C999720E0FFEFA74971974"}}} +4ms\n puppeteer:protocol:RECV \xe2\x97\x80 {"id":2,"result":{"targetId":"BD017C91F9A3803C4D1204C1F648B61E"}} +0ms\n[1109/015336.626616:FATAL:sandbox_bpf.cc(283)] Kernel refuses to turn on BPF filters\n puppeteer:protocol:RECV \xe2\x97\x80 {"method":"Target.targetCrashed","params":{"targetId":"17591FCF231B151133561BADC2D1A20C","status":"crashed","errorCode":133}} +187ms\n[1109/015336.827392:ERROR:gpu_process_host.cc(979)] GPU process exited unexpectedly: exit_code=133\n[1109/015336.827421:WARNING:gpu_process_host.cc(1292)] The GPU process has crashed 1 time(s)\n[1109/015336.834997:ERROR:gpu_init.cc(453)] Passthrough is not supported, GL is swiftshader, ANGLE is \n[1109/015336.838813:FATAL:sandbox_bpf.cc(283)] Kernel refuses to turn on BPF filters\n[1109/015336.839148:FATAL:sandbox_bpf.cc(283)] Kernel refuses to turn on BPF filters\n puppeteer:protocol:RECV \xe2\x97\x80 {"method":"Target.targetCrashed","params":{"targetId":"BD017C91F9A3803C4D1204C1F648B61E","status":"crashed","errorCode":133}} +49ms\n[1109/015337.039942:ERROR:gpu_process_host.cc(979)] GPU process exited unexpectedly: exit_code=133\n[1109/015337.039973:WARNING:gpu_process_host.cc(1292)] The GPU process has crashed 2 time(s)\n[1109/015337.047216:ERROR:gpu_init.cc(453)] Passthrough is not supported, GL is swiftshader, ANGLE is \n[1109/015337.051080:FATAL:sandbox_bpf.cc(283)] Kernel refuses to turn on BPF filters\n[1109/015337.051332:FATAL:sandbox_bpf.cc(283)] Kernel refuses to turn on BPF filters\n[1109/015337.248703:ERROR:gpu_process_host.cc(979)] GPU process exited unexpectedly: exit_code=133\n[1109/015337.248732:WARNING:gpu_process_host.cc(1292)] The GPU process has crashed 3 time(s)\n[1109/015337.255892:ERROR:gpu_init.cc(453)] Passthrough is not supported, GL is swiftshader, ANGLE is \n[1109/015337.259819:FATAL:sandbox_bpf.cc(283)] Kernel refuses to turn on BPF filters\n[1109/015337.260091:FATAL:sandbox_bpf.cc(283)] Kernel refuses to turn on BPF filters\n[1109/015337.454161:ERROR:gpu_process_host.cc(979)] GPU process exited unexpectedly: exit_code=133\n[1109/015337.454191:WARNING:gpu_process_host.cc(1292)] The GPU process has crashed 4 time(s)\n[1109/015337.461741:ERROR:gpu_init.cc(453)] Passthrough is not supported, GL is swiftshader, ANGLE is \n[1109/015337.465935:FATAL:sandbox_bpf.cc(283)] Kernel refuses to turn on BPF filters\n[1109/015337.466181:FATAL:sandbox_bpf.cc(283)] Kernel refuses to turn on BPF filters\n[1109/015337.666248:ERROR:gpu_process_host.cc(979)] GPU process exited unexpectedly: exit_code=133\n[1109/015337.666276:WARNING:gpu_process_host.cc(1292)] The GPU process has crashed 5 time(s)\n[1109/015337.673524:ERROR:gpu_init.cc(453)] Passthrough is not supported, GL is swiftshader, ANGLE is \n[1109/015337.677539:FATAL:sandbox_bpf.cc(283)] Kernel refuses to turn on BPF filters\n[1109/015337.677807:FATAL:sandbox_bpf.cc(283)] Kernel refuses to turn on BPF filters\n[1109/015337.880581:ERROR:gpu_process_host.cc(979)] GPU process exited unexpectedly: exit_code=133\n[1109/015337.880610:WARNING:gpu_process_host.cc(1292)] The GPU process has crashed 6 time(s)\n[1109/015337.882645:ERROR:gpu_init.cc(453)] Passthrough is not supported, GL is disabled, ANGLE is \n[1109/015337.884399:FATAL:sandbox_bpf.cc(283)] Kernel refuses to turn on BPF filters\n[1109/015337.884679:FATAL:sandbox_bpf.cc(283)] Kernel refuses to turn on BPF filters\n[1109/015338.076122:ERROR:gpu_process_host.cc(979)] GPU process exited unexpectedly: exit_code=133\n[1109/015338.076151:WARNING:gpu_process_host.cc(1292)] The GPU process has crashed 7 time(s)\n[1109/015338.078253:ERROR:gpu_init.cc(453)] Passthrough is not supported, GL is disabled, ANGLE is \n[1109/015338.079942:FATAL:sandbox_bpf.cc(283)] Kernel refuses to turn on BPF filters\n[1109/015338.080236:FATAL:sandbox_bpf.cc(283)] Kernel refuses to turn on BPF filters\n[1109/015338.268891:ERROR:gpu_process_host.cc(979)] GPU process exited unexpectedly: exit_code=133\n[1109/015338.268920:WARNING:gpu_process_host.cc(1292)] The GPU process has crashed 8 time(s)\n[1109/015338.271026:ERROR:gpu_init.cc(453)] Passthrough is not supported, GL is disabled, ANGLE is \n[1109/015338.272679:FATAL:sandbox_bpf.cc(283)] Kernel refuses to turn on BPF filters\n[1109/015338.272975:FATAL:sandbox_bpf.cc(283)] Kernel refuses to turn on BPF filters\n[1109/015338.461377:ERROR:gpu_process_host.cc(979)] GPU process exited unexpectedly: exit_code=133\n[1109/015338.461406:WARNING:gpu_process_host.cc(1292)] The GPU process has crashed 9 time(s)\n[1109/015338.461419:FATAL:gpu_data_manager_impl_private.cc(417)] GPU process isn\'t usable. Goodbye.\n
Run Code Online (Sandbox Code Playgroud)\n我无法随意复制它。服务器运行一两周后会出现这种情况。\n重新启动服务器后,它会再次运行。
\nKernel refuses to turn on BPF filters
从日志来看,我相信罪魁祸首是。
错误来源:https://chromium.googlesource.com/chromium/src/+/lkgr/sandbox/linux/seccomp-bpf/sandbox_bpf.cc#282
\n可以通过--disable-seccomp-filter-sandbox
向 Chrome 传递参数来修复,这会引入安全问题,因为它会禁用 Chrome 沙箱的第 2 层(https://chromium.googlesource.com/chromium/src/+/HEAD/docs/linux/sandboxing.md #the-sandbox-1 )
/usr/bin/chromium-browser --product-version
给出 95.0.4638.69
当我跑步时也会发生这种情况apt update && apt upgrade
:
/usr/bin/mandb: can\'t load seccomp filter: Unknown error 524\n/usr/bin/mandb: can\'t load seccomp filter: Unknown error 524/usr/bin/mandb:\ncan\'t load seccomp filter: Unknown error 524\n/usr/bin/mandb: can\'t load seccomp filter: Unknown error 524\n/usr/bin/mandb: can\'t load seccomp filter: Unknown error 524\n/usr/bin/mandb: can\'t load seccomp filter: Unknown error 524\n/usr/bin/mandb: can\'t load seccomp filter: Unknown error 524\n/usr/bin/mandb: can\'t load seccomp filter: Unknown error 524\n/usr/bin/mandb: can\'t load seccomp filter: Unknown error 524\n/usr/bin/mandb: can\'t load seccomp filter: Unknown error 524\n/usr/bin/mandb: can\'t load seccomp filter: Unknown error 524\n/usr/bin/mandb: can\'t load seccomp filter: Unknown error 524\n/usr/bin/mandb: can\'t load seccomp filter: Unknown error 524\n/usr/bin/mandb: can\'t load seccomp filter/usr/bin/mandb: can\'t load seccomp filter: Unknown error 524: Unknown error 524\n
Run Code Online (Sandbox Code Playgroud)\n这在 Ubuntu-amd64 上没有发生(现在是 Arm)。
\n有任何想法吗?
\n谢谢
\n小智 2
尝试添加{args: ['--no-sandbox']}
标志,await puppeteer.launch()
因为考虑到错误,这似乎是沙箱问题FATAL:sandbox_bpf.cc(283)
归档时间: |
|
查看次数: |
2200 次 |
最近记录: |