如何解决烧瓶应用程序的heroku部署错误

Posted

技术标签:

【中文标题】如何解决烧瓶应用程序的heroku部署错误【英文标题】:How to solve heroku deployment error for flask app 【发布时间】:2021-12-31 05:13:03 【问题描述】:

这是我第一次尝试将烧瓶应用程序部署到 heroku。在尝试这样做时,我能够成功构建它,但是当我打开应用程序时,我发现以下消息:

Application error
An error occurred in the application and your page could not be served. If you are the 
application owner, check your logs for details. You can do this from the Heroku CLI 
with the command

检查我的日志后,我得到以下信息:

2021-11-21T03:23:43.909513+00:00 heroku[router]: at=error code=H10 desc="App crashed" 
method=GET path="/" host=myapp.herokuapp.com request_id=6ca38bf1-291f-47b7-b736- 
d80b1d331182 fwd="49.37.37.192" dyno= connect= service= status=503 bytes= 
protocol=https
2021-11-21T03:23:44.906996+00:00 heroku[router]: at=error code=H10 desc="App crashed" 
method=GET path="/favicon.ico" host=myapp.herokuapp.com request_id=34032e6e-0588-4904- 
94f6-b7cacfef1364 fwd="49.37.37.192" dyno= connect= service= status=503 bytes= 
protocol=https

作为这个领域的新手,我无法弄清楚这个错误的含义。我尝试搜索互联网,但没有找到特定于我的问题的资源。

附加信息:

我正在使用 github 和 heroku 我正在使用 GitHub 连接方法进行部署。

谁能解释一下这是什么意思以及如何解决它。

【问题讨论】:

日志中应该有更多信息,首先检查它是否已正确部署并确保您有一个根端点,如果您共享 GitHub 存储库或某些代码会更容易提供帮助 【参考方案1】:

主要方面是 requirements.txt 文件中缺少一个 gunicorn。完成后,其他一切正常。

【讨论】:

以上是关于如何解决烧瓶应用程序的heroku部署错误的主要内容,如果未能解决你的问题,请参考以下文章

Heroku 托管烧瓶应用程序与 MySQL 抛出错误

如何解决在 Heroku 上部署 React 应用程序时出现的错误

将 Flask 应用程序部署到 Heroku 时出现奇怪的“is_xhr”错误

如何解决 Heroku 应用程序错误(heroku 日志 --tail)

如何解决 Heroku(Python)中的“应用程序错误”[重复]

将 Ember.js 应用程序部署到 Heroku 时如何解决“无法下载节点 14.18.0”?