H14 error in heroku - “no web processes running”

后端 未结 6 977
傲寒
傲寒 2020-12-05 12:42

error H14 happen while deploying to heroku this is my procfile:

web: gunicorn -w 4 -b 0.0.0.0:$PORT -k gevent main:app

log on heroku:

相关标签:
6条回答
  • 2020-12-05 13:00

    The issue here is that you're not running any web dynos. You can tell Heroku to do this via:

    $ heroku ps:scale web=1
    

    This will force Heroku to spin up a web dyno, thereby executing your gunicorn command.

    0 讨论(0)
  • 2020-12-05 13:09

    After 3 hours of debugging, I've figured out why my app was causing this error:

    1. My Procfile was incorrectly cased
    2. gunicorn wasn't installed in my venv

    Pretty basic errors not to have caught on Heroku's end, pretty obnoxious of them not to include in some error readout.

    More info on dyno configuration – more on initializing your heroku app.

    0 讨论(0)
  • 2020-12-05 13:13

    I don't have the reputation to reply to the correct comment, but for me the issue was that I didn't have the run.gunicorn.sh file in my root directory, this resulted in the same "No web processes running" error.

    If you don't have this file, create it with contents:

    gunicorn -b :5000 --access-logfile - --error-logfile - build:app
    

    Where 'build' is the name of your python file (build.py in this case) and app is the name of your app in the code.

    Also make sure that gunicorn is included in requirements.txt, like others have already pointed out.

    0 讨论(0)
  • 2020-12-05 13:17

    I was having an issue here too. My problem was that my Procfile was "Procfile.txt" . What solved my issue was to remove the file extension from Procfile, then recommit and push stuff to heroku

    0 讨论(0)
  • 2020-12-05 13:18
    • Login to your Heroku dashboard and open your projects.
    • Go to Settings.
    • Delete heroku/python from the list of buildpacks
    • Then click Add buildpack → Choose "Python" → Save Changes.
    • Activate your environment in your code.
    • Run heroku ps:scale web=1.

    And you're done!

    0 讨论(0)
  • 2020-12-05 13:26

    Before this command:

    heroku ps:scale web=1
    

    I had to remove and add buildpacks again and empty commit it and redeploy it to heroku.

    heroku buildpacks:clear
    heroku buildpacks:add --index heroku/python
    
    0 讨论(0)
提交回复
热议问题