title: Heroku Flask: at=error code=H10 desc="App crashed" method=GET path="/"
body: <p>I have been trying to make a blog app in Flask. Everything works fine in local host. But when  try to push to Heroku, it gives me the dreaded H10 error. Googling tells me to fix procfile and add gunicorn in requirements.txt. I have done both, in fact, I have tried everything I could, but nothing is working.</p>
  <p>Here is the error -</p>
  <pre><code>2022-02-25T18:48:28.000000+00:00 app[api]: Build started by user bsse1013@iit.du.ac.bd
  2022-02-25T18:48:51.393695+00:00 app[api]: Deploy cffc4591 by user bsse1013@iit.du.ac.bd
  2022-02-25T18:48:51.393695+00:00 app[api]: Release v17 created by user bsse1013@iit.du.ac.bd
  2022-02-25T18:48:53.004126+00:00 heroku[web.1]: State changed from crashed to starting
  2022-02-25T18:48:56.836379+00:00 heroku[web.1]: Starting process with command `gunicorn --bind 0.0.0.0:7388 app:app --log-file=log.txt`
  2022-02-25T18:48:58.760393+00:00 heroku[web.1]: State changed from starting to crashed
  2022-02-25T18:48:58.462336+00:00 app[web.1]: Traceback (most recent call last):
  2022-02-25T18:48:58.462406+00:00 app[web.1]:   File &quot;/app/.heroku/python/lib/python3.9/site-packages/gunicorn/arbiter.py&quot;, line 209, in run
  2022-02-25T18:48:58.462730+00:00 app[web.1]:     self.sleep()
  2022-02-25T18:48:58.462746+00:00 app[web.1]:   File &quot;/app/.heroku/python/lib/python3.9/site-packages/gunicorn/arbiter.py&quot;, line 357, in sleep
  2022-02-25T18:48:58.467812+00:00 app[web.1]:     ready = select.select([self.PIPE[0]], [], [], 1.0)
  2022-02-25T18:48:58.467839+00:00 app[web.1]:   File &quot;/app/.heroku/python/lib/python3.9/site-packages/gunicorn/arbiter.py&quot;, line 242, in handle_chld
  2022-02-25T18:48:58.468120+00:00 app[web.1]:     self.reap_workers()
  2022-02-25T18:48:58.468136+00:00 app[web.1]:   File &quot;/app/.heroku/python/lib/python3.9/site-packages/gunicorn/arbiter.py&quot;, line 525, in reap_workers
  2022-02-25T18:48:58.468414+00:00 app[web.1]:     raise HaltServer(reason, self.WORKER_BOOT_ERROR)
  2022-02-25T18:48:58.468535+00:00 app[web.1]: gunicorn.errors.HaltServer: &lt;HaltServer 'Worker failed to boot.' 3&gt;
  2022-02-25T18:48:58.468584+00:00 app[web.1]: 
  2022-02-25T18:48:58.468585+00:00 app[web.1]: During handling of the above exception, another exception occurred:
  2022-02-25T18:48:58.468585+00:00 app[web.1]: 
  2022-02-25T18:48:58.468603+00:00 app[web.1]: Traceback (most recent call last):
  2022-02-25T18:48:58.468619+00:00 app[web.1]:   File &quot;/app/.heroku/python/bin/gunicorn&quot;, line 8, in &lt;module&gt;
  2022-02-25T18:48:58.468786+00:00 app[web.1]:     sys.exit(run())
  2022-02-25T18:48:58.468800+00:00 app[web.1]:   File &quot;/app/.heroku/python/lib/python3.9/site-packages/gunicorn/app/wsgiapp.py&quot;, line 67, in run
  2022-02-25T18:48:58.468967+00:00 app[web.1]:     WSGIApplication(&quot;%(prog)s [OPTIONS] [APP_MODULE]&quot;).run()
  2022-02-25T18:48:58.468989+00:00 app[web.1]:   File &quot;/app/.heroku/python/lib/python3.9/site-packages/gunicorn/app/base.py&quot;, line 231, in run
  2022-02-25T18:48:58.469188+00:00 app[web.1]:     super().run()
  2022-02-25T18:48:58.469203+00:00 app[web.1]:   File &quot;/app/.heroku/python/lib/python3.9/site-packages/gunicorn/app/base.py&quot;, line 72, in run
  2022-02-25T18:48:58.469355+00:00 app[web.1]:     Arbiter(self).run()
  2022-02-25T18:48:58.469369+00:00 app[web.1]:   File &quot;/app/.heroku/python/lib/python3.9/site-packages/gunicorn/arbiter.py&quot;, line 229, in run
  2022-02-25T18:48:58.469563+00:00 app[web.1]:     self.halt(reason=inst.reason, exit_status=inst.exit_status)
  2022-02-25T18:48:58.469577+00:00 app[web.1]:   File &quot;/app/.heroku/python/lib/python3.9/site-packages/gunicorn/arbiter.py&quot;, line 342, in halt
  2022-02-25T18:48:58.470213+00:00 app[web.1]:     self.stop()
  2022-02-25T18:48:58.470230+00:00 app[web.1]:   File &quot;/app/.heroku/python/lib/python3.9/site-packages/gunicorn/arbiter.py&quot;, line 393, in stop
  2022-02-25T18:48:58.470497+00:00 app[web.1]:     time.sleep(0.1)
  2022-02-25T18:48:58.470511+00:00 app[web.1]:   File &quot;/app/.heroku/python/lib/python3.9/site-packages/gunicorn/arbiter.py&quot;, line 242, in handle_chld
  2022-02-25T18:48:58.471136+00:00 app[web.1]:     self.reap_workers()
  2022-02-25T18:48:58.471153+00:00 app[web.1]:   File &quot;/app/.heroku/python/lib/python3.9/site-packages/gunicorn/arbiter.py&quot;, line 525, in reap_workers
  2022-02-25T18:48:58.471920+00:00 app[web.1]:     raise HaltServer(reason, self.WORKER_BOOT_ERROR)
  2022-02-25T18:48:58.472025+00:00 app[web.1]: gunicorn.errors.HaltServer: &lt;HaltServer 'Worker failed to boot.' 3&gt;
  2022-02-25T18:48:58.664689+00:00 heroku[web.1]: Process exited with status 1
  2022-02-25T18:49:03.000000+00:00 app[api]: Build succeeded
  2022-02-25T18:49:08.798373+00:00 heroku[router]: at=error code=H10 desc=&quot;App crashed&quot; method=GET path=&quot;/register&quot; host=flask-blog-10.herokuapp.com request_id=78a36854-c690-4886-926e-da21b23c664b fwd=&quot;37.120.137.77&quot; dyno= connect= service= status=503 bytes= protocol=https
  2022-02-25T18:49:09.276608+00:00 heroku[router]: at=error code=H10 desc=&quot;App crashed&quot; method=GET path=&quot;/favicon.ico&quot; host=flask-blog-10.herokuapp.com request_id=25a7f92c-f1a9-415e-8254-bf66a128fde7 fwd=&quot;37.120.137.77&quot; dyno= connect= service= status=503 bytes= protocol=https
  </code></pre>
  <p>Here is my Procfile:
  <code>web: gunicorn --bind 0.0.0.0:5000 app:app --log-file=log.txt</code></p>
  <p>Also tried this with Procfile:
  <code>web: gunicorn --bind 0.0.0.0:5000 app:app</code></p>
  <p>Also tried this with Procfile:
  <code>web: gunicorn app:app</code>
  I made sure there is no trailing whitespace in procfile.</p>
  <p>requirement.txt (Yes, I have gunicorn here):</p>
  <pre><code>decorator==4.4.2
  Flask==1.1.2
  Flask-Login==0.5.0
  Flask-SQLAlchemy==2.4.4
  gunicorn==20.1.0
  Jinja2==2.11.3
  json5==0.9.5
  jsonschema==3.2.0
  mysqlclient==2.1.0
  pymongo==3.11.3
  requests==2.25.1
  requests-html==0.10.0
  SQLAlchemy==1.4.31
  Werkzeug==1.0.1
  MarkupSafe==2.1.0
  </code></pre>
  <p>runtime.txt:
  <code>python-3.9.1</code></p>
  <p>Here is the app.py file -</p>
  <pre><code>from flask import Flask
  import auth
  import blog
  from db import initialize_db
  
  app = Flask(__name__)
  app.secret_key = 'super secret key'
  
  app.register_blueprint(blog.bp)
  app.add_url_rule('/', endpoint='index')
  
  app.register_blueprint(auth.bp)
  initialize_db()
  </code></pre>
  <p>This is tearing me up. Please help!</p>
  <p>Edit: Apparently the gitignore file was the root of all troubles. What is wrong with it?
  <a href="https://i.stack.imgur.com/HJq0G.png" rel="nofollow noreferrer">Gitignore file screenshot</a></p>