我正在開發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