0

I'm trying to deploy a Quart web app on Heroku, but I'm getting the infamous "Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch".

My current Procfile: web: hypercorn asgi:app

The file to run my Quart app (asgi.py):

import os
from app.main import app

if __name__ == "__main__":
    port = int(os.getenv('PORT', 8000))
    app.run(host='0.0.0.0', port=port)

Whether, I specify the port and host in app.run() or not, the app works locally but not remotely.

I have also tried setting up the Procfile as web: hypercorn -b 0.0.0.0$PORT asgi:app and not specifying the port or host in asgi.py. This breaks the app both locally and remotely.

I feel as though I have exhausted the solutions that worked for everyone else, so any other ideas are greatly appreciated.

BarleyZP
  • 3
  • 1
  • You may [find this answer useful](https://stackoverflow.com/questions/15693192/heroku-node-js-error-web-process-failed-to-bind-to-port-within-60-seconds-of). – Sebastián Camargo Jul 30 '22 at 16:17

1 Answers1

0

RESOLVED! The issues local were due to needing a Procfile.windows for local development and running heroku local web -f Procfile.windows for local testing.

My issue with testing the deployed app was just a few characters. I removed any of the port and host specification in asgi.py and changed my procfile to web: hypercorn asgi:app --bind 0.0.0.0:$PORT. -b was not able to be used. I needed both dashes and to spell out the word "bind".

BarleyZP
  • 3
  • 1