【问题标题】:H14 error upon Django app deployment on Heroku在 Heroku 上部署 Django 应用程序时出现 H14 错误
【发布时间】:2020-05-17 21:19:50
【问题描述】:

我今天尝试在 Heroku 上部署我的 Django 应用程序。 我首先取得了成功,并得到了它已部署的消息。然而,在 Heroku 打开时,我有一个屏幕通知我发生了错误,我应该检查如下所示的日志:

2020-05-17T21:01:16.000000+00:00 app[api]: Build succeeded
2020-05-17T21:01:23.528711+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/" host=wsb-project.herokuapp.com request_id=4ea57e57-b230-4d49-99d6-f5f17856b589 fwd="85.221.138.216" dyno= connect= service= status=503 bytes= protocol=https
2020-05-17T21:01:23.897006+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/favicon.ico" host=wsb-project.herokuapp.com request_id=59fc1c4d-330c-4084-8e9e-1a3d7d8ed292 fwd="85.221.138.216" dyno= connect= service= status=503 bytes= protocol=https
2020-05-17T21:09:45.484945+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/" host=wsb-project.herokuapp.com request_id=f1cd7d3d-8781-49b8-80e0-278ca06139ce fwd="85.221.138.216" dyno= connect= service= status=503 bytes= protocol=https
2020-05-17T21:09:45.885362+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/favicon.ico" host=wsb-project.herokuapp.com request_id=64c1d78c-8e75-47d0-b748-9ffbf239c545 fwd="85.221.138.216" dyno= connect= service= status=503 bytes= protocol=https

Heroku ps 告诉我,我的应用程序上没有测功机。 我试过this tutorial: 并且在缩放测功机时,我被告知“找不到该进程类型(网络)” 所以我尝试使用this link再次清除并添加构建包

仍然没有任何效果。 提前感谢你们中的任何人知道我可以在哪里找到解决方案,因为我在这里慢慢地用完了选项:) 干杯。

添加目录:

drwxr-xr-x 1 bapti 197609      0 May 17 14:18 ./
drwxr-xr-x 1 bapti 197609      0 May 16 14:22 ../
drwxr-xr-x 1 bapti 197609      0 May 18 19:09 .git/
-rw-r--r-- 1 bapti 197609     72 May 13 20:29 .gitignore
drwxr-xr-x 1 bapti 197609      0 May 16 14:44 .idea/
-rw-r--r-- 1 bapti 197609 155648 May 17 14:18 db.sqlite3
-rwxr-xr-x 1 bapti 197609    652 Apr  1 14:16 manage.py*
-rw-r--r-- 1 bapti 197609     43 May 15 19:01 Procfile.txt
drwxr-xr-x 1 bapti 197609      0 May 14 22:25 python-getting-started/
drwxr-xr-x 1 bapti 197609      0 May 15 17:46 register/
-rw-r--r-- 1 bapti 197609    301 May 16 11:11 requirements.txt
drwxr-xr-x 1 bapti 197609      0 May 16 13:31 restaurants/
-rw-r--r-- 1 bapti 197609     12 May 15 19:03 runtime.txt
drwxr-xr-x 1 bapti 197609      0 Apr 14 11:45 sent_emails/
drwxr-xr-x 1 bapti 197609      0 May 17 23:33 WSB_website/

【问题讨论】:

    标签: django heroku deployment


    【解决方案1】:

    这很可能是将您的网络 dynos 缩小到 0 dynos 的结果。要修复它,请将您的网络 dynos 扩展到 1 个或多个 dynos:

    heroku ps:scale web=1 或者如果它要求应用程序,heroku ps:scale web=1 -a wsb-project

    Procfile 始终是一个简单的文本文件,名为 Procfile,没有文件扩展名。例如,Procfile.txt 无效。

    Procfile 必须位于应用的根(主)目录中。如果放在其他任何地方,它就不起作用。

    Procfiles的内容可以设置如下,

    web: gunicorn blog.wsgi --log-file -
    

    【讨论】:

    • 嗨,每次我尝试扩展我的网络测功机时,我都会收到消息:找不到该进程类型(网络)所以我认为某处的设置有问题,但我不能把我的手指在它上面
    • 我认为您的Procfile 有问题我已经更新了我的答案,请参阅。
    • 按要求添加目录结构
    • 您的个人资料名称错误,请将其更改为Procfile 而不是Procfile.txt(没有任何扩展名)
    • 将我的 Procfile 格式从 .txt 更改为无扩展名,它很好地解决了这个错误,谢谢。
    猜你喜欢
    • 2020-11-17
    • 1970-01-01
    • 2021-12-06
    • 2021-11-27
    • 2021-03-25
    • 2018-02-09
    • 2018-05-30
    • 1970-01-01
    • 2018-08-16
    相关资源
    最近更新 更多