Heroku “at=error code=H10 desc=”App crashed“ method=GET path=/favicon.ico”

11,206

Solution 1

It's because you have configured wsgi file incorrectly, It's should be

import os

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "kloudless.settings")
from django.core.wsgi import get_wsgi_application
from dj_static import Cling

application = Cling(get_wsgi_application())

Solution 2

I spent the day on it, and all i had to do was changing:

web: gunicorn core.wsgi --log-file=-
web: gunicorn my_app.wsgi

to

web: gunicorn core.wsgi --log-file=-

Basically removing the second line, and it worked.

Share:
11,206
user2738206
Author by

user2738206

Updated on June 14, 2022

Comments

  • user2738206
    user2738206 almost 2 years

    I have a simple django app that works fine on localhost (Linux Mint), but when I deploy it to Heroku I see a page with this error:

    Application Error An error occurred in the application and your page could not be served. Please try again in a few moments. If you are the application owner, check your logs for details.

    I don't really know what I'm doing here and I can't make any sense of the output from heroku logs:

    2015-01-03T22:14:05.143957+00:00 app[web.1]:   File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/app/base.py", line 66, in wsgi
    2015-01-03T22:14:06.121096+00:00 heroku[web.1]: Process exited with status 3
    2015-01-03T22:14:06.130187+00:00 heroku[web.1]: State changed from starting to crashed
    2015-01-03T22:14:49.601660+00:00 heroku[api]: Scale to web=1 by 
    2015-01-03T22:16:38.186074+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=********.herokuapp.com request_id=5f385bd5-2162-4997-83df-baa1f50f0ee5 fwd="76.219.245.151" dyno= connect= service= status=503 bytes=
    2015-01-03T22:16:38.856915+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=********.herokuapp.com request_id=2249f496-af99-4eb9-a910-ea9a8c3c37f2 fwd="76.219.245.151" dyno= connect= service= status=503 bytes=
    2015-01-03T22:16:50.618309+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=********.herokuapp.com request_id=23e6081e-525d-42cb-a64c-7e2e3d101b88 fwd="76.219.245.151" dyno= connect= service= status=503 bytes=
    2015-01-03T22:16:51.142068+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=********.herokuapp.com request_id=b5ece045-edd4-4071-92cb-f1df7f195e27 fwd="76.219.245.151" dyno= connect= service= status=503 bytes=
    2015-01-03T22:16:52.064010+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=********.herokuapp.com request_id=7ac814f4-135d-4781-963f-56cbdc8063b0 fwd="76.219.245.151" dyno= connect= service= status=503 bytes=
    2015-01-03T22:16:52.587175+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=********.herokuapp.com request_id=93b0ee99-bfdb-409d-b8ba-67cb4f6866de fwd="76.219.245.151" dyno= connect= service= status=503 bytes=
    2015-01-03T22:26:33.006067+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=********herokuapp.com request_id=3265808c-5606-48e2-bc59-3b8c09fa4969 fwd="76.219.245.151" dyno= connect= service= status=503 bytes=
    2015-01-03T22:26:33.455979+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=a********.herokuapp.com request_id=bfeb6ba3-4860-4fc2-a25f-f0885ce0d5b2 fwd="76.219.245.151" dyno= connect= service= status=503 bytes=
    2015-01-03T22:26:36.502342+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=********.herokuapp.com request_id=f44b1b87-38a5-410e-a96f-a27154d814a5 fwd="76.219.245.151" dyno= connect= service= status=503 bytes=
    2015-01-03T22:26:37.035617+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=********.herokuapp.com request_id=aaccee65-da97-4ecf-9ce7-30a33943001e fwd="76.219.245.151" dyno= connect= service= status=503 bytes=
    2015-01-03T22:46:46.245934+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET pa
    th="/" host=********.herokuapp.com request_id=94a53f53-6a08-4e87-8e8c-15fd7d7aed9a fwd="76.219.245.151" dyno= connect= service= status=503 bytes=
    2015-01-03T22:46:46.699151+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=********.herokuapp.com request_id=c18ebfa7-05ed-4080-b987-86a00864417d fwd="76.219.245.151" dyno= connect= service= status=503 bytes=
    2015-01-03T22:47:33.890378+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=********.herokuapp.com request_id=3d01bc7e-00b3-49df-943c-138323bc1d9f fwd="76.219.245.151" dyno= connect= service= status=503 bytes=
    2015-01-03T22:47:34.341679+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=********.herokuapp.com request_id=232f84f8-89bf-4674-a0b9-4b980a4cb52a fwd="76.219.245.151" dyno= connect= service= status=503 bytes=
    2015-01-03T22:51:15.272292+00:00 heroku[web.1]: State changed from crashed to starting
    2015-01-03T22:51:19.432226+00:00 heroku[web.1]: Starting process with command `gunicorn kloudtransfer.wsgi --log-file -`
    2015-01-03T22:51:20.376370+00:00 app[web.1]: [2015-01-03 22:51:20 +0000] [2] [INFO] Starting gunicorn 19.1.1
    2015-01-03T22:51:20.389827+00:00 app[web.1]: [2015-01-03 22:51:20 +0000] [7] [ERROR] Exception in worker process:
    2015-01-03T22:51:20.389829+00:00 app[web.1]: Traceback (most recent call last):
    2015-01-03T22:51:20.389836+00:00 app[web.1]:     self.wsgi = self.app.wsgi()
    2015-01-03T22:51:20.389838+00:00 app[web.1]:   File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/app/base.py", line 66, in wsgi
    2015-01-03T22:51:20.389831+00:00 app[web.1]:   File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/arbiter.py", line 507, in spawn_worker
    2015-01-03T22:51:20.389832+00:00 app[web.1]:     worker.init_process()
    2015-01-03T22:51:20.389844+00:00 app[web.1]:   File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 52, in load_wsgiapp
    2015-01-03T22:51:20.389834+00:00 app[web.1]:   File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/workers/base.py", line 114, in init_process
    2015-01-03T22:51:20.389847+00:00 app[web.1]:   File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/util.py", line 356, in import_app
    2015-01-03T22:51:20.389848+00:00 app[web.1]:     __import__(module)
    2015-01-03T22:51:20.389845+00:00 app[web.1]:     return util.import_app(self.app_uri)
    2015-01-03T22:51:20.389849+00:00 app[web.1]: ImportError: No module named kloudtransfer.wsgi
    2015-01-03T22:51:20.389839+00:00 app[web.1]:     self.callable = self.load()
    2015-01-03T22:51:20.389853+00:00 app[web.1]:   File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/arbiter.py", line 507, in spawn_worker
    2015-01-03T22:51:20.389857+00:00 app[web.1]:     self.wsgi = self.app.wsgi()
    2015-01-03T22:51:20.389856+00:00 app[web.1]:   File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/workers/base.py", line 114, in init_process
    2015-01-03T22:51:20.389854+00:00 app[web.1]:     worker.init_process()
    2015-01-03T22:51:20.389841+00:00 app[web.1]:   File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 65, in load
    2015-01-03T22:51:20.389858+00:00 app[web.1]:   File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/app/base.py", line 66, in wsgi
    2015-01-03T22:51:20.389860+00:00 app[web.1]:     self.callable = self.load()
    2015-01-03T22:51:20.389851+00:00 app[web.1]: Traceback (most recent call last):
    2015-01-03T22:51:20.389842+00:00 app[web.1]:     return self.load_wsgiapp()
    2015-01-03T22:51:20.389862+00:00 app[web.1]:     return self.load_wsgiapp()
    2015-01-03T22:51:20.389861+00:00 app[web.1]:   File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 65, in load
    2015-01-03T22:51:20.389864+00:00 app[web.1]:   File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 52, in load_wsgiapp
    2015-01-03T22:51:20.389865+00:00 app[web.1]:     return util.import_app(self.app_uri)
    2015-01-03T22:51:20.389869+00:00 app[web.1]: ImportError: No module named kloudtransfer.wsgi
    2015-01-03T22:51:20.389866+00:00 app[web.1]:   File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/util.py", line 356, in import_app
    2015-01-03T22:51:20.389920+00:00 app[web.1]: [2015-01-03 22:51:20 +0000] [7] [INFO] Worker exiting (pid: 7)
    2015-01-03T22:51:20.411882+00:00 app[web.1]:     WSGIApplication("%(prog)s [OPTIONS] [APP_MODULE]").run()
    2015-01-03T22:51:20.411745+00:00 app[web.1]: Traceback (most recent call last):
    2015-01-03T22:51:20.411899+00:00 app[web.1]:   File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/app/base.py", line 185, in run
    2015-01-03T22:51:20.389868+00:00 app[web.1]:     __import__(module)
    2015-01-03T22:51:20.411797+00:00 app[web.1]:     sys.exit(run())
    2015-01-03T22:51:20.411756+00:00 app[web.1]:   File "/app/.heroku/python/bin/gunicorn", line 11, in <module>
    2015-01-03T22:51:20.411980+00:00 app[web.1]:   File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/app/base.py", line 71, in run
    2015-01-03T22:51:20.411957+00:00 app[web.1]:     super(Application, self).run()
    2015-01-03T22:51:20.411831+00:00 app[web.1]:   File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 74, in run
    2015-01-03T22:51:20.412028+00:00 app[web.1]:     Arbiter(self).run()
    2015-01-03T22:51:20.412037+00:00 app[web.1]:   File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/arbiter.py", line 169, in run
    2015-01-03T22:51:20.412095+00:00 app[web.1]:     self.manage_workers()
    2015-01-03T22:51:20.412124+00:00 app[web.1]:   File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/arbiter.py", line 477, in manage_workers
    2015-01-03T22:51:20.377223+00:00 app[web.1]: [2015-01-03 22:51:20 +0000] [2] [INFO] Using worker: sync
    2015-01-03T22:51:20.412216+00:00 app[web.1]:     self.spawn_workers()
    2015-01-03T22:51:20.412369+00:00 app[web.1]:   File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/arbiter.py", line 209, in handle_chld
    2015-01-03T22:51:20.412352+00:00 app[web.1]:     time.sleep(0.1 * random.random())
    2015-01-03T22:51:20.412241+00:00 app[web.1]:   File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/arbiter.py", line 542, in spawn_workers
    2015-01-03T22:51:20.412617+00:00 app[web.1]: gunicorn.errors.HaltServer: <HaltServer 'Worker failed to boot.' 3>
    2015-01-03T22:51:20.412423+00:00 app[web.1]:     self.reap_workers()
    2015-01-03T22:51:20.412531+00:00 app[web.1]:     raise HaltServer(reason, self.WORKER_BOOT_ERROR)
    2015-01-03T22:51:20.412445+00:00 app[web.1]:   File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/arbiter.py", line 459, in reap_workers
    2015-01-03T22:51:20.377122+00:00 app[web.1]: [2015-01-03 22:51:20 +0000] [2] [INFO] Listening at: http://0.0.0.0:33948 (2)
    2015-01-03T22:51:20.386362+00:00 app[web.1]: [2015-01-03 22:51:20 +0000] [7] [INFO] Booting worker with pid: 7
    2015-01-03T22:51:21.134334+00:00 heroku[web.1]: Process exited with status 1
    2015-01-03T22:51:21.142751+00:00 heroku[web.1]: State changed from starting to crashed
    2015-01-03T22:52:51.692809+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=********.herokuapp.com request_id=40d3f828-33c2-496b-857e-254b04f0e4b4 fwd="76.219.245.151" dyno= connect= service= status=503 bytes=
    2015-01-03T22:52:52.139220+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=********.herokuapp.com request_id=16faff32-d5e8-4c95-bbb1-9fe925a9f06a fwd="76.219.245.151" dyno= connect= service= status=503 bytes=
    2015-01-03T22:55:58.043990+00:00 heroku[api]: Scale to web=1 by 
    2015-01-03T22:56:19.657175+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=********.herokuapp.com request_id=2112cd2a-cb24-4b39-8c30-bbbd0310f591 fwd="76.219.245.151" dyno= connect= service= status=503 bytes=
    2015-01-03T22:56:20.209062+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=********.herokuapp.com request_id=6def1f02-58fb-4159-a1fc-24785d0dda30 fwd="76.219.245.151" dyno= connect= service= status=503 bytes=
    2015-01-03T23:01:40.733527+00:00 heroku[api]: Starting process with command `rake db:migrate` by 
    2015-01-03T23:01:44.723691+00:00 heroku[run.4763]: Awaiting client
    2015-01-03T23:01:44.767936+00:00 heroku[run.4763]: Starting process with command `rake db:migrate`
    2015-01-03T23:01:45.149440+00:00 heroku[run.4763]: State changed from starting to up
    2015-01-03T23:01:46.067940+00:00 heroku[run.4763]: Process exited with status 1
    2015-01-03T23:01:46.075743+00:00 heroku[run.4763]: State changed from up to complete
    2015-01-03T23:03:41.680240+00:00 heroku[api]: Starting process with command `manage.py syncdb` by 
    2015-01-03T23:03:45.259429+00:00 heroku[run.7786]: Awaiting client
    2015-01-03T23:03:45.289053+00:00 heroku[run.7786]: Starting process with command `manage.py syncdb`
    2015-01-03T23:03:45.662522+00:00 heroku[run.7786]: State changed from starting to up
    2015-01-03T23:03:46.306182+00:00 heroku[run.7786]: Process exited with status 127
    2015-01-03T23:03:46.320081+00:00 heroku[run.7786]: State changed from up to complete
    2015-01-03T23:03:54.458085+00:00 heroku[api]: Starting process with command `manage.py migrate` by 
    2015-01-03T23:03:59.152940+00:00 heroku[run.3392]: Awaiting client
    2015-01-03T23:03:59.194310+00:00 heroku[run.3392]: Starting process with command `manage.py migrate`
    2015-01-03T23:03:59.487031+00:00 heroku[run.3392]: State changed from starting to up
    2015-01-03T23:04:00.362279+00:00 heroku[run.3392]: Process exited with status 127
    2015-01-03T23:04:00.384439+00:00 heroku[run.3392]: State changed from up to complete
    2015-01-03T23:08:25.563258+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=********.herokuapp.com request_id=b877964b-aff9-4454-a389-a2f5fc718919 fwd="76.219.245.151" dyno= connect= service= status=503 bytes=
    2015-01-03T23:08:26.017772+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=********.herokuapp.com request_id=f6ac4bdc-be45-4f6f-a696-d2a45056dc7c fwd="76.219.245.151" dyno= connect= service= status=503 bytes=

    Contents of WSGI file:

    """
    WSGI config for kloudless project.
    
    It exposes the WSGI callable as a module-level variable named ``application``.
    
    For more information on this file, see
    https://docs.djangoproject.com/en/dev/howto/deployment/wsgi/
    """
    
    import os
    os.environ.setdefault("DJANGO_SETTINGS_MODULE", "kloudless.settings")
    
    from django.core.wsgi import get_wsgi_application
    application = get_wsgi_application()
    
    from django.core.wsgi import get_wsgi_application
    from dj_static import Cling
    
    application = Cling(get_wsgi_application())

  • user2738206
    user2738206 over 9 years
    Ok I edited the wsgi file and 'git push heroku master' and it came with the same error log: pastebin.com/HKPYJgZ7
  • user2738206
    user2738206 over 9 years
    foreman start works just fine, boots up the server only if i edit the Procfile from "web: gunicorn kloudtransfer.wsgi --log-file -" to "web: gunicorn kloudless.wsgi --log-file -". my root directory is kloudtransfer, and then i have app folder, kloudless folder, and other files in kloudtransfer.