首页 > 解决方案 > Flask、Python 的 H14 Heroku“没有运行 Web 进程”

问题描述

我使用 Python 和 Heroku Web 框架编写了一个小站点。面临应用程序无法运行的问题,但是,当在本地(通过我的终端)运行时,一切正常。日志说以下内容:

2020-05-20T06:19:35.538634+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/" host=reviewssystem.herokuapp.com request_id=00dd8d00-f6b0-471b-bab7-65d065c60025 fwd="109.229.183.36" dyno= connect= service= status=503 bytes= protocol=https

我尝试使用heroku ps:scale web=1并得到这个:

Scaling dynos... !
 ▸    Couldn't find that process type (web).

heroku ps输出:No dynos on ⬢ reviewssystem

档案:web: gunicorn app:app. 我也尝试过使用web: python app.py,但没有帮助。

要求.txt:

click==7.1.2
Flask==1.1.2
Flask-SQLAlchemy==2.4.1
gunicorn==20.0.4
itsdangerous==1.1.0
Jinja2==2.11.2
MarkupSafe==1.0
SQLAlchemy==1.3.16
Werkzeug==1.0.1

构建日志:

-----> Python app detected
-----> No change in requirements detected, installing from cache
-----> Installing SQLite3
-----> Installing requirements with pip
-----> Discovering process types
       Procfile declares types -> (none)
-----> Compressing...
       Done: 47.6M
-----> Launching...
       Released v8
       https://reviewssystem.herokuapp.com/ deployed to Heroku

那么,我应该怎么做才能修复它?

标签: pythonflaskheroku

解决方案


我通过删除Procfile并重新创建它来解决问题。由于某种原因,Git 无法识别它Procfile并将其命名为Pro/143/file(我不知道为什么)。

因此,如果您遇到这样的问题,请尝试重新创建您的Procfile.反正,它对我有帮助。

PS我像以前一样保留了文件的内容:web: gunicorn app:app.

如您所见,一切正常: 在此处输入图像描述


推荐阅读