LoginSignup
8
5

More than 3 years have passed since last update.

【Heroku】デプロイ後にcode=H14 desc="No web processes running"が発生する場合はProcfileを作成して対処すればOK

Posted at

発生したエラー

2020-06-02T00:41:22.345388+00:00 heroku[router]:
at=error code=H14 desc="No web processes running"
method=POST path="/xxxx" host=xxxx.herokuapp.com request_id=xxxx
fwd="xx.xx.xx.xx" dyno= connect= service= status=503 bytes= protocol=https

私の場合

Go/echoで開発しており、メインのアプリの他にアプリケーションのディレクトリ内にmain関数を持つgoファイルを作成してデプロイしたら発生しました。
main関数が2つになり、Herokuがどちらを実行すべきが判定できなくなったんですかね。(適当)

対処方法1

公式ドキュメントに基づき、アプリケーションのルートディレクトリで、以下のコマンドを実行する

$ heroku ps:scale web=1

対処方法2

1でダメな場合は、アプリケーションのルートディレクトリで、以下のようにProcfileを作成する

$ cd `your-app-dir`
$ echo "web: $(basename `pwd`)" > Procfile

補足:Procfileとは

【公式】The Procfile

Heroku apps include a Procfile that specifies the commands that are executed by the app on startup. You can use a Procfile to declare a variety of process types, including:

参考

8
5
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
8
5