I was trying to deploy a flask application online on heroku, The App is utilising SocketIO and Vanilla JS to handle the messages. I excepted it to run absolutely fine, It went smoothly and everything was installed but at the end, A Application Error Came Up saying-
"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. You can do this from the Heroku CLI with the command heroku logs --tail"
In my command prompt I had a look at heroku logs --tail
And got these results, I don't understand much about networking and heroku so please be light with my question.
D:\Aryan\Programming\Flask\Chat App SocketIO>heroku logs --tail
2021-02-11T08:45:34.666077+00:00 app[api]: Initial release by user umasaryan#gmail.com
2021-02-11T08:45:34.666077+00:00 app[api]: Release v1 created by user umasaryan#gmail.com
2021-02-11T08:45:34.991030+00:00 app[api]: Enable Logplex by user umasaryan#gmail.com
2021-02-11T08:45:34.991030+00:00 app[api]: Release v2 created by user umasaryan#gmail.com
2021-02-11T08:46:05.544056+00:00 heroku[router]: at=info code=H81 desc="Blank app" method=GET path="/" host=fathomless-ridge-52370.herokuapp.com request_id=36071200-cbca-4ad7-b220-3f73cf436ab1 fwd="103.208.71.79" dyno= connect= service= status=502 bytes= protocol=https
2021-02-11T08:46:05.935453+00:00 heroku[router]: at=info code=H81 desc="Blank app" method=GET path="/favicon.ico" host=fathomless-ridge-52370.herokuapp.com request_id=ba898a18-92e8-4271-96c9-786d8abc9f39 fwd="103.208.71.79" dyno= connect= service= status=502 bytes= protocol=https
2021-02-11T08:49:02.160398+00:00 heroku[router]: at=info code=H81 desc="Blank app" method=GET path="/" host=openbrainstorm.herokuapp.com request_id=f1c07f1b-99f9-4955-8464-060b33a38cf2 fwd="103.208.71.79" dyno= connect= service= status=502 bytes= protocol=https
2021-02-11T08:49:59.000000+00:00 app[api]: Build started by user umasaryan#gmail.com
2021-02-11T08:50:23.887409+00:00 app[api]: Deploy 7910bc2e by user umasaryan#gmail.com
2021-02-11T08:50:23.887409+00:00 app[api]: Release v3 created by user umasaryan#gmail.com
2021-02-11T08:50:32.000000+00:00 app[api]: Build succeeded
2021-02-11T08:51:06.781160+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/" host=openbrainstorm.herokuapp.com request_id=aa5747b5-6d22-41a4-bb54-e63607e80712 fwd="103.208.71.79" dyno= connect= service= status=503 bytes= protocol=https
I tried to fix this error by adding the Procfile that looks like this-
web: gunicorn app:app --preload
This is what my directory structure looks like-
Directory Structure Here
But still my issue was not resolved.
Any more debugging details on this question are welcomeMy Git Repo- https://github.com/ahmishra/Flask-ChatApp
The first thing to do is to place the Procfile in the directory, where you initialized your git repository(where your requirements.txt is placed) or else Heroku will not be able to find it. Also you have not specified gunicorn in your requirements.txt so you also need to do that. Finally, I would like to say that you may run into error(gunicorn issue) if you have same name of your folder and file(app and app.py). So, you can rename app.py to appp.py and write this in the Procfile--
web: gunicorn appp:app
Which means that gunicorn will try to find app module in appp.py.
Related
I am attempting to create a web app to heroku.
It says that it deploys successfully but when I try to open it I get an error saying to check the console log.
There I find the following error code:
at=error code=H14 desc="No web processes running" method=GET path="/" host=name_name.herokuapp.com request_id=40cff699-28b5-4ea7-985b-c135dc8a526b fwd="174.16.132.201" dyno= connect= service= status=503 bytes= protocol=https
After searching around it appears to be a problem with my procfile. I have tried switching between 'web' and 'worker' but both give me the same error (above). Other peoples procfiles look very different to mine but I don't know enough about them to know what to change.
My current procfile:
worker: sh setup.sh && streamlit run name_name.py
Sample Procfile, note it must be capital P.
The app.py is the script filename.
web: sh setup.sh && streamlit run app.py
I have recently been trying to deploy my application to Heroku. I was following the documentation and everything but I'm getting this error now.
2020-03-12T21:46:36.154267+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=semsar-flask.herokuapp.com request_id=8c7e6604-97a5-4f5c-ae62-6c2edb73a4bb fwd="217.164.64.29" dyno= connect= service= status=503 bytes= protocol=https
This is my Procfile:
web: gunicorn wsgi: app
Wsgi.py:
from wbp import app
Did I make a mistake filling in those two files or what? Please do explain since I'm relatively new to this.
An H10 error could mean many possibilities and answering all solutions here would be tedious. You should also read here and see if any of those are helpful.
Also try to avoid empty spaces in Procfile. So try changing from this
web: gunicorn wsgi: app
To this
web:gunicorn wsgi:app
and see if it works.
For the app crashed h10 error check that your SECRET_KEY is added to Heroku. Also when logged in to Heroku, click on 'More' in the top right of the page and then 'Restart all dynos'. Both have helped me in the past with this specific error.
I'm trying to deploy my django website to heroku but I get an Application Error shown on the webpage. Looking at my logs using heroku logs --tail (what it tells me to do on webpage), I recieve an error
2019-07-27T06:14:34.046386+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/" host=prremia.herokuapp.com request_id=20cd473d-50c2-43b6-892e-ce8f8981229d fwd="49.36.8.33" dyno= connect= service= status=503 bytes= protocol=https
2019-07-27T06:14:34.878053+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/favicon.ico" host=prremia.herokuapp.com request_id=53c5e449-ba17-4e93-86f9-7b70eeb7e074 fwd="49.36.8.33" dyno= connect= service= status=503 bytes= protocol=https
I followed the instructions from Django's docs.
Django 2.2.3
Python 3.7.3
Heroku-18
My webpage:
Make sure your put your Procfile at the root of project along with manage.py. Also make sure you pushed the code from your project root.
Bind port dynamically in your Procfile. Here's an example:-
web: gunicorn --bind 0.0.0.0:$PORT prremia.wsgi
$PORT is an environment variable. You must do scaling too.
Note: Make sure your project name exactly matches with <project_name>.wsgi in your Procfile.
Some time silly mistake is there when some one create Procfile as text file
so use the given command in your cmd to generate Prockfile:-
echo "web: python app.py" > Procfile
// I hope my answer help you.
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 11 months ago.
Improve this question
I finished a project (Week 8 CS50) and wanted to put it on the web. It works fine in the Cloud9 IDE and the localized web server. It's "application.py" and uses Flask (configured for me by CS50).
So I read up on deploying, and made several attempts to deploy on Heroku. Can't get it to work.
Error Log:
2017-02-13T04:48:13.132359+00:00 heroku[web.1]: State changed from
crashed to starting
2017-02-13T04:48:17.100053+00:00 heroku[web.1]:
Starting process with command python application.py
2017-02-13T04:48:20.884225+00:00 heroku[web.1]: Process exited with
status 0
2017-02-13T04:48:20.902452+00:00 heroku[web.1]: State
changed from starting to crashed
2017-02-13T04:57:31.197394+00:00
heroku[router]: at=error code=H10 desc="App crashed" method=GET
path="/" host=goldsteinsentiments.herokuapp.com
request_id=e917b69b-7636-40c9-9547-a2df2aaa1f3d fwd="50.39.98.15"
dyno= connect= service= status=503 bytes=
2017-02-13T04:57:31.307356+00:00 heroku[router]: at=error code=H10
desc="App crashed" method=GET path="/favicon.ico"
host=goldsteinsentiments.herokuapp.com
request_id=096751c7-5cd0-4ba2-8705-6bf61578d516 fwd="50.39.98.15"
dyno= connect= service= status=503 bytes=
Procfile (Copied one from stackoverflow):
"web: python application.py"
Main application.py:
https://github.com/jamesdylangoldstein/sentiments/blob/master/application.py
All the files:
https://github.com/jamesdylangoldstein/sentiments
Steps to deploy:
1) Procfile contains:
web: gunicorn application:app
2) In requirements.txt type:
gunicorn
Based on the code you posted on GitHub, there are a few changes I would suggest to overcome this error:
Add the following to the end of your python program:
if __name__ == "__main__":
app.run()
make sure that app is defined (it seems to be in your case), and that you do not specify a port parameter in the .run() method. Heroku will crash if you define a port number in advance.
Make sure all dependencies are specified in requirements.txt. Make sure that your Procfile and requirements are properly stated as #James Goldstein defined.
Some web servers such as Azure require the python app to be named app.py by default. I do not know if this is the case with Heroku, but for some servers this could be an issue.
If your created your application using "create_app" factory so your Procfile shuld contains:
web: gunicorn -w 4 "my_project:create_app()"
I pushed my application to heroku and when I run heroku open I get an application error
I checked my logs and this was one of the error prints:
(2012-08-01T22:20:28+00:00 heroku[router]: Error H14 (No web processes running) -> GET wawacom-trotroapp.herokuapp.com/ dyno= queue= wait= service= status=503 bytes)
The app is a django app designed with a sqlite3. Can anysomebody help me?
https://devcenter.heroku.com/articles/error-codes#h14-no-web-processes-running
Looks like you need to scale up your web processes;
heroku ps:scale web=1
This should help. Follow the guide from Heroku. https://devcenter.heroku.com/articles/django