我正在开发heroku上的node.js应用程序。现在它运行在单一(免费)动态。Heroku - 一直崩溃
由于某种原因突然我的应用程序崩溃,现在它一直崩溃(我添加NewRelic和Librato插件后观察它 - 应用程序是添加这些插件时重新启动) - 应用程序之后第一次崩溃插件被添加。所以我删除了两个插件,但问题仍然存在。我想检查什么是错,我的评论我的应用程序代码,并用简单的例子,取而代之的是从网站:
index.js
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/');
Procfile
web: node index.js
引擎在packages.json(由heroku安装的节点为0.10.26)
"engines": {
"node": "0.10.x"
},
此代码适用于我的电脑(与工头一起测试)。 当我尝试将它部署到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 restart
:
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 restart
再次崩溃...
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
在第二次重新启动应用程序后up
并再次运行,并在第三次重新启动后再次崩溃(它总是崩溃/退出状态8)。
试图回滚和问题仍然存在:(这就是疯狂 - 它似乎是heroku问题 - > +1指出链接到heroku事件 – user606521