Heroku中发现应用程序错误

时间:2014-06-09 06:47:59

标签: node.js heroku

我第一次在Heroku中托管了我的应用程序。它适用于我的本地主机,但当我在Heroku上托管它时,它会给出应用程序错误:应用程序出错,无法提供您的页面。请稍后重试。如果您是应用程序所有者,请检查日志以获取详细信息。我检查我的日志和日志是:

  $ heroku logs --app peaceful-wildwood-9840
  ←[36m2014-06-08T18:48:05.660654+00:00 heroku[api]:←[0m Enable Logplex by aminayo
 usuf_13@hotmail.com
  ←[36m2014-06-08T18:48:05.660736+00:00 heroku[api]:←[0m Release v2 created by ami
  nayousuf_13@hotmail.com
  ←[33m2014-06-08T18:49:27+00:00 heroku[slug-compiler]:←[0m Slug compilation start
  ed
  ←[36m2014-06-08T18:49:33.638541+00:00 heroku[api]:←[0m Deploy 2ab14e4 by aminayo
 usuf_13@hotmail.com
  ←[36m2014-06-08T18:49:33.511107+00:00 heroku[api]:←[0m Scale to web=1 by aminayo
  usuf_13@hotmail.com
  ←[36m2014-06-08T18:49:33.638621+00:00 heroku[api]:←[0m Release v3 created by ami
  nayousuf_13@hotmail.com
  ←[33m2014-06-08T18:49:33+00:00 heroku[slug-compiler]:←[0m Slug compilation finis
 hed
   ←[32m2014-06-08T18:49:36.203628+00:00 app[web.1]:←[0m Listening to Port : 3033..
 .  
   ←[32m2014-06-08T18:49:35.293036+00:00 heroku[web.1]:←[0m Starting process with c
  ommand `node server.js`
  ←[32m2014-06-08T18:50:37.170068+00:00 heroku[web.1]:←[0m State changed from star
  ting to crashed
  ←[32m2014-06-08T18:50:37.170632+00:00 heroku[web.1]:←[0m State changed from cras  
  hed to starting
  ←[32m2014-06-08T18:50:39.419734+00:00 app[web.1]:←[0m Listening to Port : 3033..
 .
 ←[32m2014-06-08T18:50:35.901399+00:00 heroku[web.1]:←[0m Error R10 (Boot timeout )
 -> Web process failed to bind to $PORT within 60 seconds of launch
 ←[32m2014-06-08T18:50:35.901708+00:00 heroku[web.1]:←[0m Stopping process with S  
 IGKILL
  ←[32m2014-06-08T18:50:37.165375+00:00 heroku[web.1]:←[0m Process exited with sta
  tus 137
  ←[32m2014-06-08T18:50:38.558505+00:00 heroku[web.1]:←[0m Starting process with c
  ommand `node server.js`
  ←[35m2014-06-08T18:51:20.593335+00:00 heroku[router]:←[0m at=error code=H20 desc
 ="App boot timeout" method=GET path=/ host=peaceful-wildwood-9840.herokuapp.com
  request_id=aabed091-9c41-4639-9069-c02f8dd71503 fwd="39.48.218.219" dyno= connec 
  t= service= status=503 bytes=
   ←[35m2014-06-08T18:51:32.899300+00:00 heroku[router]:←[0m at=error code=H20 desc
    ="App boot timeout" method=GET path=/ host=peaceful-wildwood-9840.herokuapp.com
    request_id=db181007-c7dd-47ba-a42f-91def32077df fwd="39.48.218.219" dyno= connec
   t= service= status=503 bytes=
  ←[32m2014-06-08T18:51:39.895529+00:00 heroku[web.1]:←[0m State changed from star  
  ting to crashed
  ←[35m2014-06-08T18:51:40.797283+00:00 heroku[router]:←[0m at=error code=H10 desc
 ="App crashed" method=GET path=/favicon.ico host=peaceful-wildwood-9840.herokuap
  p.com request_id=e63e5ee2-b04e-4b13-8e61-77d1f4f4600b fwd="39.48.218.219" dyno=   
  connect= service= status=503 bytes=
  ←[35m2014-06-08T18:51:40.926423+00:00 heroku[router]:←[0m at=error code=H10 desc
  ="App crashed" method=GET path=/ host=peaceful-wildwood-9840.herokuapp.com reque
  st_id=88b77ad4-7547-4b41-b6c8-b820a38284b5 fwd="39.48.218.219" dyno= connect= se
 rvice= status=503 bytes=
  ←[35m2014-06-08T18:51:42.930361+00:00 heroku[router]:←[0m at=error code=H10 desc
 ="App crashed" method=GET path=/favicon.ico host=peaceful-wildwood-9840.herokuap
 p.com request_id=010dcdf3-e68a-47bb-a821-6dd5613b14ce fwd="39.48.218.219" dyno=
  connect= service= status=503 bytes =
  ←[32m2014-06-08T18:51:39.887550+00:00 heroku[web.1]:←[0m Process exited with sta
 tus 137
  ←[32m2014-06-08T18:51:38.819255+00:00 heroku[web.1]:←[0m Error R10 (Boot timeout
 ) -> Web process failed to bind to $PORT within 60 seconds of launch
 ←[32m2014-06-08T18:51:38.819499+00:00 heroku[web.1]:←[0m Stopping process with S
   IGKILL
 ←[35m2014-06-08T18:51:52.977231+00:00 heroku[router]:←[0m at=error code=H10 desc
 ="App crashed" method=GET path=/favicon.ico host=peaceful-wildwood-9840.herokuap
 p.com request_id=2ea71012-34e4-4361-9e04-9a1ae91716fa fwd="39.48.218.219" dyno=
 connect= service= status=503 bytes=
 ←[35m2014-06-08T18:56:28.116367+00:00 heroku[router]:←[0m at=error code=H10 desc
 ="App crashed" method=GET path=/ host=peaceful-wildwood-9840.herokuapp.com reque
  st_id=597301b8-8be8-46f0-96a9-43bb5425395a fwd="39.48.218.219" dyno= connect= se
 rvice= status=503 bytes=

1 个答案:

答案 0 :(得分:1)

如上所示,错误为Error R10 (Boot timeout ) -> Web process failed to bind to $PORT within 60 seconds of launch。我可以想到两件可能导致这种情况的事情:

  • 您的创业公司需要很长时间 - 例如,您在启动时呼叫外部Web服务。
  • 或者您没有收听正确的端口,因此您永远不会绑定到正确的端口。

我猜它是第二个?您使用什么PORT编号?你做这样的事吗? var port = Number(process.env.PORT || 5000);