Heroku-一直在崩溃
我正在heroku上开发node.js应用程序。目前,它在单(自由)dyno上运行 由于某种原因,我的应用程序突然崩溃,现在它一直崩溃(我在添加NewRelic和Librato插件后观察到它-添加这些插件时,应用程序有点重启)-在添加其中一个插件后,应用程序第一次崩溃。所以我删除了两个插件,但问题仍然存在。我想检查出了什么问题,我对我的应用程序代码进行了注释,并将其替换为web上的简单示例: index.jsHeroku-一直在崩溃,heroku,Heroku,我正在heroku上开发node.js应用程序。目前,它在单(自由)dyno上运行 由于某种原因,我的应用程序突然崩溃,现在它一直崩溃(我在添加NewRelic和Librato插件后观察到它-添加这些插件时,应用程序有点重启)-在添加其中一个插件后,应用程序第一次崩溃。所以我删除了两个插件,但问题仍然存在。我想检查出了什么问题,我对我的应用程序代码进行了注释,并将其替换为web上的简单示例: index.js var http = require('http'); http.createServ
var http = require('http');
http.createServer(function (req, res) {
res.writeHead(200, {'Content-Type': 'text/plain'});
res.end('Hello World\n');
}).listen(process.env.PORT);
console.log('Server running at http://127.0.0.1:1337/');
程序文件
web: node index.js
packages.json中的引擎(heroku安装的节点为0.10.26)
此代码在我的pc上运行(与foreman一起测试)。
当我尝试将其部署到heroku应用程序崩溃时-以下是日志:
2014-04-25T09:43:42+00:00 heroku[slug-compiler]: Slug compilation started
2014-04-25T09:43:47.850609+00:00 heroku[api]: Release v30 created by xxx
2014-04-25T09:43:47.850538+00:00 heroku[api]: Deploy 562babb by xxx
2014-04-25T09:43:47+00:00 heroku[slug-compiler]: Slug compilation finished
2014-04-25T09:43:48.588089+00:00 heroku[web.1]: State changed from crashed to starting
2014-04-25T09:43:55.655057+00:00 heroku[web.1]: Starting process with command `node index.js`
2014-04-25T09:43:57.931274+00:00 heroku[web.1]: Process exited with status 8
2014-04-25T09:43:57.945393+00:00 heroku[web.1]: State changed from starting to crashed
当我尝试重新启动heroku时:
2014-04-25T09:44:43.071357+00:00 heroku[web.1]: State changed from crashed to starting
2014-04-25T09:44:51.834860+00:00 heroku[web.1]: Starting process with command `node index.js`
2014-04-25T09:44:54.250631+00:00 heroku[web.1]: State changed from starting to crashed
2014-04-25T09:44:54.235545+00:00 heroku[web.1]: Process exited with status 8
这让我疯狂-我在heroku部署了许多节点应用程序,这些应用程序正在生产中运行,从未出现过这样的问题-发生了什么事
当我将节点引擎版本更改为
0.10.20
(我正在使用这个v localy)时,应用程序启动并工作,但当我重新启动heroku
时,它再次崩溃
State changed from up to starting
2014-04-25T10:10:12.990317+00:00 heroku[web.1]: Stopping all processes with SIGTERM
2014-04-25T10:10:15.145758+00:00 heroku[web.1]: Process exited with status 143
2014-04-25T10:10:16.151380+00:00 heroku[web.1]: Starting process with command `node index.js`
2014-04-25T10:10:18.905637+00:00 heroku[web.1]: Process exited with status 8
2014-04-25T10:10:18.929730+00:00 heroku[web.1]: State changed from starting to crashed
第二次重启后,应用程序启动并再次运行,第三次重启后再次崩溃(它总是崩溃/退出状态为8)。问题可能出在Heroku本身。大约一小时前创建了一份事件报告,但仍不清楚是什么导致了问题:
同时,您可能希望通过Heroku Dashboard回滚到应用程序的上一个工作版本。将此配置添加到package.json:
"scripts": {
"start": "node index.js"},
index.js是您想从这里启动应用程序的文件名,如www.js或server.js
试图回退,但问题仍然存在:(这太疯狂了-似乎是heroku问题->+1指出了与heroku事件的联系
"scripts": {
"start": "node index.js"},