Heroku H10 错误 -- Python

1 投票
1 回答
627 浏览
提问于 2025-04-18 10:25

我花了5个小时试图把我的应用程序部署到Heroku上,但一直没成功……这是一个Python应用,运行在我本地的时候一切都很好。

可是,当我把它部署到Heroku上时,出现了以下错误:

2014-06-19T20:16:28.240849+00:00 heroku[api]: Enable Logplex by cahnda@gmail.com
2014-06-19T20:16:28.240931+00:00 heroku[api]: Release v2 created by cahnda@gmail.com
2014-06-19T20:18:27+00:00 heroku[slug-compiler]: Slug compilation started
2014-06-19T20:19:20+00:00 heroku[slug-compiler]: Slug compilation failed: failed to          compile Python app

2014-06-19T20:21:33+00:00 heroku[slug-compiler]: Slug compilation started
2014-06-19T20:22:12+00:00 heroku[slug-compiler]: Slug compilation failed: failed to compile Python app
2014-06-19T20:23:28+00:00 heroku[slug-compiler]: Slug compilation started
2014-06-19T20:24:11+00:00 heroku[slug-compiler]: Slug compilation failed: failed to compile Python app
2014-06-19T20:27:12+00:00 heroku[slug-compiler]: Slug compilation started
2014-06-19T20:27:50+00:00 heroku[slug-compiler]: Slug compilation finished
2014-06-19T20:27:50.659666+00:00 heroku[api]: Deploy 95e0979 by cahnda@gmail.com
2014-06-19T20:27:50.577906+00:00 heroku[api]: Scale to web=1 by cahnda@gmail.com
2014-06-19T20:27:50.659724+00:00 heroku[api]: Release v3 created by cahnda@gmail.com
2014-06-19T20:27:57.641496+00:00 heroku[web.1]: State changed from starting to up
2014-06-19T20:27:59.423572+00:00 heroku[web.1]: State changed from up to crashed
2014-06-19T20:27:59.424174+00:00 heroku[web.1]: State changed from crashed to starting
2014-06-19T20:27:56.011407+00:00 heroku[web.1]: Starting process with command `gunicorn app:app`
2014-06-19T20:27:59.409009+00:00 heroku[web.1]: Process exited with status 3
2014-06-19T20:28:06.601752+00:00 heroku[web.1]: State changed from starting to crashed
2014-06-19T20:28:08.016745+00:00 heroku[router]: at=error code=H10 desc="App crashed" 
method=GET path="/" host=secure-fjord-2980.herokuapp.com request_id=9fcc7ffe-3c5b-406c-   aaed-87c9fa8c8523 fwd="68.173.78.212" dyno= connect= service= status=503 bytes=
2014-06-19T20:28:08.265595+00:00 heroku[router]: at=error code=H10 desc="App crashed" 
method=GET path="/" host=secure-fjord-2980.herokuapp.com request_id=e1920daf-4cfc-466d-ba56-7f923ac6c7d9 fwd="68.173.78.212" dyno= connect= service= status=503 bytes=   
2014-06-19T20:28:08.708322+00:00 heroku[router]: **at=error code=H10 desc="App crashed"** 
method=GET path="/favicon.ico" host=secure-fjord-2980.herokuapp.com request_id=a8f085da-ce20-40ed-8882-d1d848538b23 fwd="68.173.78.212" dyno= connect= service= status=503 bytes=

这是什么意思呢?我该怎么做才能解决这个问题?请帮帮我!

1 个回答

0

H10错误真让人头疼。因为H10是一个通用错误,而且没有提供详细的错误信息,所以很难搞清楚到底发生了什么。我不久前了解到,解决Heroku上H10错误(应用崩溃)最快的方法就是使用Sentry

Sentry会通过邮件把错误的详细信息发给你(或者你也可以在网页应用的仪表板上查看)。

如果你的应用是Django应用,那么你甚至可以跳过Sentry,直接配置ADMINS和邮件来发送日志报告。具体可以参考Django中的错误报告

撰写回答