【问题标题】:Puppeteer Error: Failed to launch the browser process when run in Google Cloud FunctionPuppeteer 错误:在 Google Cloud Function 中运行时无法启动浏览器进程
【发布时间】:2020-02-21 22:57:56
【问题描述】:

我有函数 tracking 使用 Cloud Scheduler 每分钟运行一次,每天在 Google Cloud Function 中部署。

在这个函数中,我使用了 puppeteer,大部分函数 tracking 运行得很好,但有时,我的函数有错误

Error: Failed to launch the browser process!
[0220/073301.661396:ERROR:address_tracker_linux.cc(201)] Could not bind NETLINK socket: Permission denied (13)
[0220/073301.661935:ERROR:file_path_watcher_linux.cc(71)] Failed to read /proc/sys/fs/inotify/max_user_watches
Inconsistency detected by ld.so: ../elf/dl-tls.c: 481: _dl_allocate_tls_init: Assertion `listp->slotinfo[cnt].gen <= GL(dl_tls_generation)' failed!


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

    at onClose (/srv/node_modules/puppeteer/lib/Launcher.js:750:14)
    at ChildProcess.helper.addEventListener (/srv/node_modules/puppeteer/lib/Launcher.js:740:61)
    at emitTwo (events.js:131:20)
    at ChildProcess.emit (events.js:214:7)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)

This is the frequency of errors

  • Puppeteer 版本:v2.0.0,昨天更新最新的 v2.1.1
  • 平台/操作系统版本:谷歌云功能
  • Node.js 版本:8

我搜索了 puppeteer 的所有问题,但无法解决我的问题。请帮帮我

谢谢

【问题讨论】:

  • 嘿,你破案了吗?

标签: google-cloud-functions puppeteer


【解决方案1】:

您需要将您的 puppeteer 版本降级到 2.0.0,看起来如果在您部署您的应用时有什么东西导致 puppeteer 失败。

你可以检查 https://github.com/puppeteer/puppeteer/issues/5379#issuecomment-587185091

因为弹性豆茎通过降级 puppeteer 版本对我有用。

【讨论】:

  • 感谢您的回答,但我的功能在使用 puppeteer v2.0.0 运行时仍然有错误:(
猜你喜欢
  • 2020-05-15
  • 1970-01-01
  • 1970-01-01
  • 2020-10-02
  • 2022-08-11
  • 1970-01-01
  • 2022-12-28
  • 2022-10-19
  • 2021-04-23
相关资源
最近更新 更多