简体   繁体   English

Heroku Procfile 找不到网络进程

[英]Heroku Procfile not finding web process

I am trying to launch a server on Heroku using Flask and Gunicorn.我正在尝试使用 Flask 和 Gunicorn 在 Heroku 上启动服务器。 I have a Procfile which I have both tried creating using echo "web: gunicorn annallAPI:app" > Procfile and with adding the line to a Procfile in vs code.我有一个 Procfile,我都尝试使用echo "web: gunicorn annallAPI:app" > Procfile它,并将该行添加到 vs code 中的 Procfile。 Still everytime I get:仍然每次我得到:

remote: -----> Discovering process types remote: Procfile declares types -> (none)

I have seen problems point to the wrong name, fx if it is ProcFile and another pointing to the incorrect encoding, saying it needs to be UTF-8.我已经看到问题指向错误的名称,如果它是 ProcFile,则 fx 和另一个指向不正确的编码,说它需要是 UTF-8。 I have the correct name and I can't convert to UTF-8 because the original_charset has UTF-8.我的名称正确,但无法转换为 UTF-8,因为 original_charset 具有 UTF-8。

The build succeeds and then if I make a request to the server, it of course fails.构建成功,然后如果我向服务器发出请求,它当然会失败。 For the record, I am using an M1 Mac.作为记录,我使用的是 M1 Mac。 The error I get in the Heroku log is:我在 Heroku 日志中得到的错误是:

at=error code=H14 desc="No web processes running" method=GET path="/" host=xxx-api.herokuapp.com request_id=65f19b67-87a1-46bf-84f4-20f4ab36e85b fwd="130.208.240.12" dyno= connect= service= status=503 bytes= protocol=https I tried doing heroku ps:scale web=1 to start a web process which I don't think should work if the Procfile doesn't have a set web process. at=error code=H14 desc="No web processes running" method=GET path="/" host=xxx-api.herokuapp.com request_id=65f19b67-87a1-46bf-84f4-20f4ab36e85b fwd="130.208.240.12" dyno= connect= service= status=503 bytes= protocol=https我尝试使用heroku ps:scale web=1来启动一个 web 进程,如果 Procfile 没有设置的 web 进程,我认为它不应该工作。 It gave me the error:它给了我错误:

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

  1. Make sure that you have created requirements.txt which lists out all libraries including gunicorn确保您已创建requirements.txt列出了包括gunicorn在内的所有库

  2. Create Procfile - this file basically has no extension and contains web: gunicorn yourwsginame:app Personally, I recommend you create this file manually and edit it using a text editor创建 Procfile - 这个文件基本上没有扩展名并且包含 web: gunicorn yourwsginame:app个人而言,我建议你手动创建这个文件并使用文本编辑器编辑它

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM