【发布时间】:2020-09-01 08:05:40
【问题描述】:
Bot 在本地运行良好,甚至在模拟的 Heroku 本地 heroku local web 中也能正常工作,但在其在线服务器上托管时会在一两分钟后崩溃。
- 我已经为 puppeteer 安装了 buildpack: https://github.com/jontewks/puppeteer-heroku-buildpack
- 我清除了构建缓存: https://help.heroku.com/18PI5RSY/how-do-i-clear-the-build-cache
我已尝试手动将我的工作人员缩放设置为 1
heroku ps:scale web=1这是我的 puppeteer 浏览器启动参数:
{args: ["--no-sandbox", "--disable-setuid-sandbox"],}
我的依赖列表如下:
- discord.js
- dotenv
- 节点获取
- 傀儡师
- fs
日志没用:
2020-05-15T11:40:56.804117+00:00 heroku[web.1]: State changed from crashed to starting
2020-05-15T11:41:22.345051+00:00 app[web.1]:
2020-05-15T11:41:22.345073+00:00 app[web.1]: > discordbot@1.0.0 start /app
2020-05-15T11:41:22.345073+00:00 app[web.1]: > node bot.js
2020-05-15T11:41:22.345074+00:00 app[web.1]:
2020-05-15T11:42:20.278141+00:00 heroku[web.1]: State changed from starting to crashed
2020-05-15T11:53:02.553013+00:00 heroku[web.1]: State changed from crashed to starting
2020-05-15T11:53:25.758932+00:00 app[web.1]:
2020-05-15T11:53:25.758955+00:00 app[web.1]: > discordbot@1.0.0 start /app
2020-05-15T11:53:25.758956+00:00 app[web.1]: > node bot.js
2020-05-15T11:53:25.758956+00:00 app[web.1]:
2020-05-15T11:54:18.310840+00:00 heroku[web.1]: State changed from starting to crashed
【问题讨论】:
-
—disable-dev-shm-usage
-
没有解决我的问题
-
从 heroku 仪表板打印日志
-
我做到了,它与您在我的帖子中看到的日志相同。除了将状态从开始更改为崩溃之外,没有关于实际崩溃的详细信息
标签: node.js heroku discord.js puppeteer