Ermias Kidanegebre
Ermias Kidanegebre

Reputation: 87

django project with heroku: application error

I successfully deploy the project to Heroku. but when I run Heroku open it throws Application error An error occurred in the application and your page could not be served. If you are the application owner, check your logs for details.

my logs is here

(dj12) λ heroku logs
2018-07-05T07:06:17.443987+00:00 app[api]: Initial release by user     [email protected]
2018-07-05T07:06:17.443987+00:00 app[api]: Release v1 created by user [email protected]
2018-07-05T07:06:17.909289+00:00 app[api]: Release v2 created by user [email protected]
2018-07-05T07:06:17.909289+00:00 app[api]: Enable Logplex by user [email protected]
2018-07-05T07:16:35.051508+00:00 app[api]: Attach DATABASE (@ref:postgresql-shaped-50056) by user [email protected]
2018-07-05T07:16:35.051508+00:00 app[api]: Release v3 created by user [email protected]
2018-07-05T07:24:48.143580+00:00 app[api]: Set SECRET_KEY config vars by user [email protected]
2018-07-05T07:24:48.143580+00:00 app[api]: Release v4 created by user [email protected]
2018-07-05T07:33:04.050618+00:00 app[api]: Set SECRET_KEY config vars by user [email protected]
2018-07-05T07:33:04.050618+00:00 app[api]: Release v5 created by user [email protected]
2018-07-05T07:40:34.881810+00:00 app[api]: Set EMAIL_PASSWORD config vars by user [email protected]
2018-07-05T07:40:34.881810+00:00 app[api]: Release v6 created by user [email protected]
2018-07-05T07:49:13.302208+00:00 app[api]: Release v7 created by user [email protected]
2018-07-05T07:49:13.302208+00:00 app[api]: Set DISABLE_COLLECTSTATIC config vars by user [email protected]
2018-07-05T07:54:43.000000+00:00 app[api]: Build started by user [email protected]
2018-07-05T07:55:09.406852+00:00 app[api]: Release v8 created by user [email protected]
2018-07-05T07:55:09.406852+00:00 app[api]: Deploy 2fdb68de by user [email protected]
2018-07-05T07:55:18.000000+00:00 app[api]: Build succeeded
2018-07-05T07:57:14.239360+00:00 app[api]: Starting process with command `python manage.py migrate` by user [email protected]
2018-07-05T07:57:20.853528+00:00 heroku[run.2986]: State changed from starting to up
2018-07-05T07:57:20.965558+00:00 heroku[run.2986]: Awaiting client
2018-07-05T07:57:21.013142+00:00 heroku[run.2986]: Starting process with command `python manage.py migrate`
2018-07-05T07:57:26.012552+00:00 heroku[run.2986]: Process exited with status 1
2018-07-05T07:57:26.032134+00:00 heroku[run.2986]: State changed from up to complete
2018-07-05T08:01:58.000000+00:00 app[api]: Build started by user [email protected]
2018-07-05T08:02:15.941485+00:00 app[api]: Release v9 created by user [email protected]
2018-07-05T08:02:15.941485+00:00 app[api]: Deploy 8a0e03de by user [email protected]
2018-07-05T08:02:25.000000+00:00 app[api]: Build succeeded
2018-07-05T08:03:43.462294+00:00 heroku[run.1120]: Awaiting client
2018-07-05T08:03:43.510884+00:00 heroku[run.1120]: Starting process with command `python manage.py migrate`
2018-07-05T08:03:43.859691+00:00 heroku[run.1120]: State changed from starting to up
 2018-07-05T08:03:37.888541+00:00 app[api]: Starting process with command `python manage.py migrate` by user [email protected]
2018-07-05T08:03:53.506152+00:00 heroku[run.1120]: Process exited with status 0
2018-07-05T08:03:53.525335+00:00 heroku[run.1120]: State changed from up to complete
2018-07-05T08:13:52.212453+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/" host=django-ecommerce-2.herokuapp.com request_id=750bffb9-e6bb-4ea7-94bd-09772529bf3c fwd="82.26.20.87" dyno= connect= service= status=503 bytes= protocol=https
2018-07-05T08:13:52.636447+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/favicon.ico" host=django-ecommerce-2.herokuapp.com request_id=be57a379-0d82-4251-9218-049d3cdfb9a6 fwd="82.26.20.87" dyno= connect= service= status=503 bytes= protocol=https
2018-07-05T08:57:48.239032+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/" host=django-ecommerce-2.herokuapp.com request_id=e5708b4e-1ef6-4167-a70a-0a99c9b8aecf fwd="82.26.20.87" dyno= connect= service= status=503 bytes= protocol=https
 2018-07-05T08:57:48.702316+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/favicon.ico" host=django-ecommerce-2.herokuapp.com request_id=d92730e4-c5e9-4570-a709-311a07e0e3dc fwd="82.26.20.87" dyno= connect= service= status=503 bytes= protocol=https
2018-07-05T09:11:36.000000+00:00 app[api]: Build started by user [email protected]
2018-07-05T09:11:53.696459+00:00 app[api]: Deploy 2993315c by user [email protected]
 2018-07-05T09:11:53.696459+00:00 app[api]: Release v10 created by user [email protected]
2018-07-05T09:12:03.000000+00:00 app[api]: Build succeeded
2018-07-05T09:32:26.285646+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/" host=django-ecommerce-2.herokuapp.com request_id=08b476e4-c7f9-43b4-b706-9d44d3b8c8c1 fwd="82.26.20.87" dyno= connect= service= status=503 bytes= protocol=https
2018-07-05T09:32:55.648599+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/" host=django-ecommerce-2.herokuapp.com request_id=5e4b151f-757b-49ad-8138-c47877c2c3e1 fwd="82.26.20.87" dyno= connect= service= status=503 bytes= protocol=https
2018-07-05T11:09:37.172582+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/" host=django-ecommerce-2.herokuapp.com request_id=ea6c2402-cfe2-4cb5-a910-2b6d152174f4 fwd="82.26.20.87" dyno= connect= service= status=503 bytes= protocol=https
2018-07-05T11:10:05.085667+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/" host=django-ecommerce-2.herokuapp.com request_id=f91cef75-167c-4160-8709-e73736384dbc fwd="82.26.20.87" dyno= connect= service= status=503 bytes= protocol=https
2018-07-05T11:10:06.448716+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/" host=django-ecommerce-2.herokuapp.com request_id=5fa29e24-e3d1-439f-bf88-dd1f266ac85a fwd="82.26.20.87" dyno= connect= service= status=503 bytes= protocol=https
 2018-07-05T11:22:38.501221+00:00 app[api]: Starting process with command `bash` by user [email protected]
 2018-07-05T11:22:43.651327+00:00 heroku[run.8345]: Awaiting client
 2018-07-05T11:22:43.684186+00:00 heroku[run.8345]: Starting process with command `bash`
 2018-07-05T11:22:43.729572+00:00 heroku[run.8345]: State changed from starting to up
 2018-07-05T11:29:31.865357+00:00 heroku[run.8345]: Process exited with status 127
 2018-07-05T11:29:32.006562+00:00 heroku[run.8345]: State changed from up to     complete

my procfile

"web: gunicorn ecommerce2.wsgi" 

my wsgi.py

import os

from django.core.wsgi import get_wsgi_application

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "ecommerce2.settings")

application = get_wsgi_application()

and from the documentation errors related to H14 can be fixed with heroku ps:scale web=1 and this pop out

Scaling dynos... !
!    Couldn't find that process type.

when I check my Heroku account the Dynos in the resource is saying the below tex, eventhough I added my Procfile successfully.

This app has no process types yet 
Add a Procfile to your app in order to define its process types. Learn more

how could I fix this issue? thanks for your help.

Upvotes: 1

Views: 2236

Answers (3)

Prakriti Shaurya
Prakriti Shaurya

Reputation: 197

Today I faced the same error. In my root directory, I had Procfile without any extention but when I opened the code in visual studio code, the Procfile had the extension .txt and was present as "Procfile.txt". I just removed the .txt from the file and saved it. This resolved my error.

You can refer to my post for more clarification:

Getting application error while running the python app on heroku

Upvotes: 0

Damien MATHIEU
Damien MATHIEU

Reputation: 32629

Your app doesn't have any process running.

You need to scale your web dyno with the heroku ps:scale web=1 command.

Of course, this assumes you have configured a web process type in your Procfile.

Upvotes: 0

Ojas Kale
Ojas Kale

Reputation: 2159

Last time when I had this issue it was related to requirement not found. update your requirements.txt file from your local.

Also what you want to do is in your settings.py

DEBUG = False
DEBUG_PROPAGATE_EXCEPTIONS = True

Add these lines for production. This will propogate error to log. There you can see why you are getting application error.

(I am willing to bet its a some missing package. Let me know what it was.)

Upvotes: 2

Related Questions