【发布时间】:2014-08-02 17:20:54
【问题描述】:
我无法启动我的应用程序,它一直失败并出现以下错误:
Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch
我在config文件夹中创建了application.js文件,内容如下:
module.exports = {
port: process.env.PORT || 1337
};
但这并没有帮助。
我的应用程序的结构如下。 我在 Heroku 上有两个单独的应用程序。它们都有完全相同的代码,除了不同的 Procfile(这样我就可以启动不同的脚本)。 第一个应用程序是我的实际应用程序,第二个应用程序是应该填充数据库的工作人员。 第一个Procfile有以下内容:
web: NODE_ENV=production node app.js
还有第二个(工人):
web: NODE_ENV=production node worker/APIDataLoader.js
工作应用程序是失败的应用程序。
会不会是其他地方出了问题,而这个错误实际上“掩盖”了它?
更新
我将我的第二个 Procfile 更改为:
worker: NODE_ENV=production node worker/APIDataLoader.js
所以现在它是工人。我还为此应用程序运行heroku ps:scale worker=1。
这就是我现在得到的:
State changed from up to starting
2014-06-12T14:42:53.556701+00:00 heroku[worker.1]: Starting process with command `NODE_ENV=production node worker/APIDataLoader.js`
2014-06-12T14:42:54.407140+00:00 heroku[worker.1]: State changed from starting to up
2014-06-12T14:42:52.111153+00:00 heroku[worker.1]: Stopping all processes with SIGTERM
2014-06-12T14:42:54.518997+00:00 heroku[worker.1]: Process exited with status 143
2014-06-12T14:51:54.297431+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path=/ host=surge-gearstream-worker.herokuapp.com request_id=073599af-192b-4b23-aef1-be7a264c43d2 fwd="188.2.72.207" dyno= connect= service= status=503 bytes=
2014-06-12T14:51:54.508784+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path=/favicon.ico host=surge-gearstream-worker.herokuapp.com request_id=adbb0bfa-2df7-47ad-9a27-4f6823db6ecf fwd="188.2.72.207" dyno= connect= service= status=503 bytes=
是否可以只运行worker?
【问题讨论】: