You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Heroku上Puppeteer首次构建后正常运行,后续调用失败的问题求助

Heroku上Puppeteer首次构建后正常运行,后续调用失败的问题求助

我已经折腾了快一个月,尝试在Heroku上让Puppeteer正常工作,几乎把相关讨论帖里的所有建议都试了个遍(包括用puppeteer-core搭配独立Chrome的方案),但还是卡在死循环里——别人能用的方法到我这就不管用。实在没辙了,想请各位大佬给点思路?

当前我的配置情况:

Buildpacks:

heroku/nodejs
https://github.com/jontewks/puppeteer-heroku-buildpack

版本信息:

  • Node – 18.20.6
  • NPM – 10.9.2

Puppeteer启动命令:

var browser = await puppeteer.launch(({
ignoreDefaultArgs: ['--disable-extensions'],
args: ['--no-sandbox', '--disable-setuid-sandbox',]
}));

测试中的异常表现(以Duck Duck Go为例):

  • 新编译完成后第一次运行完全正常
  • 第二次及之后的调用都会失败,错误日志如下:
Failed to launch the browser process!\n[361:376:0203/090816.314363:ERROR:bus.cc(407)] Failed to connect to the bus: Failed to connect to socket /run/dbus/system_bus_socket: No such file or directory\n[361:361:0203/090816.316514:ERROR:platform_thread_posix.cc(155)] pthread_create: Resource temporarily unavailable (11)\n[361:361:0203/090816.316684:ERROR:platform_thread_posix.cc(155)] pthread_create: Resource temporarily unavailable (11)\n[361:361:0203/090816.316698:ERROR:shutdown_signal_handlers_posix.cc(181)] Failed to create shutdown detector task.\n[361:376:0203/090816.321569:ERROR:bus.cc(407)] Failed to connect to the bus: Could not parse server address: Unknown address type (examples of valid types are "tcp" and on UNIX "unix")\n[361:372:0203/090816.321483:ERROR:platform_thread_posix.cc(155)] pthread_create: Resource temporarily unavailable (11)\n[361:376:0203/090816.321692:ERROR:bus.cc(407)] Failed to connect to the bus: Could not parse server address: Unknown address type (examples of valid types are "tcp" and on UNIX "unix")\n[361:373:0203/090816.321633:ERROR:platform_thread_posix.cc(155)] pthread_create: Resource temporarily unavailable (11)\n[361:373:0203/090816.321745:ERROR:platform_thread_posix.cc(155)] pthread_create: Resource temporarily unavailable (11)\n[361:376:0203/090816.321756:ERROR:bus.cc(407)] Failed to connect to the bus: Could not parse server address: Unknown address type (examples of valid types are "tcp" and on UNIX "unix")\n[361:374:0203/090816.321728:ERROR:platform_thread_posix.cc(155)] pthread_create: Resource temporarily unavailable (11)\n[361:376:0203/090816.321818:ERROR:bus.cc(407)] Failed to connect to the bus: Could not parse server address: Unknown address type (examples of valid types are "tcp" and on UNIX "unix")\n[361:376:0203/090816.321837:ERROR:object_proxy.cc(576)] Failed to call method: org.freedesktop.DBus.NameHasOwner: object_path= /org/freedesktop/DBus: unknown error type: \n[361:374:0203/090816.321868:ERROR:platform_thread_posix.cc(155)] pthread_create: Resource temporarily unavailable (11)\n[361:361:0203/090816.322697:ERROR:platform_thread_posix.cc(155)] pthread_create: Resource temporarily unavailable (11)\n[361:361:0203/090816.323611:ERROR:platform_thread_posix.cc(155)] pthread_create: Resource temporarily unavailable (11)\n[0203/090816.323742:ERROR:scoped_ptrace_attach.cc(27)] ptrace: Permission denied (13)\n\n\nTROUBLESHOOTING: https://pptr.dev/troubleshooting\n"

备注:内容来源于stack exchange,提问作者Nigel

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.04.14 08:43:07