Search code examples
pythonflaskherokupeeweeflask-peewee

unknown heroku error/behavior for flask app using peewee/flask/postgres


I have 2 issues:

  1. I have an error below which I am not sure how to solve or what it means
  2. Flask ignores my requirements.txt , how to force it to always install it?
2021-02-08T03:54:08.379200+00:00 app[web.1]: time.sleep(0.1)
2021-02-08T03:54:08.379253+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/arbiter.py", line 242, in handle_chld
2021-02-08T03:54:08.379624+00:00 app[web.1]: self.reap_workers()
2021-02-08T03:54:08.379686+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/arbiter.py", line 525, in reap_workers
2021-02-08T03:54:08.380193+00:00 app[web.1]: raise HaltServer(reason, self.WORKER_BOOT_ERROR)
2021-02-08T03:54:08.380269+00:00 app[web.1]: gunicorn.errors.HaltServer: <HaltServer 'Worker failed to boot.' 3>
2021-02-08T03:54:08.569773+00:00 heroku[web.1]: Process exited with status 1
2021-02-08T03:54:08.657464+00:00 heroku[web.1]: State changed from up to crashed
2021-02-08T03:54:09.737518+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=xxxx.herokuapp.com request_id=fe35831f-4256-4eb2-8d47-aa595a61f51c fwd="173.72.4.224" dyno= connect= service= status=503 bytes= protocol=https
2021-02-08T03:54:09.883341+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=xxxx.herokuapp.com request_id=2b9e9316-44dd-42fb-8dd7-04ff0b0057e6 fwd="173.72.4.224" dyno= connect= service= status=503 bytes= protocol=https

Solution

  • I have an error below which I am not sure how to solve or what it means

    time.sleep(0.1). There shouldn't be any time.sleep(0.1) in your code. It halts your entire code. If you need sleeplike functionality use asyncio.sleep(0.1). Make sure your flask supports asyncio.

    The sleep is causing your app to crash.

    Are you sure your Flask App is supporting Gunicorn? Have you tested it locally? Being able to run flask locally does not mean it will be able to run in Gunicorn.


    Flask ignores my requirements.txt, how to force it to always install it?

    It did install something as evident by "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/arbiter.py". If it fails to install some other package you need to check the build.log why it failed doing so.